I just started using Vim as an IDE. I was using it as a test editor for a while now, so I didn't have to go to command mode very often. But, since I program in Java, I have to go to command mode to make the file, compile/run it... etc.
The problem is: I need a good way to switch between the two modes.
I looked online and it says that the <Esc>
key is supposed to do that, but that doesn't work for me (maybe it's not for gVim? I don't know why.)
I have to press CTRLO every time to go to command mode; the escape key works from that mode... it brings me back to insert mode. But is there a better, or easier, way of switching between command mode and insert mode?
To enter Insert mode, press i . In Insert mode, you can enter text, use the Enter key to go to a new line, use the arrow keys to navigate text, and use vi as a free-form text editor. To return to Command mode, press the Esc key once.
But is there a better, or easier, way of switching between command mode and insert mode? Esc is definitely the right key to finish an insert. An insert can be started in various ways.
First, press the Esc key a few times. This will ensure vi is out of Insert mode and in Command mode. Second, type :q! and press Enter. This tells vi to quit without saving any changes.
Pressing ESC quits from insert mode to normal mode, where you can press : to type in a command. Press i again to back to insert mode, and you are good to go.
I'm not a Vim guru, so someone else can be more experienced and give you other options.
Looks like your Vim is launched in easy mode. See :help easy
.
This happens when Vim is invoked with the -y
argument or as evim
, or maybe you have a :set insertmode
somewhere in your .vimrc
configuration. Find the source and disable it; temporarily this can be also done via Ctrl + O :set noim
Enter.
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