Installing plugins & loading automatically it in Lazy #2008
developemmanuel
started this conversation in
Show and tell
Replies: 1 comment
-
@developemmanuel or lazy=false or event="VeryLazy" or just look for a way to lazyload that plugin just put all of its mappings in its init function or make nvchad styled mappings for them local opts = { noremap = true, silent = true }
-- Normal-mode commands
vim.keymap.set('n', '<A-j>', ':MoveLine(1)<CR>', opts)
vim.keymap.set('n', '<A-k>', ':MoveLine(-1)<CR>', opts)
vim.keymap.set('n', '<A-h>', ':MoveHChar(-1)<CR>', opts)
vim.keymap.set('n', '<A-l>', ':MoveHChar(1)<CR>', opts)
vim.keymap.set('n', '<leader>wf', ':MoveWord(1)<CR>', opts)
vim.keymap.set('n', '<leader>wb', ':MoveWord(-1)<CR>', opts)
-- Visual-mode commands
vim.keymap.set('v', '<A-j>', ':MoveBlock(1)<CR>', opts)
vim.keymap.set('v', '<A-k>', ':MoveBlock(-1)<CR>', opts)
vim.keymap.set('v', '<A-h>', ':MoveHBlock(-1)<CR>', opts)
vim.keymap.set('v', '<A-l>', ':MoveHBlock(1)<CR>', opts) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Issue
I was searching how to install a plugin for moving code lines (move.nvim)
Once I install the plugin
I use the Lazy option to see loaded plugins (
:Lazy
). The plugin wasn't loaded. So I search in the official documentation in the section about (custom mapping) to se how load the plugin. The documentation says that we have to useIn order to load the mappings but it doesn't work.
First approach
So I loaded manually with
:Lazy load move.nvim
and it work, but the issue is that you have to load manually each time you start annvim
session.Solution
So the main solution for issue that I found is by adding this for each plugin:
I hope it helped you 👍
Beta Was this translation helpful? Give feedback.
All reactions