Is modal editing possible in command-line mode?
Some examples:
- After writing
!ls ~/foo/barI want todbto delete bar - I executed the above command and now I want to change
lstomvand jump back to $
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
By default you can press
Control + f(or otherwise seeset cedit) when on the Vim command-line, which opens the command-line window where you can edit the command using normal-mode Vim editing keys.Enterwill run the command orControl + cwill return you to the standard command-line.So in your specific example, you could press
Control + fon the Vim command-line thendband it would do what you want.When I have to do more sophisticated editing commands I use the above approach because I’m more familiar with Vim editing keys than I am with the alternatives. I also find the normal-mode vim keys more powerful.
See
:help c_ctrl-ffor more information.