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?

1 Answer 1

7

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

inoremap <c-b> <esc>vBda
3
  • I like this. It's an available, open mapping with a clear mnemonic. Feb 5, 2015 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, 2015 at 2:15
  • 2
    When doing one of normal mode commands from insert mode, consider using <C-o> instead Feb 5, 2015 at 3:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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