Compare commits
3 Commits
7e6d4ae3c0
...
989020e20f
Author | SHA1 | Date | |
---|---|---|---|
989020e20f | |||
d130acc11e | |||
5a4b907f6e |
16
lua/lsp.lua
16
lua/lsp.lua
|
@ -15,7 +15,16 @@ local on_attach = function(_, bufnr)
|
||||||
end
|
end
|
||||||
|
|
||||||
nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
|
nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
|
||||||
nmap('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
|
nmap('<leader>c', vim.lsp.buf.code_action, '[C]ode action') -- NOTE: to see if ca is needed
|
||||||
|
nmap('<leader>f', function() -- https://stackoverflow.com/a/74303272
|
||||||
|
vim.lsp.buf.code_action({
|
||||||
|
filter = function(a)
|
||||||
|
return a.isPreferred
|
||||||
|
end,
|
||||||
|
apply = true
|
||||||
|
})
|
||||||
|
end, 'code action: [F]ix'
|
||||||
|
)
|
||||||
|
|
||||||
nmap('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
|
nmap('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
|
||||||
nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
|
nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
|
||||||
|
@ -44,8 +53,8 @@ end
|
||||||
|
|
||||||
-- document existing key chains
|
-- document existing key chains
|
||||||
require('which-key').add {
|
require('which-key').add {
|
||||||
{ "<leader>c", group = "[C]ode" },
|
-- { "<leader>c", group = "[C]ode" },
|
||||||
{ "<leader>c_", hidden = true },
|
-- { "<leader>c_", hidden = true },
|
||||||
{ "<leader>d", group = "[D]ocument" },
|
{ "<leader>d", group = "[D]ocument" },
|
||||||
{ "<leader>d_", hidden = true },
|
{ "<leader>d_", hidden = true },
|
||||||
{ "<leader>g", group = "[G]it" },
|
{ "<leader>g", group = "[G]it" },
|
||||||
|
@ -87,6 +96,7 @@ local servers = {
|
||||||
pyright = {},
|
pyright = {},
|
||||||
-- rust_analyzer = {},
|
-- rust_analyzer = {},
|
||||||
ts_ls = {},
|
ts_ls = {},
|
||||||
|
eslint = {},
|
||||||
-- html = { filetypes = { 'html', 'twig', 'hbs'} },
|
-- html = { filetypes = { 'html', 'twig', 'hbs'} },
|
||||||
texlab = {},
|
texlab = {},
|
||||||
ltex = {
|
ltex = {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user