fish: fix paths, making scope explicit

This commit is contained in:
Charles Gould 2020-03-27 20:12:31 -05:00
parent fdaf147217
commit fa08b8e9b8

View File

@ -5,29 +5,34 @@ set fish_greeting
set fish_prompt_pwd_dir_length 0 set fish_prompt_pwd_dir_length 0
# Environment variables # Environment variables
set -x EDITOR nvim set -gx EDITOR nvim
set -x LANG en_US.UTF-8 set -gx LANG en_US.UTF-8
set -x SBT_OPTS '-Dsbt.supershell=false' set -gx SBT_OPTS '-Dsbt.supershell=false'
set -x ENHANCD_DISABLE_DOT 1 set -gx ENHANCD_DISABLE_DOT 1
if command -q moar if command -q moar
set -x PAGER moar set -gx PAGER moar
else if command -q most else if command -q most
set -x PAGER most set -gx PAGER most
end end
if test -x /usr/libexec/java_home if test -x /usr/libexec/java_home
set -x JAVA_HOME (/usr/libexec/java_home -v 1.8) set -gx JAVA_HOME (/usr/libexec/java_home -v 1.8)
end
# Path
if not set -q fish_user_paths
set -U fish_user_paths ~/bin ~/go/bin
end end
# FZF (https://github.com/junegunn/fzf) # FZF (https://github.com/junegunn/fzf)
set -x FZF_DEFAULT_OPTS "--no-height --layout=reverse --multi" set -gx FZF_DEFAULT_OPTS "--no-height --layout=reverse --multi"
set -x FZF_DEFAULT_COMMAND "fd --type=file" set -gx FZF_DEFAULT_COMMAND "fd --type=file"
set -x FZF_CTRL_T_COMMAND "fd --type=file --follow" set -gx FZF_CTRL_T_COMMAND "fd --type=file --follow"
set -x FZF_CTRL_T_OPTS "--ansi --preview 'bat --color=always {}'" set -gx FZF_CTRL_T_OPTS "--ansi --preview 'bat --color=always {}'"
set -x FZF_CTRL_R_OPTS "--preview 'echo {}' --preview-window down:3:hidden:wrap --bind '?:toggle-preview'" set -gx FZF_CTRL_R_OPTS "--preview 'echo {}' --preview-window down:3:hidden:wrap --bind '?:toggle-preview'"
set -x FZF_ALT_C_COMMAND "fd --type=directory --follow" set -gx FZF_ALT_C_COMMAND "fd --type=directory --follow"
set -x FZF_ALT_C_OPTS "--preview 'tree -C {} | head -200'" set -gx FZF_ALT_C_OPTS "--preview 'tree -C {} | head -200'"
# Git prompt # Git prompt
set -g __fish_git_prompt_showdirtystate 1 set -g __fish_git_prompt_showdirtystate 1
@ -45,27 +50,12 @@ set -g __fish_git_prompt_color_stashstate cyan
set -g __fish_git_prompt_color_untrackedfiles cyan set -g __fish_git_prompt_color_untrackedfiles cyan
set -g __fish_git_prompt_color_upstream yellow set -g __fish_git_prompt_color_upstream yellow
# Path
set --erase PATH
test -d $HOME/bin ; and set -x PATH $HOME/bin
test -d /usr/local/bin ; and set -x PATH $PATH /usr/local/bin
test -d /usr/bin ; and set -x PATH $PATH /usr/bin
test -d /bin ; and set -x PATH $PATH /bin
test -d /usr/local/sbin ; and set -x PATH $PATH /usr/local/sbin
test -d /usr/sbin ; and set -x PATH $PATH /usr/sbin
test -d /sbin ; and set -x PATH $PATH /sbin
# Aliases # Aliases
alias vi='nvim' alias vi='nvim'
alias vim='nvim' alias vim='nvim'
function ..; cd ..; end
# Fish private configs function ...; cd ../..; end
set -g fish_private_path ~/.config/fish/private function ....; cd ../../..; end
test -d $fish_private_path/functions ; and set fish_function_path $fish_function_path[1] $fish_private_path/functions $fish_function_path[2..-1]
test -d $fish_private_path/completions ; and set fish_complete_path $fish_complete_path[1] $fish_private_path/completions $fish_complete_path[2..-1]
for file in $fish_private_path/conf.d/*.fish
builtin source $file 2> /dev/null
end
# Fish package manager # Fish package manager
set -g fisher_path ~/.config/fish/fisher set -g fisher_path ~/.config/fish/fisher
@ -89,6 +79,14 @@ if functions -q base16-bright
end end
end end
# Fish local configs
set -g _fish_local_path ~/.local/fish
test -d $_fish_local_path/functions ; and set fish_function_path $fish_function_path[1] $_fish_local_path/functions $fish_function_path[2..-1]
test -d $_fish_local_path/completions ; and set fish_complete_path $fish_complete_path[1] $_fish_local_path/completions $fish_complete_path[2..-1]
for file in $_fish_local_path/conf.d/*.fish
builtin source $file 2> /dev/null
end
# Homebrew package manager # Homebrew package manager
if test -x /home/linuxbrew/.linuxbrew/bin/brew if test -x /home/linuxbrew/.linuxbrew/bin/brew
eval (/home/linuxbrew/.linuxbrew/bin/brew shellenv) eval (/home/linuxbrew/.linuxbrew/bin/brew shellenv)