nvim: only set lsp keybindings per buffer
This commit is contained in:
parent
82c96d70cf
commit
3c2e6ab8b9
|
@ -352,7 +352,9 @@
|
|||
vim.api.nvim_buf_set_option bufnr "omnifunc" "v:lua.vim.lsp.omnifunc" _
|
||||
# Mappings.
|
||||
# See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
kmSetNs {
|
||||
keymapSetNs {
|
||||
buffer = bufnr;
|
||||
keys = {
|
||||
"gD" = {
|
||||
rhs = vim.lsp.buf.declaration;
|
||||
desc = "Jumps to the declaration of the symbol under the cursor."; };
|
||||
|
@ -392,6 +394,7 @@
|
|||
"<space>f" = {
|
||||
rhs = DEFUN (vim.lsp.buf.format {async = true;});
|
||||
desc = "Formats a buffer."; };
|
||||
};
|
||||
} _
|
||||
])
|
||||
# LET rust_settings
|
||||
|
@ -411,7 +414,7 @@
|
|||
LETREC
|
||||
# LETREC on_attach_rust
|
||||
(on_attach_rust: client: bufnr: L [
|
||||
vim.api.nvim_create_user_command "RustAndroid" (opts: L [
|
||||
vim.api.nvim_buf_create_user_command bufnr "RustAndroid" (opts: L [
|
||||
vim.lsp.set_log_level "debug" _
|
||||
(lsp "rust_analyzer").setup {
|
||||
on_attach = on_attach_rust;
|
||||
|
@ -430,9 +433,9 @@
|
|||
};
|
||||
setupLsp = args: setupLsp' (if builtins.isString args then { name = args; } else args);
|
||||
in on_attach_rust: L [
|
||||
# (vim.lsp.set_log_level "debug")
|
||||
map setupLsp [
|
||||
# vim.lsp.set_log_level "debug" _
|
||||
# see https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
|
||||
map setupLsp [
|
||||
"bashls"
|
||||
"clangd"
|
||||
# https://github.com/python-lsp/python-lsp-server/blob/develop/CONFIGURATION.md
|
||||
|
|
Loading…
Reference in a new issue