Skip to content

Instantly share code, notes, and snippets.

@mimosa
Last active April 2, 2018 23:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mimosa/476bb887ba9270ab16426eee49dd5cb0 to your computer and use it in GitHub Desktop.
Save mimosa/476bb887ba9270ab16426eee49dd5cb0 to your computer and use it in GitHub Desktop.
fish is a smart and user-friendly command line shell.
# homebrew
set -e fish_user_paths
set -U fish_user_paths /usr/local/bin $fish_user_paths
set bins libressl icu4c llvm sphinx-doc ncurses go/libexec
for bin in $bins
set -U fish_user_paths /usr/local/opt/$bin/bin $fish_user_paths
end
set -e bins
set -U fish_user_paths /usr/local/sbin $fish_user_paths
set -U fish_user_paths /usr/local/opt/icu4c/sbin $fish_user_paths
# anyenv
set -U fish_user_paths $HOME/.anyenv/bin $fish_user_paths
set anyenvs_root $HOME/.anyenv/envs
command anyenv init - >/dev/null ^&1 # eval "$(anyenv init -)";
# goenv, ndenv, pyenv, rbenv, jenv
for env in (ls $anyenvs_root)
set env_path (echo $env | awk '{print toupper($0)"""_ROOT"}')
set env_path $anyenvs_root/$env
set -U fish_user_paths $env_path/bin $fish_user_paths
set -U fish_user_paths $env_path/shims $fish_user_paths
eval $env rehash >/dev/null ^&1
set -e env_path
end
set -e anyenvs_root
#
set -U OPENSSL_ROOT /usr/local/opt/libressl
set -U LDFLAGS -L$OPENSSL_ROOT/lib
set -U CPPFLAGS -I$OPENSSL_ROOT/include
set -U PKG_CONFIG_PATH $OPENSSL_ROOT/lib/pkgconfig
alias tree="find . -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'"
# plugins
# brew install peco
# fisher omf/peco
set fish_plugins git peco
# theme
# fisher omf/theme-batman
set fish_theme batman
# rmstash
# brew install rmtrash
alias rm='rmtrash'
# cd > ls
function cd
builtin cd $argv
ls -la
end
# peco
function peco
command peco --layout=bottom-up $argv
end
function fish_user_key_bindings
bind \cr 'peco_select_history (commandline -b)' # Bind for peco select history to Ctrl+R
end
# encoding
set -U LANG zh_CN.UTF-8
set -U GOPATH $HOME/Documents/golang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment