Following my pressing ':' I can switch to command insert mode and pressing 'Up Arrow' I can bring up my previous command.

How can I delete a word left of my cursor during command insert mode? Say for my example I have this in my command pane:

:!sh listtablefromdb.sh mytablename

I would like to delete mytablename via single keyboard shortcut


If you press Ctrl-U all characters to the left of the cursor until the beginning of the commandline will be deleted. This is also explained in the help at :h c_CTRL-U

To delete a single word, you can use Ctrl-W(:h c_CTRL-W)

  • 2
    Use Ctrl-W to delete a single word Jan 3 '18 at 10:20
  • 2
    Use q: or <c-f> to open the command-line window to unleash even more power! See :h cmdwin Jan 3 '18 at 15:09
  • how do I delete a word/line to the right in insert mode? Oct 27 '20 at 3:00

Ctrl-W will delete one word.

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.