NVim: lsp format on save
This commit is contained in:
parent
06722274f9
commit
39fc8af382
2 changed files with 4 additions and 1 deletions
|
|
@ -1,6 +1,6 @@
|
|||
local lspconfig = require('lspconfig')
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
|
||||
local lsp_format = require("lsp-format")
|
||||
|
||||
-- Keymaps
|
||||
local keymap = vim.keymap
|
||||
|
|
@ -8,6 +8,8 @@ local opts = { noremap = true, silent = true }
|
|||
local on_attach = function(client, bufnr)
|
||||
opts.buffer = bufnr
|
||||
|
||||
lsp_format.on_attach(client, bufrn)
|
||||
|
||||
opts.desc = "Show LSP references"
|
||||
keymap.set("n", "gR", "<cmd>Telescope lsp_references<CR>", opts)
|
||||
opts.desc = "Go to declaration"
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ let vp = pkgs.vimPlugins; in {
|
|||
config = ''require("fidget").setup({})'';
|
||||
}
|
||||
vp.cmp-nvim-lsp
|
||||
vp.lsp-format-nvim
|
||||
{
|
||||
plugin = vp.nvim-lspconfig;
|
||||
type = "lua";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue