How to switch to vi editing mode on a Mac terminal

I'm new to mac trying to edit .gitignore file from macbook terminal, I print

vi .gitignore 

It opens the file, but does not allow you to switch to edit mode. How does vi switch mode on mac?

+7
vim macos
source share
2 answers

On Mac, you can type vim (Vi Improved) more correctly :)

As elsewhere, i switches to "INSERT" mode, and ESC switches to command mode.

A good learning resource for Vim is included on the Mac. Just enter vimtutor and it will teach you quickly how to use vim efficiently.

Another editing option for mac is nano , a command line text editor that is much easier for those familiar with TextEdit / Notepad.

+20
source share

Same as everywhere. i to insert. Esc to return to command mode :wq to save and exit.

By the way, if you are uncomfortable with vi , try Sublime Text 2 , I like it :) It is based on the GUI, though.

+4
source share

All Articles