# config welcome text set fish_greeting 'Talk is cheap. Show me the code.'
2.配置vi_mode
1 2 3 4 5 6 7 8 9 10
# key binding # vi mode fish_vi_key_bindings for mode in insert default visual # vi模式下ctrl-e到行尾 bind -M $mode \ce end-of-line # vi模式下ctrl-a到行首 bind -M $mode \ca beginning-of-line end # cancel key bindings: fish_default_key_bindings
3.配置fzf
已废弃,jethrokuan/fzf 插件已提供默认配置
4.配置autojump
1 2
# autojump [ -f /usr/local/share/autojump/autojump.fish ]; and source /usr/local/share/autojump/autojump.fish
5.配置nvm vim ~/.config/fish/config.fish
1 2 3 4
set -xg nvm_prefix "/usr/local/opt/nvm" set -xg NVM_DIR "$HOME/.nvm" set -xg NVM_PATH "/usr/local/opt/nvm" set -xg NVM_NODEJS_ORG_MIRROR "https://npm.taobao.org/dist"
6.配置rbenv rbenv默认需要添加到path中
1
set -U fish_user_paths $HOME/.rbenv/bin $fish_user_paths
# config welcome text set fish_greeting 'Talk is cheap. Show me the code.'
# nvm set -xg NVM_DIR "$HOME/.nvm" set -xg nvm_prefix /usr/local/opt/nvm set -xg NVM_NODEJS_ORG_MIRROR "https://npm.taobao.org/dist" set -xg NODE_PATH "$NVM_DIR/versions/node/v8.9.2/lib/node_modules" set -xg HOMEBREW_BOTTLE_DOMAIN https://mirrors.ustc.edu.cn/homebrew-bottles # rbenv set -xg RBENV_ROOT $HOME/.rbenv # fzf set -U FZF_LEGACY_KEYBINDINGS 0
# user path # add user path # set -U fish_user_paths [path] $fish_user_paths # set user path # set -U fish_user_paths /usr/local/opt/mysql@5.5/bin /usr/local/opt/coreutils/libexec/gnubin /usr/local/opt/fzf/bin $HOME/.rbenv/bin $HOME/.nvm/versions/node/v8.9.3/bin $HOME/.composer/vendor/bin /usr/local/bin
# alias alias g=git alias tnpm='npm --registry=https://registry.npm.taobao.org --disturl=https://npm.taobao.org/dist' alias fpview='fzf --preview "head -n 100 {}" | read -l result; and vim $result' alias fcd='find . -type d -maxdepth 1 | fzf --height 50% --reverse --border | read -l result; and cd $result' alias fvim='find . -type f -maxdepth 1 | fzf --reverse --preview "head -n 100 {}" | read -l result; and vim $result' alias fls='ls | fzf --height 50% --reverse --border' aliasrm=trash
# abbr # add abbr: abbr -a b brew # abbr b brew # abbr f fuck # abbr g git # abbr gst 'g st' # abbr gfa 'g fa' # abbr gss 'g st -s' # abbr gco 'g co' # abbr gbr 'g br' # abbr glg 'g lg' # abbr gla 'g lga'