mirror of
https://github.com/Cian-H/dotfiles.git
synced 2026-02-20 15:18:05 +00:00
Added fish config
This commit is contained in:
29
dot_config/fish/conf.d/00_env.fish
Normal file
29
dot_config/fish/conf.d/00_env.fish
Normal file
@@ -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
|
||||
40
dot_config/fish/conf.d/aliases.fish
Normal file
40
dot_config/fish/conf.d/aliases.fish
Normal file
@@ -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
|
||||
3
dot_config/fish/conf.d/zoxide.fish
Normal file
3
dot_config/fish/conf.d/zoxide.fish
Normal file
@@ -0,0 +1,3 @@
|
||||
if type -q zoxide
|
||||
zoxide init fish | source
|
||||
end
|
||||
41
dot_config/fish/config.fish
Normal file
41
dot_config/fish/config.fish
Normal file
@@ -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
|
||||
25
dot_config/fish/functions/sysfetch.fish
Normal file
25
dot_config/fish/functions/sysfetch.fish
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user