89 lines
2.0 KiB
Fish
89 lines
2.0 KiB
Fish
set -gx PATH "/usr/local/opt/coreutils/libexec/gnubin" $PATH
|
|
set -gx PATH /usr/local/bin $PATH
|
|
set fish_color_valid_path
|
|
|
|
|
|
# Commands to run in interactive sessions can go here
|
|
if status is-interactive
|
|
|
|
#source /usr/local/etc/grc.fish
|
|
|
|
fish_add_path "/Applications/ShellHistory.app/Contents/Helpers"
|
|
|
|
if [ ! -n "$__shhist_session" ]
|
|
if [ -n "$TERM_SESSION_ID" ]
|
|
set __shhist_session $TERM_SESSION_ID
|
|
else
|
|
set __shhist_session (random)-$fish_pid
|
|
end
|
|
end
|
|
|
|
functions --copy fish_prompt fish_prompt_original
|
|
function fish_prompt
|
|
set __shhist_status $status
|
|
|
|
if fish_is_root_user
|
|
set __shhist_user $SUDO_USER
|
|
else
|
|
set __shhist_user $LOGNAME
|
|
end
|
|
|
|
\history --show-time="%s " -1 | sudo --preserve-env --user $__shhist_user /Applications/ShellHistory.app/Contents/Helpers/shhist insert --session $__shhist_session --username $LOGNAME --hostname (hostname) --exit-code $__shhist_status --shell fish
|
|
|
|
fish_prompt_original;
|
|
end
|
|
|
|
|
|
|
|
atuin init fish --disable-up-arrow| source
|
|
# >>> conda initialize >>>
|
|
# !! Contents within this block are managed by 'conda init' !!
|
|
if test -f /usr/local/Caskroom/miniconda/base/bin/conda
|
|
eval /usr/local/Caskroom/miniconda/base/bin/conda "shell.fish" "hook" $argv | source &
|
|
end
|
|
# <<< conda initialize <<<
|
|
|
|
source ~/.config/fish/shell.fish
|
|
|
|
end
|
|
|
|
|
|
alias b "bat -p --pager=never"
|
|
|
|
abbr lsn littlesnitch
|
|
|
|
function ss
|
|
python ~/.config/scripts/ss.py $argv
|
|
end
|
|
|
|
function s
|
|
kitty +kitten ssh $argv
|
|
end
|
|
|
|
function icat
|
|
kitty +kitten icat --align=left $argv
|
|
end
|
|
|
|
function sg
|
|
set -l query ""
|
|
set -l option ""
|
|
|
|
for arg in $argv
|
|
if test "$arg" = '-s'; or test "$arg" = '--code'
|
|
set option $arg
|
|
else
|
|
if test -n "$query"
|
|
set query "$query $arg"
|
|
else
|
|
set query $arg
|
|
end
|
|
end
|
|
end
|
|
|
|
if test -n "$option"
|
|
command sgpt $option -- "$query"
|
|
else
|
|
command sgpt -- "$query"
|
|
end
|
|
end
|