config/fish/config.fish

47 lines
1.5 KiB
Fish

# Disable the default shell greeting
set fish_greeting
# Disable the abbreviated directory format
set fish_prompt_pwd_dir_length 0
# Set global variables
set -x EDITOR nvim
set -x LANG en_US.UTF-8
set -x MANPAGER 'nvim +Man!'
set -x FZF_DEFAULT_COMMAND 'fd --type f --hidden --follow --exclude .git'
set -x FZF_DEFAULT_OPTS '--height 40%'
set -x JAVA_HOME (/usr/libexec/java_home -v 1.8)
# 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
alias adventure='emacs -batch -l dunnet'
alias afk='pmset displaysleepnow'
alias md5sum="md5 -r $argv"
alias sha256sum="shasum -a 256 $argv"
alias vi='nvim'
# Install package manager if needed
if not functions -q fisher
curl https://git.io/fisher --create-dirs -sLo ~/.config/fish/functions/fisher.fish
fish -c fisher
end
# Set package installation folder
set -g fisher_path ~/.config/fish/fisher
# Add packages to fish config
set fish_function_path $fish_function_path[1] $fisher_path/functions $fish_function_path[2..-1]
set fish_complete_path $fish_complete_path[1] $fisher_path/completions $fish_complete_path[2..-1]
for file in $fisher_path/conf.d/*.fish
builtin source $file 2> /dev/null
end