Skip to content
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

feature: add keymap group for lazy.nvim, mason, treesitter etc. #1802

Open
1 task done
merikan opened this issue Oct 19, 2023 · 3 comments
Open
1 task done

feature: add keymap group for lazy.nvim, mason, treesitter etc. #1802

merikan opened this issue Oct 19, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@merikan
Copy link

merikan commented Oct 19, 2023

Did you check the docs?

  • I have read all the LazyVim docs

Is your feature request related to a problem? Please describe.

it's not a problem but it would be nice if it was provided by default in LazyVim, since I am lazy.

Describe the solution you'd like

when I periodically update packages, it would have been nice if there was a key group for all package managers that are used, I am thinking of lazy.nvim, mason and treesitter.

For example, <leader>+l and +L are for lazy.nvim and I understand why they are prioritized and given their own letter on the first level, but there are more components that you probably want to open to update/install packages and show logs, etc.

Whether it should be a key-group for just package managers or for general settings with package managers as a subgroup, I don't know.

Describe alternatives you've considered

I could map it myself but I really like the consensus by the community for key bindings, so I don't have to change it 6 months later 😉

Additional context

First of all, I want to thank you and contributors for the work with LazyVim and all the other products you build. I've been using and configuring Neovim, mostly for Java, for some years now but It never ends and I always had the feeling that I was behind. In the end, it was too much configuration and too little actual coding so I decided to switch to LazyVim and put my mind at ease. LazyVim is, in my opinion, the best packaging of Neovim with clear configuration and extension points.

Standing on the shoulders of giants.

@merikan merikan added the enhancement New feature or request label Oct 19, 2023
@nikbrunner
Copy link

nikbrunner commented Oct 19, 2023

This is what I did. "Vin" because thats how I "named" my config.

Link: https://github.com/nikbrunner/lazyvin/blob/53adff36f032a203caca751deb9721974208946e/lua/config/keymaps.lua#L41

local lazyvim_util = require("lazyvim.util")

local set = vim.keymap.set
local del = vim.keymap.del

-- ...

-- Vin Group
-- Delete LazyVim default bindings
del("n", "<leader>l")
del("n", "<leader>L")

set("n", "<leader>vP", "<cmd>Mason<CR>", { desc = "Package Manager - [Mason]" })
set("n", "<leader>vp", "<cmd>Lazy<CR>", { desc = "Plugin Manager - [LazyVim]" })
set("n", "<leader>ve", "<cmd>LazyExtras<CR>", { desc = "Extras Manager - [LazyVim]" })
set("n", "<leader>vi", "<cmd>LspInfo<CR>", { desc = "Lsp Info" })
set("n", "<leader>vc", lazyvim_util.news.changelog, { desc = "Changelog [LazyVim]" })
set("n", "<leader>vr", lazyvim_util.root.info, { desc = "Root Info [LazyVim]" })
set("n", "<leader>vM", vim.cmd.messages, { desc = "Display messages" })

@leisurelicht
Copy link
Contributor

I think having a default group is better.
of course I can map it myself, but you never know when your custom shortcut will conflict with other new shortcuts.

@dpetka2001
Copy link
Contributor

Your custom keymaps will take precedence over default ones. I don't believe this is needed in my personal opinion as a simple user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants