feat: add base config
This commit is contained in:
parent
93fde0556e
commit
f1894507ad
25
init.lua
25
init.lua
|
@ -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,
|
||||
|
|
|
@ -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')
|
Loading…
Reference in New Issue