config/fish/config.fish

101 lines
3.2 KiB
Fish

# Environment variables
set -gx BAT_STYLE plain
set -gx EDITOR nvim
set -gx LANG en_US.UTF-8
set -gx PAGER 'less --tabs=4 --jump-target=.25 -iRFM'
set -gx SBT_OPTS '-Dsbt.supershell=false'
if test -x /usr/libexec/java_home
set -gx JAVA_HOME (/usr/libexec/java_home -v 1.8)
end
if command -q diff-so-fancy
set -gx GIT_PAGER "diff-so-fancy | $PAGER"
end
if command -q interactive-rebase-tool
set -gx GIT_SEQUENCE_EDITOR 'interactive-rebase-tool'
end
if status --is-interactive
# Disable the default shell greeting
set fish_greeting
# Disable the abbreviated directory format
set fish_prompt_pwd_dir_length 0
# Git prompt
set -g __fish_git_prompt_showdirtystate 1
set -g __fish_git_prompt_showstashstate 1
set -g __fish_git_prompt_showuntrackedfiles 1
set -g __fish_git_prompt_showupstream informative
set -g __fish_git_prompt_char_upstream_ahead '↑'
set -g __fish_git_prompt_char_upstream_behind '↓'
set -g __fish_git_prompt_char_upstream_prefix ' '
set -g __fish_git_prompt_color_branch magenta
set -g __fish_git_prompt_color_dirtystate cyan
set -g __fish_git_prompt_color_invalidstate red
set -g __fish_git_prompt_color_stagedstate cyan
set -g __fish_git_prompt_color_stashstate cyan
set -g __fish_git_prompt_color_untrackedfiles cyan
set -g __fish_git_prompt_color_upstream yellow
end
if not set -q __universals_initialized
set -U __universals_initialized
# Abbreviations
abbr -a -U d 'docker'
abbr -a -U e $EDITOR
abbr -a -U l 'less'
abbr -a -U m 'micro'
# Git abbreviations
abbr -a -U g 'git'
abbr -a -U ga 'git add'
abbr -a -U gb 'git branchsort'
abbr -a -U gbd 'git branch -D'
abbr -a -U gc 'git commit'
abbr -a -U gco 'git checkout'
abbr -a -U gcp 'git cherry-pick'
abbr -a -U gd 'git diff'
abbr -a -U gdc 'git diff --cached'
abbr -a -U gdh 'git diff --cached HEAD~'
abbr -a -U gf 'git fetch --prune'
abbr -a -U gl 'git logsearch -10'
abbr -a -U glo 'git log --oneline -10'
abbr -a -U gr 'git restore'
abbr -a -U gs 'git status'
abbr -a -U gst 'git stash'
abbr -a -U gsw 'git switch'
# Colors
set -U fish_color_autosuggestion a5a5a9
set -U fish_color_cancel -r
set -U fish_color_command green
set -U fish_color_comment a5a5a9
set -U fish_color_cwd green
set -U fish_color_cwd_root red
set -U fish_color_end brblack
set -U fish_color_error red
set -U fish_color_escape yellow
set -U fish_color_history_current --bold
set -U fish_color_host normal
set -U fish_color_host_remote yellow
set -U fish_color_match --background=brblue
set -U fish_color_normal normal
set -U fish_color_operator blue
set -U fish_color_param white
set -U fish_color_quote yellow
set -U fish_color_redirection cyan
set -U fish_color_search_match bryellow --background=515151
set -U fish_color_selection white --bold --background=515151
set -U fish_color_status red
set -U fish_color_user brgreen
set -U fish_color_valid_path --underline
set -U fish_pager_color_completion normal
set -U fish_pager_color_description yellow --dim
set -U fish_pager_color_prefix white --bold
set -U fish_pager_color_progress black --background=cyan
end