# iTerm2
## Config
### [Increase size of scrollback buffer](https://stackoverflow.com/a/28608448)
`Preferences > Profiles > Terminal > Scrollback Buffer`
- Can set `Scrollback Lines` to a high value like 100,000 or justs check `Unlimited Scrollback`
### Make backspace work inside [[Vim Plugins]]
Make readline ([[Emacs]]) backspace ( `<C-h>`) work in [[CtrlP]] file search dialog (and [[Vim]]) dialogs more generally
Preferences > Keys > Key Bindings >
![[Screen Shot 2021-09-14 at 11.03.54 PM.png]]
which will show up as
![[Screen Shot 2021-09-14 at 11.02.43 PM.png]]
### Remove Conflicting [[iTerm2]] Profile Mappings
Note: Removed mappings must be removed from ALL profiles
- Remove `Option + Up/Down` mappings, otherwise this will conflict with the "Go to start / end of paragraph" mappings
- Remove `Option + Left/Right` mappings, otherwise this will conflict with the "Move forward / back a word" mappings
- Remove `Shift + Up/Down` otherwise this will conflict with "Visual select down / up"
- Remove `Shift + Left/Right` otherwise this will conflict with "Visual select forward / back a letter"
`Preferences > Profiles > Keys`
![[Screen Shot 2021-09-15 at 12.36.29 AM.png]]
### Set key bindings according to the [[Emacs]] section of the init.vim
### Import `maxfangx.itermkeymap` from [[dotfiles]]
## Resources
### Fix terms page
- http://www.leonerd.org.uk/hacks/fixterms/
### Docs: Send Text with "vim" Special Characters
https://iterm2.com/documentation-preferences-profiles-keys.html
- Example usage: https://iterm2-discuss.narkive.com/2T4MenGn/send-text-with-vim-special-chars-sends-literal-chars
### Going forward/back one word
https://apple.stackexchange.com/a/293988
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 using Option ⌥ + ⌫, delete the whole line using Command ⌘ + ⌫.
If the preset doesn't appear, reinstall iTerm2. If you installed it using Homebrew+Cask:
```bash
brew cask reinstall iterm2
```