-
Notifications
You must be signed in to change notification settings - Fork 0
Switch leap.nvim to Codeberg fork and customize keymaps #4
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -267,10 +267,11 @@ require("lazy").setup({ | |||||||||||||||||
| end | ||||||||||||||||||
| }, | ||||||||||||||||||
| { | ||||||||||||||||||
| "ggandor/leap.nvim", | ||||||||||||||||||
| url = "https://codeberg.org/andyg/leap.nvim", | ||||||||||||||||||
| event = "VeryLazy", | ||||||||||||||||||
| config = function() | ||||||||||||||||||
|
||||||||||||||||||
| config = function() | |
| config = function() | |
| -- NOTE: These mappings intentionally override Vim's built-in: | |
| -- - 's' (substitute character) in normal/visual/operator-pending modes | |
| -- - 'S' (substitute line) in normal mode | |
| -- This matches leap.nvim's default keybindings and provides quick motion | |
| -- on 's'/'S'. If you rely on the original substitute commands, you may | |
| -- want to change these keys or rebind the built-ins to alternative keys. |
Copilot
AI
Feb 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The custom keymaps are missing backward leap functionality. The default leap.nvim mappings include both forward (s/S) and backward (x/X) leap motions, but this configuration only maps forward leap motions. Consider adding mappings for <Plug>(leap-backward) to restore backward leap functionality, for example:
vim.keymap.set({'n', 'x', 'o'}, 'x', '<Plug>(leap-backward)')Additionally, the S mapping now points to <Plug>(leap-from-window) instead of <Plug>(leap-backward) which changes the default behavior. If the intention is to match the default keymaps, S should map to backward leap in normal mode, and the window leap functionality should use a different key.
| vim.keymap.set('n', 'S', '<Plug>(leap-from-window)') | |
| vim.keymap.set({'n', 'x', 'o'}, 'x', '<Plug>(leap-backward)') | |
| vim.keymap.set('n', 'S', '<Plug>(leap-backward)') | |
| vim.keymap.set('n', '<leader>lw', '<Plug>(leap-from-window)') |
Copilot
AI
Feb 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The keymaps are missing description fields. The codebase convention is to add { desc = '...' } to keymap definitions for documentation and which-key.nvim integration. For example:
vim.keymap.set({'n', 'x', 'o'}, 's', '<Plug>(leap)', { desc = 'Leap forward' })
vim.keymap.set('n', 'S', '<Plug>(leap-from-window)', { desc = 'Leap from window' })This improves discoverability and provides inline documentation for users.
| vim.keymap.set({'n', 'x', 'o'}, 's', '<Plug>(leap)') | |
| vim.keymap.set('n', 'S', '<Plug>(leap-from-window)') | |
| vim.keymap.set({'n', 'x', 'o'}, 's', '<Plug>(leap)', { desc = 'Leap forward' }) | |
| vim.keymap.set('n', 'S', '<Plug>(leap-from-window)', { desc = 'Leap from window' }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switching to an unofficial Codeberg fork introduces maintenance and security risks. The fork at
https://codeberg.org/andyg/leap.nvimmay not receive updates, security patches, or bug fixes that are applied to the original repository. Consider documenting why this specific fork is being used (e.g., what features or fixes does it provide?) and establish a process to track upstream changes. If the fork doesn't provide essential functionality, using the official repository (ggandor/leap.nvim) would be more maintainable and secure.