I'm a relatively recent Mac convert and I still stumble a bit with some command line tricks. In particular, when I need to use VI to edit things I always have to look up the commands to edit and save my text.
So here is my cheat sheet, in a public place that is easy to find :-)
- Type vi FILENAME to use the vim editor to alter this file.
- Navigate to the line that needs to be changed or added and make your changes.
- Apparently the exact keys that control navigation vary. On my computer, the following worked:
- Down - the enter key
- Right/Left - left/right cursors
- Delete a letter - the 'x' key
- Insert letters - the 'i' key
- When finished editing, do the following: ESC :wq!
That's my short and sweet blog for the day.