Skip to content

Instantly share code, notes, and snippets.

@karolyi
Last active October 29, 2022 13:10
Show Gist options
  • Save karolyi/e785225f1c3149c62ec2 to your computer and use it in GitHub Desktop.
Save karolyi/e785225f1c3149c62ec2 to your computer and use it in GitHub Desktop.
My fish-shell settings
# Path to Oh My Fish install.
set -q XDG_DATA_HOME
and set -gx OMF_PATH "$XDG_DATA_HOME/omf"
or set -gx OMF_PATH "$HOME/.local/share/omf"
# Customize Oh My Fish configuration path.
#set -gx OMF_CONFIG /Users/laszlokarolyi/.config/omf
# Reload user_abbreviations by executing:
. ~/.config/fish/abbreviations/fish_user_abbreviations.fish
fish_user_abbreviations
echo "🍺 Fortune of the shell:"
fortune -a
echo ☕
~/keyboardspeed.sh
# Load oh-my-fish configuration.
source $OMF_PATH/init.fish
echo 🛠
set --export VIRTUAL_ENV_DISABLE_PROMPT 1
set --export LESSOPEN "| /usr/local/bin/source-highlight-esc.sh %s"
set --export LESS ' -R '
set --export EDITOR vim
# running stuff with npx replaced this
# set --export PATH ./node_modules/.bin ~/node_modules/.bin $PATH
set --export PYTHONSTARTUP ~/.pythonrc
source ~/.config/fish/nvm-wrapper/nvm.fish
# If you wanna use node
# nvm use system v5
# WAT gpg, if there's no X support
#set -x GPG_TTY (tty)
# name: Zish
function _is_git_dirty
echo (command git status -s --ignore-submodules=dirty ^/dev/null)
end
function fish_prompt
set_color -o red
printf '┌─<'
set_color -o blue
printf '%s ' (whoami)
set_color $fish_color_autosuggestion[1]
printf 'in '
set_color -o green
# printf '%s' (prompt_pwd)
printf '%s' (pwd)
set_color -o red
printf '>'
echo
set_color -o red
printf '└─<'
if set -q VIRTUAL_ENV
set_color FFE853
printf ' (%s)' (basename $VIRTUAL_ENV)
end
set_color yellow
printf '%s' (__fish_git_prompt)
if [ (_is_git_dirty) ]
set_color blue
printf '* '
end
set_color -o red
printf '>─'
set_color yellow
printf '➤ '
set_color normal
end
function fish_user_abbreviations
set -U fish_user_abbreviations
if type -fq git
abbr -a g='git'
abbr -a gs='git status -b'
abbr -a gh='git head'
abbr -a gl='git pull -v'
abbr -a gp='git push -v'
abbr -a gwc='git whatchanged'
abbr -a gll='git log --graph --pretty=oneline --abbrev-commit'
abbr -a gg='git log --graph --abbrev-commit --date=relative'
abbr -a ggs='git log --graph --abbrev-commit --date=relative --stat'
abbr -a gw='git whatchanged'
abbr -a gd='git diff'
abbr -a gdt='git difftool'
abbr -a gdc='git diff --cached'
abbr -a gdw='git diff --color-words'
abbr -a gds='git diff --stat'
abbr -a ga='git add'
abbr -a gc='git commit -v'
abbr -a gca='git commit -v -a'
abbr -a gb='git branch'
abbr -a gco='git checkout'
abbr -a gf='git fetch'
abbr -a gfa='git fetch --all'
abbr -a gm='git merge'
abbr -a gr='git rebase'
abbr -a gcp='git cherry-pick'
abbr -a gpr='git-pull-request'
abbr -a glo='git log --show-signature'
end
abbr -a grep='grep --color=auto'
abbr -a ipy='ipython'
abbr -a mvim='mvim --remote-tab'
abbr -a tree='find . -print | sed -e '\''s;[^/]*/;|____;g;s;____|; |;g'\'''
abbr -a bup='brew update; and brew upgrade --all; and brew cleanup; and brew prune'
abbr -a shttp='python3 -m http.server'
end
# This turns off the running of fortune and other initialization commands for fish when using less
function less
set _OLD_SHELL (echo $SHELL)
set SHELL ''
/usr/bin/env less $argv
set SHELL "$_OLD_SHELL"
set -u _OLD_SHELL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment