This repository has been archived on 2024-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/apps/shell/fish/config.fish

64 lines
1.8 KiB
Fish
Raw Normal View History

2020-01-17 03:02:53 -06:00
#!/usr/bin/env fish
2020-01-22 17:25:47 -06:00
set -Ux XDG_CONFIG_HOME $HOME/.config
set -Ux DOTFILES_PATH $XDG_CONFIG_HOME/dotfiles
set -Ux ENV_PATH $HOME/.env
2020-01-17 03:02:53 -06:00
2020-01-16 17:01:59 -06:00
source $DOTFILES_PATH/apps/shell/fish/paths.fish
status --is-interactive || exit
2020-01-20 14:01:06 -06:00
for f in key-bindings colors prompt aliases
source $DOTFILES_PATH/apps/shell/fish/$f.fish
end
2020-01-16 17:01:59 -06:00
2020-01-22 17:25:47 -06:00
set -Ux _JAVA_AWT_WM_NONREPARENTING 1
set -Ux TERMINAL kitty
set -Ux BROWSER firefox-developer-edition
set -Ux ERL_AFLAGS "-kernel shell_history enabled -kernel shell_history_file_bytes 1024000" # iex history
2020-07-02 11:17:42 -05:00
set -Ux LESS "-r"
2020-01-16 17:01:59 -06:00
2020-01-22 17:25:47 -06:00
# more sane ls colors
set -Ux LS_COLORS 'ow=01;36;40'
2020-01-23 12:38:19 -06:00
has_command fd && set -Ux FZF_DEFAULT_COMMAND 'fd --type f --hidden --follow --exclude .git'
2020-01-20 10:49:06 -06:00
2020-01-23 12:38:19 -06:00
test -f ~/.fzf/shell/key-bindings.fish && source ~/.fzf/shell/key-bindings.fish
2020-01-16 17:01:59 -06:00
2020-01-23 12:38:19 -06:00
function fish_greeting
fortune
end
2020-01-16 17:01:59 -06:00
# we assume the user uses "$HOME" to just store their mess of dotfiles and other
# nonsense that clutters it up and that they have a preferred starting
# directory where they keep the stuff they actually care about
# we only do this if the user is opening a shell at $HOME
2020-01-20 09:12:52 -06:00
if test $PWD = $HOME; or test $PWD = $NICE_HOME;
cd $NICE_HOME || cd
end
2020-01-16 17:01:59 -06:00
if test -f $HOME/.asdf/asdf.fish
source $HOME/.asdf/asdf.fish
else if test -f /opt/asdf-vm/asdf.fish
source /opt/asdf-vm/asdf.fish
2020-01-16 17:01:59 -06:00
end
2020-01-23 12:38:19 -06:00
# load a per-device config last so anything can be overridden
for cf in config.fish .hidden/config.fish
set f $ENV_PATH/$cf
test -f $f && source $f
end
mkdir -p $NOTES_PATH $USER_LOGS_PATH $SCROTS_PATH
2020-05-18 15:34:35 -05:00
# start a tmux session by default if possible and we're not already in
# a terminal multiplexer
if has_command tmux && string match -v -q '*tmux*' $TERM && string match -v -q '*screen*' $TERM
2020-10-16 15:00:11 -05:00
tmux start-server
2020-05-18 15:34:35 -05:00
tmux attach -t default || tmux new -s default
end
2020-10-27 17:10:54 -05:00
if set -q $__HM_SESS_VARS_SOURCED
exec bash -c "source $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh; exec fish"
end