2

While browsing index.txt looking for space to fit some custom keymappings, I noticed something.

^       - First CHAR of current line
N-      - First CHAR N lines higher
N_      - First CHAR N-1 lines lower
N+      - First CHAR N lines lower
N<CR>   - First CHAR N lines lower
N$      - End of line N-1 lines lower

Why the inconsistencies here, and the lack of coverage?

  • $ takes a number, while ^ doesn't.
  • _ without a number is seemingly the same as ^, making ^ redundant.
  • <CR> and + do the same thing.

Why isn't it something more along the lines of

N-      - First CHAR N lines higher
N^      - First CHAR N-1 lines lower
<CR>    - First CHAR N lines lower

N+      - End of line N lines higher
N$      - End of line N-1 lines lower
N_      - End of line N lines lower
  • vi backwards compatibility?
  • implementation details, something regarding count/motions, or how vim reads input?
  • antiquated keyboard layouts?
  • I overlooked some default mappings?
  • FWIW, these aren't the only movements that are redundant. For example, 0 moves to the beginning of the line, but | moves to the n'th character on the line, defaulting to 0 if not given a count. Also, gg is essentially 1G – DJMcMayhem Jun 8 '17 at 16:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.