diff --git a/roles/fish/files/config.fish b/roles/fish/files/config.fish index 8371328..b81262c 100755 --- a/roles/fish/files/config.fish +++ b/roles/fish/files/config.fish @@ -6,14 +6,14 @@ set -x MANROFFOPT "-c" set -x MANPAGER "sh -c 'col -bx | bat -l man -p'" ## Environment setup +# Env vars +export EDITOR=nvim +export VISUAL=nvim + if test -f ~/.fish_profile source ~/.fish_profile end -# Other env vars -export EDITOR=nvim -export VISUAL=nvim - # Add ~/.local/bin to PATH if test -d ~/.local/bin if not contains -- ~/.local/bin $PATH @@ -21,7 +21,7 @@ if test -d ~/.local/bin end end -# Plugin configuration +## Plugin configuration # Set settings for https://github.com/franciscolourenco/done set -U __done_min_cmd_duration 10000 set -U __done_notification_urgency_level low @@ -31,6 +31,11 @@ if type -q starship && status --is-interactive starship init fish | source end +# Zoxide +if type -q zoxide && status --is-interactive + zoxide init fish | source +end + ## Functions # Fish command history function history @@ -113,7 +118,7 @@ function ya set tmp (mktemp -t "yazi-cwd.XXXXX") yazi $argv --cwd-file="$tmp" if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ] - cd -- "$cwd" + cd "$cwd" end rm -f -- "$tmp" end @@ -138,6 +143,11 @@ if type -q paru alias yay='paru' end +# Replace cd with zoxide +if type -q zoxide + alias cd='z' +end + # Common use alias :q=exit alias ipn='ip' @@ -175,11 +185,9 @@ alias mirrord="sudo reflector --latest 50 --number 20 --sort delay --save /etc/p alias mirrors="sudo reflector --latest 50 --number 20 --sort score --save /etc/pacman.d/mirrorlist" alias mirrora="sudo reflector --latest 50 --number 20 --sort age --save /etc/pacman.d/mirrorlist" -## Run fastfetch if session is interactive +## Run fastfetch if status --is-interactive if type -q fastfetch fastfetch -l arch - else if type -q neofetch - neofetch --ascii_distro arch end end diff --git a/roles/fish/tasks/main.yml b/roles/fish/tasks/main.yml index e0acdd5..42241f7 100644 --- a/roles/fish/tasks/main.yml +++ b/roles/fish/tasks/main.yml @@ -5,6 +5,7 @@ - fish - fish-done - fastfetch + - zoxide state: present - name: "[Fish] Create config folder"