Fish: Move from alias to abbr

This commit is contained in:
ViViDboarder 2020-10-02 12:40:17 -07:00
parent df0f50849f
commit cb2c0ea26d
3 changed files with 34 additions and 31 deletions

View File

@ -1,11 +0,0 @@
function source_synced
# Sources a config file and corresponding local config file if it exists
set -l shared_config "$fish_synced_dir/$argv[1].fish"
set -l local_config "$fish_synced_dir/$argv[1].local.fish"
if test -f "$shared_config"
source "$shared_config"
end
if test -f "$local_config"
source "$local_config"
end
end

View File

@ -1,6 +1,20 @@
set -gx fish_function_path "$fish_synced_dir/functions" $fish_function_path set -gx fish_function_path "$fish_synced_dir/functions" $fish_function_path
set -gx fish_complete_path "$fish_synced_dir/completions" $fish_complete_path set -gx fish_complete_path "$fish_synced_dir/completions" $fish_complete_path
source_synced 'init/alias' function source_synced --description "Sources file from synced dir as well as optional local file"
# Sources a config file and corresponding local config file if it exists
set -l shared_config "$fish_synced_dir/$argv[1].fish"
set -l local_config "$fish_synced_dir/$argv[1].local.fish"
if test -f "$shared_config"
source "$shared_config"
end
if test -f "$local_config"
source "$local_config"
end
end
if status --is-interactive
source_synced 'init/alias'
end
source_synced 'init/paths' source_synced 'init/paths'
source_synced 'init/env' source_synced 'init/env'

View File

@ -1,37 +1,37 @@
# vim # vim
alias nv='nvim' abbr --global --add nv nvim
alias tv='tmux-vim' abbr --global --add tv tmux-vim
alias :q='exit' abbr --global --add :q exit
# git # git
alias ga='git add' abbr --global --add ga git add
alias gc='git commit' abbr --global --add gc git commit
alias gco='git checkout' abbr --global --add gco git checkout
alias gd='git diff' abbr --global --add gd git diff
alias gl='git log' abbr --global --add gl git log
alias gr='git rebase' abbr --global --add gr git rebase
alias gs='git status' abbr --global --add gs git status
alias tiga='tig --all' abbr --global --add tiga tig --all
# cd # cd
alias cd..='cd ..' abbr --global --add cd.. cd ..
# vim # vim
alias mviml='env VIM_COLOR=github mvim' abbr --global --add mviml env VIM_COLOR=github mvim
# terminal-notifier # terminal-notifier
alias notify-done='terminal-notifier -message "Done"' abbr --global --add notify-done terminal-notifier -message "Done"
alias notify-success='terminal-notifier -message "Success"' abbr --global --add notify-success terminal-notifier -message "Success"
alias notify-fail='terminal-notifier -message "Failure"' abbr --global --add notify-fail terminal-notifier -message "Failure"
function sh-notify function sh-notify
[ $status = 0 ] ;and notify-success ;or notify-fail [ $status = 0 ] ;and notify-success ;or notify-fail
end end
# gopush # gopush
alias pb-done='pb "Done"' abbr --global --add pb-done pb "Done"
alias pb-success='pb "Success"' abbr --global --add pb-success pb "Success"
alias pb-failure='pb "Failure"' abbr --global --add pb-failure pb "Failure"
function pb-notify function pb-notify
[ $status = 0 ] ;and pb-success ;or pb-failure [ $status = 0 ] ;and pb-success ;or pb-failure
end end