Command Line IDE

From Colettapedia
Jump to navigation Jump to search

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 session
  • tmux ls = list sessions
  • tmux kill-session -t <session name> = kill-session

Commands inside session

  • C-b ? = help
  • C-b % = vsplit new pane
  • C-b " = horiz split new pane
  • C-b { = cycle panes right
  • C-b } = cycle panes left
  • C-b [up|down|left|right] =
  • C-b c = new window inside session
  • C-b [0|1|2|...] = go to window index inside session
  • C-b :swapp -s 1.0 = swap prompt in window 1 pane 0 with current
  • C-b ! = break pane out of window into a new session
  • C-b w = list of open windows
  • C-b d = detatch client
  • C-b C-z = suspend client (put into UNIX background)
  • C-b & = Kill window
  • C-b x = Kill pane
  • C-b Fn+Up = Scroll up
  • C-b Fn+Down = Scroll down
  • C-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

  1. ⌘-f to open find
  2. ⌘-g to cycle backward through matches
  3. Shift- ⌘-g to cycle forward through matches
  4. <tab> advance selection FORWARD one word
  5. 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"