When i open a file in vim I usually press, by reflex, the colon to see a list of previous commands, but its empty. How can I get my previous command history.
Press Ctrl+F in command mode to open the command history window. Then, you can use / , ? , and other search commands. Press Enter to execute a command from the history.
Hit the colon ( : ) and then use the up arrow to start going back through previous commands. You can use the up/down arrows too to move around the list.
Vim makes it easy to navigate previous locations: Ctrl + o navigate to the previous location in the jump list (think o as old) Ctrl + i navigate to the next location in the jump list ( i and o are usually next to each other) g; go to the previous change location.
Press <shift-N> to go back to the previous occurrence of your find term.
:history
should do what you want.
q:
would be better. it will display a list of commands, and you can press j
ork
for motion,thenenter
to run a selected one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With