feat(cfg): add lsp-format.nvim

https://github.com/lukas-reineke/lsp-format.nvim
This commit is contained in:
EGRrqq 2023-09-20 10:38:24 -05:00
parent 2e4ccafb32
commit 03c4e3a719
2 changed files with 15 additions and 12 deletions

View File

@ -86,7 +86,7 @@ require('lazy').setup({
-- Useful status updates for LSP -- Useful status updates for LSP
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
{ 'j-hui/fidget.nvim', tag = 'legacy', opts = {} }, { 'j-hui/fidget.nvim', tag = 'legacy', opts = {} },
-- Additional lua configuration, makes nvim stuff amazing! -- Additional lua configuration, makes nvim stuff amazing!
'folke/neodev.nvim', 'folke/neodev.nvim',
@ -110,7 +110,7 @@ require('lazy').setup({
}, },
-- Useful plugin to show you pending keybinds. -- Useful plugin to show you pending keybinds.
{ 'folke/which-key.nvim', opts = {} }, { 'folke/which-key.nvim', opts = {} },
{ {
-- Adds git related signs to the gutter, as well as utilities for managing changes -- Adds git related signs to the gutter, as well as utilities for managing changes
'lewis6991/gitsigns.nvim', 'lewis6991/gitsigns.nvim',
@ -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,
}, },
}, },
@ -147,7 +147,7 @@ require('lazy').setup({
'navarasu/onedark.nvim', 'navarasu/onedark.nvim',
priority = 1000, priority = 1000,
config = function() config = function()
require('onedark').setup { require('onedark').setup {
transparent = true transparent = true
} }
vim.cmd.colorscheme 'onedark' vim.cmd.colorscheme 'onedark'
@ -458,7 +458,7 @@ local servers = {
-- html = { filetypes = { 'html', 'twig', 'hbs'} }, -- html = { filetypes = { 'html', 'twig', 'hbs'} },
-- requirement for https://github.com/olrtg/nvim-emmet -- requirement for https://github.com/olrtg/nvim-emmet
emmet_language_server = {}, emmet_language_server = {},
lua_ls = { lua_ls = {
Lua = { Lua = {
@ -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

View File

@ -7,5 +7,8 @@ return {
'ThePrimeagen/vim-be-good', 'ThePrimeagen/vim-be-good',
--"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",
} }