zshell
- ^a: go to beginning of the command line
- ^e: go to end of the command line
- ^_: undo
- ^u: clear command line
- a-l: ls
like bash shells
- ^k: clear till the end
- a-b: move back a word
- a-f: move forward a word
- ^w: remove previous word
- a-d: remove current word
- a-u: make current word uppercase
- a-c: capitalize current word
- a-t: swap the current and previous word
- ^t: swap the current and previous letter
- ^p: previous command
- a-.:last word from previous command
- !!: previous command
oh-my-zsh
use oh-my-zsh (github) to make zshell better to use. (git-prompt and man not used)
plugins=(git tmux scd repo man zsh-autosuggestions zsh-syntax-highlighting)
zsh-autosuggestions & zsh-syntax-highlighting: plugins to put under custom/plugins folder, or use system default.
alias ll='ls -alFh'
alias la='ls -A'
alias l='ls -CF'
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
modified ZSH_THEME=“gallois”
RPS1='$(ruby_prompt_info) $EPS1'
verbose logging
set -xv
to accelerate git info in prompts:
# ----- Skip Status checks -----
# For all repos
git config --global --add oh-my-zsh.hide-status 1
# For current repo
git config --add oh-my-zsh.hide-status 1
# ----- Skip dirty checks -----
# For all repos
git config --global --add oh-my-zsh.hide-dirty 1
# For current repo
git config --add oh-my-zsh.hide-dirty 1
commands:
- d: list recent directories in numbers. Just enter a number and [Enter] to switch.
- md: mkdir
- rd: rmdir
- <a number of dots>: cd to number of parent dir
git for oh-my-zsh
- g
- ga: add
- gb: branch
- gba: branch -a
- gbl: blame (-L for line number)
- gsps: show
- gc: commit
- gc!: commit --amend
- gca: commit -a (to add all modified and deleted files)
- gcmsg: commit -m (with a message)
- gcam: commit -a -m
- gco: checkout
- gcm: checkout master
- gcb: checkout -b (with a branch name)
- gcp: cherry-pick
- gcpa: cherry-pick --abort
- gcpc: cherry-pick --continue
- gclean: clean -df
- gd: diff
- gdca: diff --cached
- gf: fetch
- ghh: help
- gl: pull
- glg: log
- glgp: log -p
- gp: push
- grb: rebase
- grh: reset HEAD
- grhh: reset HEAD --hard
- gst: status
- gsta: stash save
- gstl: stash list
- gstp: stash pop
- current_branch
- current_repository
repo for oh-my-zsh
- r: repo
scd for oh-my-zsh
- scd: list recent directories to cd to
tmux for oh-my-zsh
- ts create a new session
- tl list sessions
- ta attach a session
tmux
the Tao of tmux
~/.tmux.conf
# C-b is not acceptable -- Vim uses it
set-option -g prefix C-a
bind C-a send-prefix
#bind-key C-a last-window
# hjkl pane traversal
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
set -g mode-keys vi
bind -t vi-copy 'v' begin-selection
bind -t vi-copy 'y' copy-selection
use ^a as prefix to all commands.
- ?: help
- d: detach
- t: clock
- z: zoom
- %: split window horizontally
- ": split window
- h/j/k/l: switch to a pane
- x: kill current pane
- []: clipboard. v to select and y to yank
- =: choose a buffer to paste
- #: list buffers
- $: rename current session
- !: move out current pane
- q: show pane indexes
- ;: last pane
- ^z: suspend
- n: new window
- w: choose a window to switch to
- 0-9: goto window
- n: goto next window
- p: goto previous window
- :: run a tmux command