105 lines
3.4 KiB
Fish
105 lines
3.4 KiB
Fish
set -gx BAT_STYLE plain
|
|
set -gx BAT_THEME "Solarized (dark)"
|
|
set -gx BAT_THEME_DARK "Solarized (dark)"
|
|
set -gx BAT_THEME_LIGHT "Solarized (light)"
|
|
set -gx EDITOR hx
|
|
set -gx LANG en_US.UTF-8
|
|
set -gx LESS '-x4 -z-4 -j.25 -iFMRS'
|
|
set -gx PAGER less
|
|
|
|
if status --is-interactive
|
|
# Disable the default shell greeting
|
|
set fish_greeting
|
|
|
|
# Disable the abbreviated directory format
|
|
set fish_prompt_pwd_dir_length 0
|
|
|
|
# If installed, setup z function
|
|
command -q zoxide; and zoxide init fish | source
|
|
|
|
# If installed, setup asdf
|
|
command -q asdf; and source (brew --prefix asdf)/libexec/asdf.fish
|
|
|
|
# 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
|
|
|
|
# Bindings
|
|
set -l major_version (string sub --length 1 $version)
|
|
if test $major_version -ge 4
|
|
bind ctrl-q fkill
|
|
bind ctrl-p __fzf_files
|
|
bind ctrl-g __fzf_git_log
|
|
else
|
|
bind \cq fkill
|
|
bind \cp __fzf_files
|
|
bind \cg __fzf_git_log
|
|
end
|
|
|
|
# You can get the cancelled command with ctrl-z now
|
|
#bind ctrl-c __fish_cancel_commandline
|
|
|
|
# Shell history
|
|
if command -q atuin
|
|
atuin init fish --disable-up-arrow | source
|
|
else
|
|
if test $major_version -ge 4
|
|
bind ctrl-r __fzf_history
|
|
else
|
|
bind \cr __fzf_history
|
|
end
|
|
end
|
|
|
|
# By default, Ctrl+L clears the screen
|
|
# Add binding Ctrl+Alt+L to clear screen AND scrollback buffer
|
|
if test $major_version -ge 4
|
|
bind ctrl-alt-l 'clear; commandline -f repaint'
|
|
else
|
|
bind \e\f 'clear; commandline -f repaint'
|
|
end
|
|
end
|
|
|
|
if not set -q __universals_initialized
|
|
set -U __universals_initialized
|
|
|
|
# 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 cyan
|
|
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_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
|