feat: add base config

This commit is contained in:
tsorabel-pc 2024-03-06 21:42:29 +01:00
parent 66e2a5a425
commit 71d5792e45
2 changed files with 25 additions and 8 deletions

View File

@ -102,7 +102,7 @@ vim.g.have_nerd_font = false
vim.opt.number = true
-- You can also add relative line numbers, for 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'
@ -254,7 +254,7 @@ require('lazy').setup({
},
},
},
--
-- NOTE: Plugins can also be configured to run lua code when they are loaded.
--
-- This is often very useful to both group configuration, as well as handle
@ -269,7 +269,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'
@ -320,7 +319,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:
@ -535,14 +534,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({
lsp_fallback = true,
},
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' },
},
},
},
@ -712,6 +722,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')