feat: add base config

This commit is contained in:
tsorabel-pc 2024-03-06 21:42:29 +01:00 committed by tsorabel
parent 93fde0556e
commit f1894507ad
2 changed files with 24 additions and 7 deletions

View File

@ -102,7 +102,7 @@ vim.g.have_nerd_font = false
vim.opt.number = true
-- You can also add relative line numbers, to help with jumping.
-- Experiment for yourself to see if you like it!
-- vim.opt.relativenumber = true
vim.opt.relativenumber = true
-- Enable mouse mode, can be useful for resizing splits for example!
vim.opt.mouse = 'a'
@ -272,7 +272,6 @@ require('lazy').setup({
-- Then, because we use the `config` key, the configuration only runs
-- after the plugin has been loaded:
-- config = function() ... end
{ -- Useful plugin to show you pending keybinds.
'folke/which-key.nvim',
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
@ -323,7 +322,7 @@ require('lazy').setup({
},
config = function()
-- Telescope is a fuzzy finder that comes with a lot of different things that
-- it can fuzzy find! It's more than just a "file finder", it can search
-- it can fuzzy find! It's more than just a --[[ "file finder" ]], it can search
-- many different aspects of Neovim, your workspace, LSP, and more!
--
-- The easiest way to use Telescope, is to start by doing something like:
@ -541,14 +540,14 @@ require('lazy').setup({
-- clangd = {},
-- gopls = {},
-- pyright = {},
-- rust_analyzer = {},
rust_analyzer = {},
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
--
-- Some languages (like typescript) have entire language plugins that can be useful:
-- https://github.com/pmizio/typescript-tools.nvim
--
-- But for many setups, the LSP (`tsserver`) will work just fine
-- tsserver = {},
tsserver = {},
--
lua_ls = {
@ -613,13 +612,24 @@ require('lazy').setup({
}
end,
formatters_by_ft = {
lua = { 'stylua' },
-- Conform can also run multiple formatters sequentially
-- python = { "isort", "black" },
--
-- You can use a sub-list to tell conform to run *until* a formatter
-- is found.
-- javascript = { { "prettierd", "prettier" } },
javascript = { 'prettier' },
typescript = { 'prettier' },
javascriptreact = { 'prettier' },
typescriptreact = { 'prettier' },
svelte = { 'prettier' },
css = { 'prettier' },
html = { 'prettier' },
json = { 'prettier' },
yaml = { 'prettier' },
markdown = { 'prettier' },
graphql = { 'prettier' },
lua = { 'stylua' },
rust = { 'rustfmt' },
},
},
},
@ -724,6 +734,7 @@ require('lazy').setup({
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
{ name = 'path' },
{ name = 'tsserver' },
},
}
end,

6
lua/custom/mappings.lua Normal file
View File

@ -0,0 +1,6 @@
local map = vim.keymap.set
map({ 'n' }, '<leader>cw', ':%s/\\<<C-r><C-w>\\>/<C-r><C-w>/gI<Left><Left><Left>', { desc = '[C]ut [W]orld' })
map({ 'n' }, '<leader>x', '<cmd>bd<CR>', { desc = 'Close buffer' })
map('n', 'n', 'nzzzv')
map('n', 'N', 'Nzzzv')