4

I installed the NvChad kit a few hours ago just to try it out. In this setup, I appear unable to jump forward to the next occurrence of a character using the semicolon after the first character match using f. When I hit the ;, the cursor jumps down to the command line as if I typed : (almost like the caps lock key is on, but it's not.)

So when my cursor's on the line I want to search ...

  • ... typing fh jumps my cursor to the next occurence of the h character.

  • ... typing ; immediately after that does not jump to the next h, but sends me into command mode.

Curiously, the comma key to jump backwards works as expected. With my cursor at the end of the line I want to search ...

  • ... typing fh does nothing, because there are no more characters to search in the forward direction.

  • ... typing , immediately after that jumps to the previous h character. Hitting it again finds the one before it, on and on until the cursor reaches the beginning of the line.

So I'm wondering if the NvChad installation clobbers the default semicolon key for some other purpose I haven't discovered yet, or if it simply turns it off and I need to re-enable it via a config file or some other method.

The normal vi behavior of using ; to jump to subsequent matches is a big part of how I navigate and I'd really like to restore it. I haven't found anything about this in the NvChad docs. I've run Neovim in three different terminal apps to troubleshoot and seen this unwanted behavior in all three.

Has anyone else encountered and addressed this?

2
  • Did you check the documentation for NvChad? What does :verbose map ; say?
    – D. Ben Knoble
    Commented Jan 28 at 4:54
  • Welcome to Vim and welcome to NvChad :-) Commented Jan 28 at 7:12

1 Answer 1

4

Yes is does override the vanilla Vim mapping for ;.

You can use the :NvCheatsheet command to look at the NvChad default mapping.

enter image description here

The ; had been remapped to the command execution (the : in vanilla Vim)

You can also use the :Telescope keymaps command to analyze the NvChad default mappings:

enter image description here

The NvChad site has a mapping section that describes how to edit the NvChad mappings

You can change that mapping by editing ~/.config/nvim/lua/custom/mappings.lua (the user defined mappings NvChad)

---@type MappingsTable
local M = {}

M.general = {
  n = {
    [";"] = { ":", "enter command mode", opts = { nowait = true } },
  },
  v = {
    [">"] = { ">gv", "indent"},
  },
}

You can delete the line that starts with [";"]

2
  • If editing that file, do you risk maintenance problems when updating nvchad? Is there a user-override mechanism? (All of these questions are why many of us recommend avoiding distributions :) )
    – D. Ben Knoble
    Commented Jan 28 at 16:00
  • 1
    This file is the file intended for user customization. NvChad upgrade will not touch that file. The NvChad standard mapping are in nvim/lua/core/mappings.lua Commented Jan 28 at 16:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.