10

Pressing Ctrl-w in Insert mode will delete the previous word. It is equivalent to Ctrl-Backspace in Windows, and Opt-Delete in OS X, and really speeds up typing.

Vim has the separate concepts of word and WORD (see :help word). This is invaluable for text navigation: it is the difference between w and W, b and B, and so on.

Ctrl-w operates on word. Is there a similar instruction for WORD?

7

I don't believe there is one built in, but you can map one yourself in your vimrc:

inoremap <c-b> <esc>vBda
  • I like this. It's an available, open mapping with a clear mnemonic. – davidlowryduda Feb 5 '15 at 2:06
  • 2
    I think <esc>BdiWi might be better. vBda doesn't seem to behave consistently (try inside, for example, db:seed). – muru Feb 5 '15 at 2:15
  • 2
    When doing one of normal mode commands from insert mode, consider using <C-o> instead – Dhruva Sagar Feb 5 '15 at 3:24

Your Answer

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

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