Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save jehaby/a0dfdd516d1eaa394cacd3848759f98e to your computer and use it in GitHub Desktop.

Select an option

Save jehaby/a0dfdd516d1eaa394cacd3848759f98e to your computer and use it in GitHub Desktop.
vim wtfs from long-time emacs/vscode/jetbrains noob

verbose map <enter> returns "no mapping found" in regular buffer, although pressing in regular buffer moves the cursor to the beginning of the next line. in neotree buffer verbose map <enter> returns something about . wtf?

● Good questions! This is a common Vim confusion:

<CR> = <Enter> = Enter key

<CR> stands for "Carriage Return" - it's Vim's internal notation for the Enter key. Same thing, different name.

Why "no mapping found" in regular buffer?

Because there is no mapping. The cursor moving to the next line is built-in Vim behavior, not a mapping. :map only shows custom mappings (user/plugin defined), not Vim's hardcoded defaults.

Built-in behaviors like:

  • j moves down
  • <CR> goes to beginning of next line
  • w jumps word

...are not mappings. They're native Vim motions.

Why neo-tree shows <CR>?

Neo-tree overrides the Enter key in its buffer with a custom mapping (to open files). That's why :verbose map shows something there - it's a plugin-defined mapping.

TL;DR

:map <CR> -- shows custom mappings for Enter (if any) :h <CR> -- shows built-in behavior documentation

Use :h {key} to see what a key does natively:\

:h j
:h w
:h <CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment