Hot answers tagged

660

Killing a fly with a cannon: Go to Preferences... > Profiles > Keys (not Preferences... > Keys) Press Presets... Select Natural Text Editing Then, you can move a word backwards using Option ⌥ + ← and a word forwards using Option ⌥ + →, move to the start of the line using fn + ← and to the end of the line with fn + →. Also you can delete a word backwards ...


435

Go to iTerm Preferences → Profiles, select your profile, then the Keys tab. Click Load Preset... and choose Natural Text Editing.


175

Go to iTerm Preferences → Profiles, select your profile, then the Keys tab. Find ⌥← and ⌥→ and set them to send escape sequence b and send escape sequence f respectively. If you use ⌘→ and ←⌘ you will need to remap the next and previous tab shortcuts which are set to those as default. Terminal uses ⇧⌘→ and ⇧⌘← for these. You can do this under Profiles, or ...


159

I like the following setup. Preferences > Keys (or Preferences > Profiles > Keys) Click the plus. move forward one word option+right send escape sequence f move back one word option+left send escape sequence b delete to beginning of word (credit) option+delete send hex code 0x1B 0x08 delete to end of word fn+option+delete send escape sequence d (I ...


114

Select "Reuse previous session's directory" from the preferences of your profile: Alternatively click on "Advanced Configuration" then "Edit..." so you can set the working directory separately for new windows, new tabs & new split panes


78

The easiest way to have iTerm2 open with a specific size, position and number of windows is: Get it all set up the way you'd like to see it when it opens. Have all your iTerm2 windows sized and place where you like them. From the top menu select Window -> Save Window Arrangement and give it a name Go to the Preferences and under the Arrangements section ...


66

Ctrl-[ b jumps back a word. You can also use Esc instead or Ctrl-[, and f to go forward. That is Ctrl+[ release and then b orf. Or Esc and b or f. More information can be found at this other discussion on AskDifferent.


58

This looks like a change in tmux in 2.0 -> 2.1 I've replaced setw -g mode-mouse on set -g mouse-select-pane on set -g mouse-resize-pane on set -g mouse-select-window off with just set-option -g mouse on and everything seems ok


53

Preferences are cached in 10.9. See http://hints.macworld.com/article.php?story=20130908042828630. If you edit a plist file directly or replace the plist of an application, the application will keep using the cached version even after you quit and reopen the application. You can run defaults read com.googlecode.iterm2 or killall cfprefsd to apply the ...


48

In iTerm go to Preferences -> General and under Startup set Use System Window Restoration Setting. Go to macOS System Preferences -> General and make sure that Close windows when quitting an app is unchecked.


48

⌘+⌥+←/↑/→/↓ will let you navigate split panes in the direction of the arrow, i.e. when using ⌘+D to split panes vertically, ⌘+⌥+← and ⌘+⌥+→ will let you switch between the panes. Note: ⌥ is the [alt] key


41

This is a year old, but I'd like to add a response that isn't so heavy-handed. The accepted answer will open the previous directory every time you open a new tab, which I personally find frustrating. I feel it's easier to always open in the home directory and then open the current directory in a new tab as needed. To do that, simply run the following ...


41

To Get Forward (Alt-f), Backward (Alt-b) and Delete (Alt-d) Word Open iTerm. Go to iTerm > Preferences... > Profiles > Keys Under Profile Shortcut Keys, click the + sign. Type your key shortcut (option-b, option-f, option-d, option-left, etc.) For Action, choose Send Escape Sequence. Write b, d or f in the input field. This works at least for bash....


40

~/Library/Preferences/com.googlecode.iterm2.plist Also note that you can set a custom location in iTerm Preferences under the General tab.


40

You have to set the scroll back buffer. This option is found under Profiles >> Terminal. You can either set the number of lines in the buffer to the number of lines you want to scroll back, or check the box for "unlimited scrollback".


39

​​​​​​


39

Open iTerm2 preferences by using the keyboard shortcut, Command + , or by invoking the command iTerm2 → Preferences... in the Menu bar. In the Preferences window, switch to Profiles tab and under Working Directory select Advanced Configuration. (The default selection is Home directory.) Now, click on the Edit... button, and in the pane that opens, under ...


38

If your default system shell is bash, your Terminal should start with it. You can check it on General tab under Terminal Preferences. Should look like the following: If bash isn't your default shell, you can change it by typing: chsh -s /bin/bash To configure iTerm2 with zsh you have to open Preferences and change the command on General tab on your ...


37

You'll want to override iTerm's default shortcuts with your own shortcuts to "Ignore". Go to Preferences > Key and press the + button at the bottom of the Global Shortcut Keys: Then add an entry for Cmd+K and choose "Ignore" for the action: This disables Cmd+K.


31

You have to do two things: set the LSCOLORS environment variable create an alias for ls so that it shows colors by default In your ~/.bash_profile add the following: export LSCOLORS="EHfxcxdxBxegecabagacad" alias ls='ls -lGH' <-----This shows in list format, follow symlinks colorized The the colors are set by each bit above; the first being ...


29

Try iTermocil iTermocil allows you to setup pre-configured layouts of windows and panes in iTerm2, having each open in a specified directory and execute specified commands.


28

I found the answer in iTerm FAQs :: Where does iTerm2 store its settings?: defaults delete com.googlecode.iterm2


26

With the \033]0;TEXT\007 escape sequence. Example of use in Bash: echo -ne "\033]0;$PWD\007" Which you could add to your $PROMPT_COMMAND if you use Bash, or otherwise attach to you PS1 so it gets re-evaluated often. Example: export PROMPT_COMMAND='echo -ne "\033]0;$PWD\007"'


26

If you use bash, you can also add "\e\e[D": backward-word "\e\e[C": forward-word to ~/.inputrc.


26

You have to update your TERMINFO file. Thanks to wincent's video and his github pages Watch the video and look at his github pages, they're excellent. I have the following note stored on my HD: We can have italics in the terminal. This works in iTerm as well as Terminal. We have to adapt the terminfo database to tell it to display italics. Create a ...


26

The easiest is simply to open the Terminal and then press the TAB key twice. You'll be asked if you want to see all possibilities - reply "y" and you'll get the full list.


24

This was probably how I got stuck there in the first place. You can toggle full screen mode with the ⌘ Command⏎ Enter keyboard shortcut.


22

To use the normal mouse behavior in tmux you have to keep alt pressed. So click on the link while pressing cmd+alt. The same applies when selecting text.


21

There's a pretty exhaustive description of editing the bash prompt here there might be some linux specific stuff, but most of it is generic bash stuff. But just for getting started, I recommend this bash profile generator It is pretty simple, so I've since learned more and my prompt looks like: using: [[ -s "/Users/dwightk/.rvm/scripts/rvm" ]] && ...


21

See the answers from this U&L Q&A titled: List all commands that a shell knows . My personal favorite is to utilize compgen since this is part of the family of tools used to build all the tab completion when you're in a terminal and hit tab> + tab twice. $ compgen -c Example $ compgen -c | tail deepcopy-gen kube-controller-manager informer-gen ...


Only top voted, non community-wiki answers of a minimum length are eligible