where to put keymappings if using lazy.nvim #135
-
Hi, sorry, but I just cannot get the keymappings to work properly with lazy.nvim. I have tried return {
'mrjones2014/smart-splits.nvim',
build = './kitty/install-kittens.bash',
keys = {
{'n', '<A-h>', require('smart-splits').resize_left, desc='Resize left'},
{'n', '<A-j>', require('smart-splits').resize_down, desc='Resize down'},
{'n', '<A-k>', require('smart-splits').resize_up, desc='Resize up'},
{'n', '<A-l>', require('smart-splits').resize_right, desc='Resize right'},
{'n', '<C-h>', require('smart-splits').move_cursor_left, desc='Move left'},
{'n', '<C-j>', require('smart-splits').move_cursor_down, desc='Move down'},
{'n', '<C-k>', require('smart-splits').move_cursor_up, desc='Move up'},
{'n', '<C-l>', require('smart-splits').move_cursor_right, desc='Move right'},
{'n', '<leader><leader>h', require('smart-splits').swap_buf_left, desc='Swap buffer left'},
{'n', '<leader><leader>j', require('smart-splits').swap_buf_down, desc='Swap buffer down'},
{'n', '<leader><leader>k', require('smart-splits').swap_buf_up, desc='Swap buffer up'},
{'n', '<leader><leader>l', require('smart-splits').swap_buf_right, desc='Swap buffer right'},
}
} But that complains that there is no module smart-splits. Then I tried to add lazy = false to it and added the commands you described to a different lua file, but then Just adding them to another lua file also did not work for me. I'm not a lua developer, so I have no clue where to start off. I understand that there is legendary.nvim, but I currently do not want to add another plugin for keybindings (I have which-key already). Any hints greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 11 replies
-
So, if you define them that way, it will try to The easiest thing would be to just wrap the keymaps in a function like: keys = {
{'n', '<A-h>', function() require('smart-splits').resize_left() end, desc='Resize left'},
} If you happen to be a legendary.nvim user as well, there's also a built-in extension for |
Beta Was this translation helpful? Give feedback.
-
Sorry to hijack the question, but I can open another one if this is pertinent. Yesterday I updated both Neovim (nightly) and Lazy.vim and now I cannot navigate out of Neovim. Moving between splits (neovim) and panes (tmux) works fine. But I cannot move out from Neovim to Tmux (I can from Tmux to Neovim). I'm clueless about the cause of the issue, so hopefully you can help me :) |
Beta Was this translation helpful? Give feedback.
So, if you define them that way, it will try to
require
the plugin before the plugin has been loaded, since this is what is tellinglazy.nvim
how to load the plugin.The easiest thing would be to just wrap the keymaps in a function like:
If you happen to be a legendary.nvim user as well, there's also a built-in extension for
smart-splits.nvim
as well.