diff --git a/dot_config/fish/conf.d/00_env.fish b/dot_config/fish/conf.d/00_env.fish new file mode 100644 index 0000000..0d85248 --- /dev/null +++ b/dot_config/fish/conf.d/00_env.fish @@ -0,0 +1,29 @@ +set -gx EDITOR nvim +set -gx GIT_EDITOR nvim +set -gx PIPENV_VERBOSITY -1 +set -gx MAKEFLAGS "-j"(math (nproc) + 1) +set -gx JULIA_NUM_THREADS (nproc) +set -gx YAOURT_COLORS "nb=1:pkg=1:ver=1;32:lver=1;45:installed=1;42:grp=1;34:od=1;41;5:votes=1;44:dsc=0:other=1;35" +set -gx XDG_CONFIG_HOME "$HOME/.config" +set -gx PASSWORD_STORE_DIR "$HOME/.cache/password-store" +set -gx GLAMOUR_STYLE "$XDG_CONFIG_HOME/glamour/tokyo_night.json" + +if test (uname) != "Windows_NT" + set -gx GPG_TTY (tty) +end + +set -gx LESS_TERMCAP_mb (printf "\e[01;31m") +set -gx LESS_TERMCAP_md (printf "\e[01;31m") +set -gx LESS_TERMCAP_me (printf "\e[0m") +set -gx LESS_TERMCAP_so (printf "\e[01;44;36m") +set -gx LESS_TERMCAP_se (printf "\e[0m") +set -gx LESS_TERMCAP_us (printf "\e[00;36m") +set -gx LESS_TERMCAP_ue (printf "\e[0m") + +fish_add_path ~/.local/bin +fish_add_path ~/.cargo/bin +fish_add_path ~/.poetry/bin +fish_add_path ~/.ghcup/bin +fish_add_path ~/.nix-profile/bin +fish_add_path /nix/var/nix/profiles/default/bin +fish_add_path /opt/miniconda3/bin diff --git a/dot_config/fish/conf.d/aliases.fish b/dot_config/fish/conf.d/aliases.fish new file mode 100644 index 0000000..844bf7e --- /dev/null +++ b/dot_config/fish/conf.d/aliases.fish @@ -0,0 +1,40 @@ +if status is-interactive + # Modern Unix Replacements + alias cat bat + alias du dust + alias df duf + alias grep rg + alias cp xcp + alias find fd + alias top btm + alias htop btm + alias burn rm + alias rm rip + # Convenience aliases + alias free "free -m" + alias npkg "nano -w PKGBUILD" + alias q exit + alias :q exit + alias c clear + alias h history + alias lsa "ls -a" + alias lsl "ls -l" + alias lsla "ls -la" + # Python / Poetry + alias pip-upgrade "python -m pip install --upgrade pip" + alias pypy pypy3 + alias poem "poetry run python" + alias bashpoem "poetry run bash" + alias nupoem "poetry run nu" + alias fishpoem "poetry run fish" + alias jupyterpoem "poetry run jupyter" + # Misc + alias vim nvim + alias vi nvim + alias nix-fish "nix-shell --command fish" + + abbr --add .. cd .. + abbr --add ... cd ../.. + abbr --add .... cd ../../.. + abbr --add ..... cd ../../../.. +end diff --git a/dot_config/fish/conf.d/zoxide.fish b/dot_config/fish/conf.d/zoxide.fish new file mode 100644 index 0000000..8258939 --- /dev/null +++ b/dot_config/fish/conf.d/zoxide.fish @@ -0,0 +1,3 @@ +if type -q zoxide + zoxide init fish | source +end diff --git a/dot_config/fish/config.fish b/dot_config/fish/config.fish new file mode 100644 index 0000000..f9f5f0d --- /dev/null +++ b/dot_config/fish/config.fish @@ -0,0 +1,41 @@ +set -U fish_greeting + +if status is-interactive + # --- Vi Mode Settings --- + fish_vi_key_bindings + set fish_cursor_default block blink + set fish_cursor_insert line blink + set fish_cursor_replace_one underscore blink + set fish_cursor_visual block + + # --- Plugin Initializations --- + if type -q starship + starship init fish | source + end + + if type -q atuin + atuin init fish | source + end + + if type -q direnv + direnv hook fish | source + end + + if type -q rbw + rbw gen-completions fish | source + end + + # --- Hooks --- + + # Auto-run onefetch when entering a git repo + # This function registers an event handler on the variable PWD + function __run_onefetch_on_dir_change --on-variable PWD + if test -d .git + onefetch --nerd-fonts + end + end + __run_onefetch_on_dir_change + + # Startup fetch + sysfetch +end diff --git a/dot_config/fish/functions/sysfetch.fish b/dot_config/fish/functions/sysfetch.fish new file mode 100644 index 0000000..c070328 --- /dev/null +++ b/dot_config/fish/functions/sysfetch.fish @@ -0,0 +1,25 @@ +function sysfetch + if type -q fastfetch + if begin + string match -q "*kitty*" "$TERM" + or string match -q "*ghostty*" "$TERM" + end + and test -f "$HOME/.config/fastfetch/kitty.jsonc" + + fastfetch --config "$HOME/.config/fastfetch/kitty.jsonc" + else + fastfetch + end + else if type -q neofetch + echo "Why are you still using neofetch? It's deprecated!" + neofetch + else if type -q screenfetch + screenfetch + else if type -q archey + archey + else if type -q lsb_release + lsb_release -a + else if type -q uname + uname + end +end