feat(cfg): add lsp-format.nvim
https://github.com/lukas-reineke/lsp-format.nvim
This commit is contained in:
parent
2e4ccafb32
commit
03c4e3a719
14
init.lua
14
init.lua
|
@ -128,16 +128,16 @@ require('lazy').setup({
|
||||||
|
|
||||||
-- don't override the built-in and fugitive keymaps
|
-- don't override the built-in and fugitive keymaps
|
||||||
local gs = package.loaded.gitsigns
|
local gs = package.loaded.gitsigns
|
||||||
vim.keymap.set({'n', 'v'}, ']c', function()
|
vim.keymap.set({ 'n', 'v' }, ']c', function()
|
||||||
if vim.wo.diff then return ']c' end
|
if vim.wo.diff then return ']c' end
|
||||||
vim.schedule(function() gs.next_hunk() end)
|
vim.schedule(function() gs.next_hunk() end)
|
||||||
return '<Ignore>'
|
return '<Ignore>'
|
||||||
end, {expr=true, buffer = bufnr, desc = "Jump to next hunk"})
|
end, { expr = true, buffer = bufnr, desc = "Jump to next hunk" })
|
||||||
vim.keymap.set({'n', 'v'}, '[c', function()
|
vim.keymap.set({ 'n', 'v' }, '[c', function()
|
||||||
if vim.wo.diff then return '[c' end
|
if vim.wo.diff then return '[c' end
|
||||||
vim.schedule(function() gs.prev_hunk() end)
|
vim.schedule(function() gs.prev_hunk() end)
|
||||||
return '<Ignore>'
|
return '<Ignore>'
|
||||||
end, {expr=true, buffer = bufnr, desc = "Jump to previous hunk"})
|
end, { expr = true, buffer = bufnr, desc = "Jump to previous hunk" })
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -555,9 +555,9 @@ vim.opt.relativenumber = true
|
||||||
vim.opt.guicursor = ""
|
vim.opt.guicursor = ""
|
||||||
|
|
||||||
-- 4 tab indenting
|
-- 4 tab indenting
|
||||||
vim.opt.tabstop = 4
|
vim.opt.tabstop = 2
|
||||||
vim.opt.softtabstop = 4
|
vim.opt.softtabstop = 2
|
||||||
vim.opt.shiftwidth = 4
|
vim.opt.shiftwidth = 2
|
||||||
vim.opt.expandtab = true
|
vim.opt.expandtab = true
|
||||||
|
|
||||||
-- move line up/down
|
-- move line up/down
|
||||||
|
|
|
@ -8,4 +8,7 @@ return {
|
||||||
|
|
||||||
--"surroundings": parentheses, brackets, quotes, XML tags, and more
|
--"surroundings": parentheses, brackets, quotes, XML tags, and more
|
||||||
'tpope/vim-surround',
|
'tpope/vim-surround',
|
||||||
|
|
||||||
|
--wrapper around Neovims native LSP formatting
|
||||||
|
"lukas-reineke/lsp-format.nvim",
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue