57 lines
1.2 KiB
Fish
57 lines
1.2 KiB
Fish
## PATH
|
|
|
|
set -x PATH $PATH ~/.local/bin ~/.go/bin
|
|
set -x EDITOR vim
|
|
set -x VIRTUAL_ENV_DISABLE_PROMPT true
|
|
|
|
## SSH init
|
|
set -x SSH_AUTH_SOCK $XDG_RUNTIME_DIR/ssh-agent.socket
|
|
for f in (ls $HOME/.ssh/*.pub);
|
|
set -l priv (string replace '.pub' '' $f);
|
|
if not contains $priv (ssh-add -l | awk '{ print $3 }')
|
|
ssh-add $priv
|
|
end
|
|
end
|
|
|
|
## Go utils
|
|
set -x GOPATH ~/.go
|
|
|
|
## aliases
|
|
alias jsonpp "python -mjson.tool"
|
|
|
|
function bind_bang
|
|
switch (commandline -t)[-1]
|
|
case "!"
|
|
commandline -t $history[1]; commandline -f repaint
|
|
case "*"
|
|
commandline -i !
|
|
end
|
|
end
|
|
|
|
function fish_user_key_bindings
|
|
bind ! bind_bang
|
|
end
|
|
|
|
function __autovenv --on-variable PWD
|
|
set -l base $PWD
|
|
set -l has_venv false
|
|
|
|
while test $base != '/'
|
|
if test -f $base/.venv/bin/activate.fish
|
|
set has_venv $base/.venv
|
|
break
|
|
end
|
|
set base (dirname $base)
|
|
end
|
|
|
|
if test -n "$VIRTUAL_ENV" -a $has_venv = 'false'
|
|
deactivate
|
|
else if test $has_venv != 'false'
|
|
if test -z "$VIRTUAL_ENV" -o "$VIRTUAL_ENV" != "$has_env"
|
|
source "$has_venv/bin/activate.fish"
|
|
end
|
|
end
|
|
end
|
|
|
|
set fish_command_timer_time_format ''
|
|
source ~/.config/fish/command_timer.sh
|