Let's say I'm in my root directory, and I have a User
folder that I can cd
into. In my default Mac terminal, I can just type cd U
+ tab
, and it autocompletes to cd Users/
. How do I get this to work in iTerm2?
It used to work just fine in iTerm2, but I must have changed a setting somewhere that disabled it, and I cannot figure out how to get it back.
Commands in command history are also added to Autocomplete (Cmd-;). If Preferences>General>Save copy/paste history and command history to disk is enabled, then command history will be preserved across runs of iTerm2 (up to 200 commands per user/hostname). A command history tool may be added to the toolbelt by selecting Toolbelt>Command History.
iTerm2 allows you to remap modifiers. You have separate control over left and right command and option keys. One common need is to exchange cmd and option. To do this, go to Preferences > Keys. Set Left option key to Left command key and Left command key to Left option key (and do the same for Right command and Right option if you please).
How To Enable Shell Integration. The easiest way to install shell integration is to select the iTerm2>Install Shell Integration menu item. It will download and run a shell script as described below. You should do this on every host you ssh to as well as your local machine.
A new menu bar item will be added called Downloads that lets you view downloaded files and track their progress. If you drop a file (e.g., from Finder) into iTerm2 while holding the option key, iTerm2 will offer to upload the file via scp to the remote host into the directory you were in on the line you dropped the file on.
Autocomplete in iTerm2 activates by pressing cmd
+ ;
You can install bash-completion
package to autocomplete by Tab key.
bash-completion
with brew
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