10

I was just exploring the control key in vim (to make myself more familiar with vim overall) and I don't quite get what exactly happens when I press <ctrl-h>.

So when I used <ctrl-h> in my (modded) vim, it just goes one to the left, but, when I'm at the first column of a line, it will go to the previous line instead. Now this functionality would be immensely useful in scripting.

However when I use an unmodded vim (with vim -u NONE), it basically is , i.e. it doesn't do the line changing thing.

:help ctrl-h doesn't help me at all, as it talks about netrw, which is nice to know, but I'm interested in the normal mode shortcut.

So my questions are:

  1. What settings changed the <ctrl-h> key in my modded vim?
  2. Is there something that does the opposite of <ctrl-h>, i.e. it goes to the right and if it's in the last column, it skips to the next line (if there is one)
1
  • 1
    FWIW there are certain control characters that map exactly to other keys, and console vim can not tell the difference between them <C-m> == <CR>, and <C-h> == <BS> and <C-[> == <ESC> and <C-j> is a newline. This means you cannot map to one of these key combos without getting the other one also. Gvim is a little bit better about this, and nvim will hopefully fix it.
    – DJMcMayhem
    Commented Jul 6, 2016 at 17:23

1 Answer 1

14

It's usually interpreted as a back space.

:help ctrl-h doesn't help me at all, as it talks about netrw,

Try :h CTRL-h, yes case makes a difference for some reason.

Is there something that does the opposite of , i.e. it goes to the right and if it's in the last column, it skips to the next line (if there is one)

Yes, try <Space> for scripting, or Space in normal mode.

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.