tmux and zshell

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

wiki

  • 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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值