dotfiles/.config/fish/config.fish
2024-07-11 09:38:53 +07:00

83 lines
2.9 KiB
Fish

if status is-interactive
# Commands to run in interactive sessions can go here
end
set -gx XDG_CONFIG_HOME /home/joe/.config
set -gx XDG_DATA_HOME /home/joe/.local/share
set -gx XDG_CACHE_HOME /home/joe/.cache
# set -gx VISUAL emacsclient -n
# set -gx EDITOR emacsclient -n
set -gx VISUAL nvim
set -gx EDITOR nvim
set -gx DOTNET_CLI_TELEMETRY_OPTOUT 1
bind \cx 'if test -z (commandline) ; fg %1 &>/dev/null; else ; clear; commandline "╰─>$ "; end'
bind \e/ accept-autosuggestion
abbr -a -g gs "git status --untracked-files"
abbr -a -g gl "git lop -10"
abbr -a -g gll "git lol -15"
abbr -a -g gchm "git checkout master"
abbr -a -g gchb "git checkout -b"
abbr -a -g gch "git checkout"
abbr -a -g gc "git commit"
abbr -a -g gcm "git commit -m"
abbr -a -g gcau "git commit --author"
abbr -a -g gcam "git commit -am"
abbr -a -g gcamm "git commit --amend"
abbr -a -g gaa "git add -A && git status --untracked-files"
abbr -a -g gpl "git pull"
abbr -a -g gp "git push"
abbr -a -g gpd "git push -d origin"
abbr -a -g gpr "git remote prune origin"
abbr -a -g gm "git merge"
abbr -a -g gmm "git merge master"
abbr -a -g gf "git fetch"
abbr -a -g grh "git reset --hard"
abbr -a -g gcl "git clean -fd"
abbr -a -g gd "git diff"
abbr -a -g gb "git branch"
abbr -a -g gba "git branch -a"
# abbr -a -g gpu "git push -u origin"
# abbr -a -g glp "git lfs pull"
# abbr -a -g glm "gss git merge ; glp"
# abbr -a -g gdh "git diff HEAD"
# abbr -a -g gms "git merge --squash"
# abbr -a -g gr "git rebase"
# abbr -a -g gst "git stash"
# abbr -a -g gsl "git stash list"
# abbr -a -g gsp "git stash pop"
# abbr -a -g gsu "git submodule update"
# abbr -a -g glom "git lop -10 origin/master"
# abbr -a -g gmom "git merge origin/master"
# abbr -a -g gss "env GIT_LFS_SKIP_SMUDGE=1"
# export NNN_FIFO="/tmp/nnn.fifo" # temporary buffer for the previews
# export NNN_PLUG='p:preview-tui'
# complete -f -c dotnet -a "(dotnet complete)"
function vterm_printf;
printf "\e]%s\e\\" "$argv"
end
function vterm_prompt_end;
vterm_printf '51;A'(whoami)'@'(hostname)':'(pwd)
end
functions --copy fish_prompt vterm_old_fish_prompt
function fish_prompt --description 'Write out the prompt; do not replace this. Instead, put this at end of your file.'
# Remove the trailing newline from the original prompt. This is done
# using the string builtin from fish, but to make sure any escape codes
# are correctly interpreted, use %b for printf.
printf "%b" (string join " \n" (vterm_old_fish_prompt))
vterm_prompt_end
end
fish_ssh_agent
# The next line updates PATH for the Google Cloud SDK.
if [ -f '/home/joe/Downloads/google-cloud-sdk/path.fish.inc' ]; . '/home/joe/Downloads/google-cloud-sdk/path.fish.inc'; end
# opam configuration
source /home/joe/.opam/opam-init/init.fish > /dev/null 2> /dev/null; or true