dotfiles/.config/fish/config.fish

96 lines
2.6 KiB
Fish

# /\ ,,
# || ' ||
# =||= \\ _-_, ||/\\
# || || ||_. || ||
# || || ~ || || ||
# \\, \\ ,-_- \\ |/
# _/
if type -q wal
source ~/.cache/wal/colors.fish
end
set -Ux AWT_TOOLKIT MToolkit
set -Ux JDK_JAVA_OPTIONS "-Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Dswing.crossplatformlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Djdk.gtk.version=3 -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true"
# set -Ux DESKTOP_SESSION bspwm
# Borg pleeease
set -Ux BORG_RELOCATED_REPO_ACCESS_IS_OK yes
# Editor
set -Ux EDITOR helix
set -Ux SYSTEMD_EDITOR helix
# Zoxide
set -Ux _ZO_FZF_OPTS "--no-sort --height=30% --exit-0 --select-1 --bind=ctrl-z:ignore"
# Fix locale errors in Nix
set -Ux LOCALE_ARCHIVE /usr/lib/locale/locale-archive
# PATH
set -gx fish_user_paths $fish_user_paths /home/agatha/.local/bin /home/agatha/.cargo/bin /home/agatha/.cabal/bin /home/agatha/.espressif/tools/xtensa-esp32-elf-clang/esp-13.0.0-20211203-x86_64-unknown-linux-gnu/bin/
if type -q ruby
fish_add_path -a (ruby -e 'print Gem.user_dir')/bin
end
# Aliases
alias cat bat
alias code codium
alias df duf
alias ip 'ip -color=always'
alias xclip 'xclip -selection clipboard'
alias youtube-dl-audio 'youtube-dl --ignore-errors --output "%(title)s.%(ext)s" --extract-audio --audio-format best'
# Only alias hx to helix if it's not already done (helix nixpkg does this, arch package does not)
if not type -q hx
alias hx helix
end
if status is-interactive
# Commands to run in interactive sessions can go here
# Only alias in interactive sessions to not break scripts
if type -q exa
alias ls 'exa -lFhT --group-directories-first --level 1'
end
if type -q starship
starship init fish | source
end
if type -q zoxide
zoxide init --cmd v fish | source
end
end
# https://github.com/fish-shell/fish-shell/issues/1891#issuecomment-451961517
function expand-dot-to-parent-directory-path -d 'expand ... to ../.. etc'
# Get commandline up to cursor
set -l cmd (commandline --cut-at-cursor)
# Match last line
switch $cmd[-1]
case '*..'
commandline --insert '/.'
case '*'
commandline --insert '.'
end
end
bind . 'expand-dot-to-parent-directory-path'
function impostor
echo $argv[1] | string sub -s 13 | fold -w1 | shuf | tr -d '\n' | sed 's/^/cccccbeujtje/'
end
if test -d ~/.gnupg
set -e SSH_AGENT_PID
set -x SSH_AUTH_SOCK (gpgconf --list-dirs agent-ssh-socket)
# so gpg-agent knows in what tty to prompt for key passwords
set -x GPG_TTY (tty)
gpg-connect-agent updatestartuptty /bye > /dev/null
end