iTerm2
Today, I would like to share with you on how I set up iTerm.
Table of content
Let’s get started 🔮.
1. Download iTerm2
2. Setting
Setting Step 1. Make sure do tick Reuse previous session’s directory.
When I open new tap, I want to be in the previous session’s directory, not Home directory. That means I will be on the same location.
Setting Step 2. Install Oh My Zsh
1) Copy a command-line
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
2) Paste to iTerm
***
If you got this message like above, you need to install X Code.
Go to App store and download X-code.
3. Install theme plugin; Dracula
1) Install using Git
If you are a git user, you can install the theme and keep up to date by cloning the repo:
git clone https://github.com/dracula/iterm.git
2) Download iterm-master
Download using the GitHub .zip download option and unzip them.
3) Activating theme
1)iTerm2 > Preferences > Profiles > Colors Tab
2) Open the Color Presets… drop-down in the bottom right corner
3) Select Import… from the list
4) Select the Dracula.itermcolors
file
5) Select the Dracula from Color Presets…
4. Shortcut
Tab navigation
- open new tab
Cmd + t
- next tab
Cmd + Shift + ]
- previous tab
Cmd + Shift + [
Pane navigation
- split pane left-right
Cmd + d
- split pane top-bottom
Cmd + Shift + d
- next pane
Cmd + ]
- previous pane
Cmd + [
Search
- open search bar
Cmd + f
- find next
Cmd + g
Input to all panes
- input to all panes in current tab
Cmd + Alt + i
Clear screen
- clear buffer
Cmd + k
- clear lines (Bash command)
Ctrl + l
Zooming / Font Resize
- toggle maximize window
Cmd + Alt + =
- toggle full screen
Cmd + Enter
- make font larger
Cmd + +
- make font smaller
Cmd + -
Running iTerm toStop
Cmd + z
If you use Mac OSX and do a lot of work in terminal the iTerm application will become your friend fast. It’s a great terminal application and it would be hard to imagine my days without it.
Once you learn a few shortcut keys and develop your personal work flow you would hardly want to leave that black (differs) window.
Below is some of the shortcut keys I use.
Working with multiple terminals
It’s rare occasion having only one terminal open as often I’m working with multiple projects / tools at the same time. Sometimes even if I’m not using something at the moment (or in the last few days / weeks) the terminal windows are left as is (often to avoid going to the needed directory). And sometimes you just need to try something fast and close it. Following shortcuts allow me to open new terminals, move between them, close once I’m done with it.
New Tab
⌘T
Previous Tab
⌘←
Next Tab
⌘→
Close tab
⌘w
You could move the tabs around using the following shortcut keys, but I rarely use them.
Move Tab Right
⇧⌘→
Move Tab Left
⇧⌘←
Working with multiple terminals in same tab
Opening a new tab takes care of the most use cases, but sometimes there’s a need to see multiple terminals at the same time. The splitting the tab shortcut keys are the lifesaver in those moments. You can go crazy with splitting the current tab (if you need to)!
Split Vertically with Current Profile
⌘D
Split Horizontally with Current Profile
⇧⌘D
Your performance would suffer a lot if you had to use the mouse to use any of those terminals. For that problem the shortcut keys to move between the panes solve it.
Next Pane
⌘]
Previous Pane
⌘[
You can also move between panes directionally. Most of the time I can’t remember the shortcut keys for it, previous/next pane works great, rarely have more than 2 panes at the time.
Select Pane Above
⌥⌘↑
Select Pane Below
⌥⌘↓
Select Pane Left
⌥⌘←
Select Pane Right
⌥⌘→
Interacting with the terminal
The following shortcut keys are not used that often (sometimes due to failing personal memory). They do come in handy from time to time when you need to do something with the output which is in terminal.
Clear Window
⌃L
Clear Buffer
⌘K
Scroll Up
⇧Page Up
Scroll Down
⇧Page Down
Find…
⌘F
Changing font size
The iTerm on my machine is configured to my liking and works for almost all the use cases. For that reason it’s rare to change the font size. If you’re making a presentation, recording screen cast or your eyes are tired shortcut keys for changing font size solves that problem.
Make Text Bigger
⌘+
Make Text Normal Size
⌘0
Make Text Smaller
⌘-
Custom shortcuts keys
You can change global shortcut keys from profile preferences Keys
tab. One shortcut key I find useful is deleting the last word. It uses the ⌘←Delete
as keyboard shortcut and sends the 0x1B 0x08
hex code (action).
Go Left One Word
⌥←
(send escape sequenceb
)Go Right One Word
⌥→
(send escape sequencef
)
5. Extra Tips
Blue colours are folders. Others are just files.
How to set up terminal window.
I usually make three horizontal taps in the one project.
The first tap is for git comments such as pull, push and commits.
The second tap is for changing HTML code.
The last tap is for running npm.
That’s wrap 😃
updated Aug 2019
cd
: Change directory.
~
: Starting the site, very root directory.
cd ~/Sites/
mkdir
: make a directory
touch
: make a file
code .
: open Visual Studio Code
🎉🎉🎉 Happy codesign today 🎉🎉🎉
Lastly, I would like to share <FrontEnd30 /> where I learnt many cool front-end techniques.