iTerm2 Settings to Make Your Life Better
iTerm2 is my terminal app of choice and I’ve been using it for years. Up until now though I’ve only customized the fonts and colors and left the rest of its settings the defaults. After finally getting annoyed trying to move the cursor around in a long command I asked a friend how they do it and apparently in Mac’s default Terminal app it’s just option + left/right arrow, but that didn’t work for me in iTerm2.
If you are not familiar with what I’m talking about imagine you are running something like:
php artisan custom:commmand --file=really-long-string-or-path-to-uuid-file.txt --anotherflag
Then you realize you spelled command wrong and need to move the cursor from the end to somewhere in the middle. By default, option + left arrow doesn’t move by word, instead it inserts some sort of character.
As I went to figure out how to change this I found the keymap settings and inside the presets is an option for “natural text editing”. This changes iTerm2 to use the standard keys to move around the line just like any other app. For example, command + left/right to go the start or end of a line, option + left/right to move by word, and more.
While you are in the settings another good change is under the general tab to make new tabs open in the current sessions directory.
These two settings alone have made iTerm2 much better for me to use, and I’d recommend you give those a try. If you are an avid iTerm2 user let me know what other settings you customize to make the app better for you.