Comments (3)
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 lazy.nvim
keys
property
from lazyvim.
Don't know if this is the most efficient way but I copied the entire plugins/lsp/init.lua file in my plugins/
folder (I used plugins/lsp.lua
where I put some other lsp related plugin configs) because there were some other things I wanted to change. Relevant changes below:
{
"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 on_attach
call for keymaps I think you're referring to, while keeping the format
opts. Then I add a call to config/lsp_keymaps.lua
(where the optional keymaps.lua
/options.lua
etc files are in the runtime path) that just has a copy of plugins/lsp/keymaps.lua, and from there I can comment out/edit whatever.
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.
from lazyvim.
I'll see for an easier way to override those mapping tomorrow!
from lazyvim.
Related Issues (20)
- util.lualine.pretty_path enhancement HOT 2
- issue: Custom Python formatting for tabstop shiftwidth and autoindent HOT 9
- bug: New warning from extra on `nvim-dap-ui` saying `nvim-nio` to be installed HOT 6
- bug: neotest missing dependency HOT 1
- bug: CMake Tools making DAP load in any file HOT 5
- bug:
- bug: using the tab button makes the cursor jump around like crazy HOT 4
- bug: I can not known this bug HOT 2
- bug: Failed to run `config` for nvim-dap-ui HOT 1
- feature: integration with Jenkinsfile HOT 1
- bug: Parentheses added when importing react functional component HOT 9
- bug: OSC52 not working as expected HOT 2
- bug: lazyvim.util.telescope always sets show_untracked to true in a git repo, preveting recurse_submodules from working with it HOT 4
- bug: typescript extra doesn't configure nvim-dap correctly HOT 3
- bug: getting error after update "attempt to index field 'uv' (a nil value)" HOT 3
- Rustaceanvim is not producing diagnostics HOT 67
- bug: Some file types are not displaying icons for neo-tree, but the icons work fine in nvim edit HOT 2
- bug: Cannot uninstall flash.nvim HOT 3
- bug: LazyVim always show fzf-native to be cleaned even loaded OK HOT 1
- bug: Installing does nothing and opens default nvim HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lazyvim.