Command Line IDE
Jump to navigation
Jump to search
My
Contents
Functionality Matrix
- Iterm2-tmux integration: "The tmux prefix key is not needed, as native menu commands operate on tmux windows"
functionality | screen | tmux | Iterm2 w/ tmux integration |
---|---|---|---|
new session | screen -S <name> | tmux new -s <name> | tmux -CC new -s <name> |
new vertical split pane | N/A | C-b % | ⌘-D |
new horizontal split pane | N/A | C-b " | Shift-⌘-D |
new tab in same window | N/A | N/A | Ctrl-⌘-Shift-T |
new window in same session | N/A | C-b c | Ctrl-⌘-Shift-N |
detach from session | C-a d | C-b d | Ctrl-⌘-Shift-D |
kill window | C-a KK | C-b & | C-d/⌘-w |
switch between panes in a window | N/A | C-b left/right | ⌘-Option left/right |
rotate between tabbed windows in a session | N/A | C-b n | ⌘-Left/Right or C-Tab |
goto specific tab in session | N/A | C-b <window number> | ⌘-<window number> |
scroll up to see past output | N/A | C-b Page Up (Fn-Up) | Just scroll up |
tmux
My .tmux.conf
set-option -g allow-rename off setw -g mode-keys vi set -g default-terminal "screen-256color" set -g prefix C-j unbind C-b bind C-j send-prefix set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-sensible' set -g @plugin 'tmux-plugins/tmux-resurrect' run '~/.tmux/plugins/tpm/tpm'
Terminology
- "window" = app
- "pane" = window
- "session" = group of windows and panes
Commands
tmux
=tmux new -s <session name>
=tmux a
= reattach to current sessiontmux ls
= list sessionstmux kill-session -t <session name>
= kill-session
Commands inside session
C-b ?
= helpC-b %
= vsplit new paneC-b "
= horiz split new paneC-b {
= cycle panes rightC-b }
= cycle panes leftC-b [up|down|left|right]
=C-b c
= new window inside sessionC-b [0|1|2|...]
= go to window index inside sessionC-b :swapp -s 1.0
= swap prompt in window 1 pane 0 with currentC-b !
= break pane out of window into a new sessionC-b w
= list of open windowsC-b d
= detatch clientC-b C-z
= suspend client (put into UNIX background)C-b &
= Kill windowC-b x
= Kill paneC-b Fn+Up
= Scroll upC-b Fn+Down
= Scroll downC-b .
= Move window, i.e., change window index to occupy a currently unoccupied index (due to window-closing, etc)C-b :rename-window new_name
Iterm2
- tmux/Iterm2 integration
- Command-Shift-B - toggle toolbelt
- Autocomplete previously completed command: start typing and then ⌘-; for options
- Full screen mode: ⌘-Enter
- imgcat
My config options
- Preferences->Pointer->Pointer Follows Mouse
- Preferences->Profiles->Terminal->Unlimited Scrollback
Mouseless copy
- ⌘-f to open find
- ⌘-g to cycle backward through matches
- Shift- ⌘-g to cycle forward through matches
- <tab> advance selection FORWARD one word
- Shift-<tab> advance selection BACKWARD one word
Screen
- screen - create a new screen
- C-a becomes a special character only recognized by screen, use C-a a
- C-a d = detach window
- once detached, screen -r to reattach to your one screen window
- screen -list to show a list of all the windows
- screen -S convenient_session_name = start a screen window named bleh
- screen -r convenient_session_name = reattach to a screen window named bleh
- screen -D -R bleh = I don't care what you're doing, reconnect to a lost screen session window
- C-a ? to show key bindings.
- C-a K to kill window.
- student-teacher screen "multi-user mode"