Skip to content

Comments

Switch leap.nvim to Codeberg fork and customize keymaps#4

Open
wardnath wants to merge 1 commit intomainfrom
claude/fix-nvim-telescope-error-kfZrX
Open

Switch leap.nvim to Codeberg fork and customize keymaps#4
wardnath wants to merge 1 commit intomainfrom
claude/fix-nvim-telescope-error-kfZrX

Conversation

@wardnath
Copy link
Owner

Summary

Updated the leap.nvim plugin configuration to use a community fork hosted on Codeberg and replaced the default keymaps with custom ones.

Key Changes

  • Changed leap.nvim source from the original GitHub repository (ggandor/leap.nvim) to a Codeberg fork (https://codeberg.org/andyg/leap.nvim)
  • Replaced require("leap").add_default_mappings() with explicit custom keymaps:
    • s in normal, visual, and operator-pending modes maps to <Plug>(leap)
    • S in normal mode maps to <Plug>(leap-from-window)

Implementation Details

The keymaps are now explicitly defined rather than relying on the plugin's default mappings, providing more control over the leap.nvim behavior and allowing for customization specific to this configuration.

https://claude.ai/code/session_01WKtZ9EdKcXuT6BU3jWqS8n

- Update neovim 0.10.3 -> 0.10.4 in devbox.lock to satisfy
  telescope.nvim minimum version requirement (>= 0.10.4)
- Migrate leap.nvim source from GitHub (ggandor/leap.nvim) to
  Codeberg (https://codeberg.org/andyg/leap.nvim)
- Replace deprecated add_default_mappings() with explicit Plug
  keymaps (s for leap, S for leap-from-window)

https://claude.ai/code/session_01WKtZ9EdKcXuT6BU3jWqS8n
Copilot AI review requested due to automatic review settings February 20, 2026 18:54
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the leap.nvim plugin configuration by switching from the official GitHub repository to a Codeberg fork and replacing default keymaps with custom explicit mappings. The neovim package version was also updated from 0.10.3 to 0.10.4 in the devbox.lock file.

Changes:

  • Switched leap.nvim source from ggandor/leap.nvim (GitHub) to https://codeberg.org/andyg/leap.nvim (Codeberg fork)
  • Replaced require("leap").add_default_mappings() with custom keymaps for s (forward leap) and S (leap from window)
  • Updated neovim version from 0.10.3 to 0.10.4 in devbox.lock

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 4 comments.

File Description
chezmoi/dot_config/nvim/init.lua Updated leap.nvim plugin source to Codeberg fork and defined custom keymaps replacing default mappings
devbox.lock Updated neovim package from version 0.10.3 to 0.10.4 with new Nix store paths

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

config = function()
require("leap").add_default_mappings()
vim.keymap.set({'n', 'x', 'o'}, 's', '<Plug>(leap)')
vim.keymap.set('n', 'S', '<Plug>(leap-from-window)')
Copy link

Copilot AI Feb 20, 2026

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.

Suggested change
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 uses AI. Check for mistakes.
"ggandor/leap.nvim",
url = "https://codeberg.org/andyg/leap.nvim",
event = "VeryLazy",
config = function()
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The custom keymaps override Vim's built-in s (substitute character) and S (substitute line) commands. While this is intentional for leap.nvim's functionality, users who rely on these built-in commands will lose that functionality. Consider documenting this trade-off or using alternative keys if the built-in commands are important to your workflow. The default leap.nvim mappings make the same choice, so this aligns with plugin conventions, but it's worth being aware of the override.

Suggested change
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 uses AI. Check for mistakes.
},
{
"ggandor/leap.nvim",
url = "https://codeberg.org/andyg/leap.nvim",
Copy link

Copilot AI Feb 20, 2026

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.nvim may 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.

Suggested change
url = "https://codeberg.org/andyg/leap.nvim",
"ggandor/leap.nvim",

Copilot uses AI. Check for mistakes.
Comment on lines +273 to +274
vim.keymap.set({'n', 'x', 'o'}, 's', '<Plug>(leap)')
vim.keymap.set('n', 'S', '<Plug>(leap-from-window)')
Copy link

Copilot AI Feb 20, 2026

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.

Suggested change
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' })

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants