Remove custom LSP keybindings
This commit is contained in:
parent
8f518dd716
commit
ed6c7f1e51
1 changed files with 0 additions and 29 deletions
|
|
@ -1,27 +1,5 @@
|
||||||
-- {{ ansible_managed }}
|
-- {{ ansible_managed }}
|
||||||
|
|
||||||
--use an on_attach function to only map the following keys
|
|
||||||
--after the language server attaches to the current buffer
|
|
||||||
local on_attach = function(client, bufnr)
|
|
||||||
local opts = { buffer = bufnr, noremap = true, silent = true }
|
|
||||||
|
|
||||||
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
|
|
||||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
|
|
||||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
|
|
||||||
vim.keymap.set('n', 'gh', vim.lsp.buf.document_highlight, opts)
|
|
||||||
vim.keymap.set('n', 'gH', vim.lsp.buf.clear_references, opts)
|
|
||||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
|
|
||||||
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts)
|
|
||||||
|
|
||||||
vim.keymap.set('n', '<space>la', vim.lsp.buf.code_action, opts)
|
|
||||||
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, opts)
|
|
||||||
|
|
||||||
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, opts)
|
|
||||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
|
|
||||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
|
|
||||||
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
|
|
||||||
end
|
|
||||||
|
|
||||||
--enable some language servers with the additional completion capabilities
|
--enable some language servers with the additional completion capabilities
|
||||||
--offered by nvim-cmp
|
--offered by nvim-cmp
|
||||||
local auto_setup_servers = {
|
local auto_setup_servers = {
|
||||||
|
|
@ -40,7 +18,6 @@ capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
||||||
|
|
||||||
for _, lsp in ipairs(auto_setup_servers) do
|
for _, lsp in ipairs(auto_setup_servers) do
|
||||||
vim.lsp.config[lsp] = {
|
vim.lsp.config[lsp] = {
|
||||||
on_attach = on_attach,
|
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
@ -50,7 +27,6 @@ local util = require('lspconfig/util')
|
||||||
{% if ansible_facts.os_family == 'Archlinux' %}
|
{% if ansible_facts.os_family == 'Archlinux' %}
|
||||||
|
|
||||||
vim.lsp.config['pyright'] = {
|
vim.lsp.config['pyright'] = {
|
||||||
on_attach = on_attach,
|
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
settings = {
|
settings = {
|
||||||
pyright = {
|
pyright = {
|
||||||
|
|
@ -77,17 +53,14 @@ vim.lsp.config['html'] = {
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.lsp.config['cssls'] = {
|
vim.lsp.config['cssls'] = {
|
||||||
on_attach = on_attach,
|
|
||||||
capabilities = snippet_capabilities,
|
capabilities = snippet_capabilities,
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.lsp.config['jsonls'] = {
|
vim.lsp.config['jsonls'] = {
|
||||||
on_attach = on_attach,
|
|
||||||
capabilities = snippet_capabilities,
|
capabilities = snippet_capabilities,
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.lsp.config['lua_ls'] = {
|
vim.lsp.config['lua_ls'] = {
|
||||||
on_attach = on_attach,
|
|
||||||
capabilities = snippet_capabilities,
|
capabilities = snippet_capabilities,
|
||||||
settings = {
|
settings = {
|
||||||
Lua = {
|
Lua = {
|
||||||
|
|
@ -100,13 +73,11 @@ vim.lsp.config['lua_ls'] = {
|
||||||
|
|
||||||
-- Use system binary for esbonio
|
-- Use system binary for esbonio
|
||||||
vim.lsp.config['esbonio'] = {
|
vim.lsp.config['esbonio'] = {
|
||||||
on_attach = on_attach,
|
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
cmd = { '/usr/bin/esbonio' }
|
cmd = { '/usr/bin/esbonio' }
|
||||||
}
|
}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
vim.lsp.config['yamlls'] = {
|
vim.lsp.config['yamlls'] = {
|
||||||
on_attach = on_attach,
|
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
filetypes = { 'yaml', 'yaml.ansible', 'yaml.docker-compose', 'yaml.gitlab' }
|
filetypes = { 'yaml', 'yaml.ansible', 'yaml.docker-compose', 'yaml.gitlab' }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue