0

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

4

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)

  • 1
    Use Ctrl-W to delete a single word – Christian Brabandt 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 – Peter Rincker Jan 3 '18 at 15:09
3

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.