-
Notifications
You must be signed in to change notification settings - Fork 943
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
usage: Unclear how to unset lspconfig keybinding #93
Comments
Don't know if this is the most efficient way but I copied the entire plugins/lsp/init.lua file in my {
"neovim/nvim-lspconfig",
-- other relevant lazy.nvim settings here, including opts table
config = function(plugin, opts)
-- other config stuff here
-- setup formatting and keymaps
require("lazyvim.util").on_attach(function(client, buffer)
require("lazyvim.plugins.lsp.format").on_attach(client, buffer)
-- require("lazyvim.plugins.lsp.keymaps").on_attach(client, buffer)
require("config.lsp_keymaps").on_attach(client, buffer)
end)
-- Other config stuff here
})
end
} I comment out the Again, not sure that's the most efficient way, but I like it since I can update to any other changes I want to follow with little hassle, since lazy.nvim makes updates so easy to follow. |
I'll see for an easier way to override those mapping tomorrow! |
I just pushed some change to make it easier to delete/add/change lsp keymaps: {
"neovim/nvim-lspconfig",
init = function()
local keys = require("lazyvim.plugins.lsp.keymaps").get()
-- change a keymap
keys[#keys + 1] = { "K", "<cmd>echo 'hello'<cr>" }
-- disable a keymap
keys[#keys + 1] = { "K", false }
-- add a keymap
keys[#keys + 1] = { "H", "<cmd>echo 'hello'<cr>" }
end,
} The keymap definition is the same as for the |
First, thanks for developing and publishing this, it's really great as a starting point for neovim.
I was checking the
plugins/example.lua
trying to check how to unset premade keybindings by LazyVim. In particular, I want to use theK
keymap in normal mode for moving this around with mini.move. I'm doing this by adding the following to myinit.lua
However, the
on_attach
call by lspconfig that LazyVim preconfigures in keymaps.lua takes precendence soK
doesn't call the mini.move function.As a sanity check
What is the intended way of disabling particular keybindings done vim LazyVim in this way?
The text was updated successfully, but these errors were encountered: