As already mentioned, your specific key bindings already exist:
- Ctrl-b will lead you to the beginning of the command line and
- Ctrl-e will take you to the end of the command line.
For complete editing of command line commands, you can turn the vim command line into an editable command buffer to solve such problems, rather than using new key bindings.
At the command prompt, press Ctrl-f to enter the command line buffer. You will be in normal mode and will be able to navigate and edit your command line, as well as interact and edit previous commands in the command history.
In your example, once in the command line buffer, you can simply use 0itab
to change e
to tabe
.
Press Enter in this buffer to execute the command where your cursor is located, and Ctrl-c will exit the command line buffer, dropping you back to the command line.
source share