Notes from the Wired

Neovim Tricks

Published: April 4, 2024

This is a short cheat sheet for important keybindings in vim more specific for neovim. I am using NVChad as such not all keybindings are applicable to standard vim/nvim.
Capitalization is important!

Modes:

Navigation:

Navigating Code:

Files:

Selecting:

Editing:

Search:

Misc:

Telescope File Browser

Search and Replace

Debugging Neovim

  1. Start Neovim
  2. Find the PID of neovim :lua print(vim.fn.getpid()) or use something like htop or btop.
  3. Attach the debugger to neovim gdb -tui -p PID nvim, the gdb interactive prompt will appear, useful commands:
    -n step over the next statement
    -s step into the next statement
    -c continue
    -finish step out of the current function
    -bt to see the backtrace from current location
  4. Reproduce the bug and check the backtrace

References: