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

2 Answers 2


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)

  • 4
    Use Ctrl-W to delete a single word Jan 3, 2018 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, 2018 at 15:09
  • how do I delete a word/line to the right in insert mode? Oct 27, 2020 at 3:00

Ctrl-W will delete one word.

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.