mirror of
https://github.com/harivansh-afk/nix.git
synced 2026-04-16 09:04:28 +00:00
transfer
This commit is contained in:
parent
02c996d21a
commit
28622332a3
83 changed files with 6969 additions and 57 deletions
23
config/nvim/lua/config/lsp.lua
Normal file
23
config/nvim/lua/config/lsp.lua
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
local M = {}
|
||||
|
||||
function M.on_attach(_, bufnr)
|
||||
local function buf(mode, lhs, rhs)
|
||||
bmap(mode, lhs, rhs, { buffer = bufnr })
|
||||
end
|
||||
|
||||
buf('n', 'gd', vim.lsp.buf.definition)
|
||||
buf('n', 'gD', vim.lsp.buf.declaration)
|
||||
buf('n', '<C-]>', vim.lsp.buf.definition)
|
||||
buf('n', 'gi', vim.lsp.buf.implementation)
|
||||
buf('n', 'gr', vim.lsp.buf.references)
|
||||
buf('n', 'K', vim.lsp.buf.hover)
|
||||
buf('n', '<leader>rn', vim.lsp.buf.rename)
|
||||
buf({ 'n', 'v' }, '<leader>ca', vim.lsp.buf.code_action)
|
||||
buf('n', '<leader>f', function() vim.lsp.buf.format({ async = true }) end)
|
||||
end
|
||||
|
||||
function M.capabilities()
|
||||
return vim.lsp.protocol.make_client_capabilities()
|
||||
end
|
||||
|
||||
return M
|
||||
Loading…
Add table
Add a link
Reference in a new issue