fish cleanup
This commit is contained in:
parent
936a324282
commit
778e80e09f
@ -1,4 +1,4 @@
|
||||
set -gx PATH "/usr/local/opt/coreutils/libexec/gnubin" $PATH
|
||||
set -gx PATH /usr/local/opt/coreutils/libexec/gnubin $PATH
|
||||
set -gx PATH /usr/local/bin $PATH
|
||||
set fish_color_valid_path
|
||||
|
||||
@ -6,40 +6,12 @@ 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 &
|
||||
eval /usr/local/Caskroom/miniconda/base/bin/conda "shell.fish" hook $argv | source &
|
||||
end
|
||||
# <<< conda initialize <<<
|
||||
|
||||
@ -63,26 +35,3 @@ 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
|
||||
|
Loading…
Reference in New Issue
Block a user