Add screen term type and pyenv
This commit is contained in:
24
config/fish/completions/pyenv.fish
Normal file
24
config/fish/completions/pyenv.fish
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
function __fish_pyenv_needs_command
|
||||||
|
set cmd (commandline -opc)
|
||||||
|
if test (count $cmd) -eq 1 -a "$cmd[1]" = "pyenv"
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
|
||||||
|
function __fish_pyenv_using_command
|
||||||
|
set cmd (commandline -opc)
|
||||||
|
if test (count $cmd) -gt 1
|
||||||
|
if test "$argv[1]" = "$cmd[2]"
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
|
||||||
|
if command -s pyenv > /dev/null
|
||||||
|
complete -f -c pyenv -n '__fish_pyenv_needs_command' -a '(pyenv commands)'
|
||||||
|
for cmd in (pyenv commands)
|
||||||
|
complete -f -c pyenv -n "__fish_pyenv_using_command $cmd" -a "(pyenv completions $cmd)"
|
||||||
|
end
|
||||||
|
end
|
||||||
19
config/fish/conf.d/pyenv.fish
Normal file
19
config/fish/conf.d/pyenv.fish
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
if not command -s pyenv > /dev/null
|
||||||
|
echo "Install <github.com/yyuu/pyenv> to use 'pyenv'."
|
||||||
|
exit 1
|
||||||
|
end
|
||||||
|
|
||||||
|
set -l pyenv_root ""
|
||||||
|
|
||||||
|
if test -z "$PYENV_ROOT"
|
||||||
|
set pyenv_root ~/.pyenv
|
||||||
|
set -x PYENV_ROOT "$pyenv_root"
|
||||||
|
else
|
||||||
|
set pyenv_root "$PYENV_ROOT"
|
||||||
|
end
|
||||||
|
|
||||||
|
if status --is-login
|
||||||
|
set -x PATH "$pyenv_root/shims" $PATH
|
||||||
|
set -x PYENV_SHELL fish
|
||||||
|
end
|
||||||
|
command mkdir -p "$pyenv_root/"{shims,versions}
|
||||||
@ -5,6 +5,7 @@ SET FZF_LEGACY_KEYBINDINGS:1
|
|||||||
SET FZF_PREVIEW_DIR_CMD:ls
|
SET FZF_PREVIEW_DIR_CMD:ls
|
||||||
SET FZF_PREVIEW_FILE_CMD:head\x20\x2dn\x2010
|
SET FZF_PREVIEW_FILE_CMD:head\x20\x2dn\x2010
|
||||||
SET FZF_TMUX_HEIGHT:40\x25
|
SET FZF_TMUX_HEIGHT:40\x25
|
||||||
|
SET_EXPORT TERM:screen\x2d256color
|
||||||
SET ZO_CMD:zo
|
SET ZO_CMD:zo
|
||||||
SET Z_CMD:z
|
SET Z_CMD:z
|
||||||
SET Z_DATA:/Users/colinpowell/\x2elocal/share/z/data
|
SET Z_DATA:/Users/colinpowell/\x2elocal/share/z/data
|
||||||
|
|||||||
@ -4,3 +4,4 @@ simnalamburt/shellder
|
|||||||
fishgretel/fasd
|
fishgretel/fasd
|
||||||
oh-my-fish/theme-bobthefish
|
oh-my-fish/theme-bobthefish
|
||||||
pyenv
|
pyenv
|
||||||
|
daenney/pyenv
|
||||||
|
|||||||
12
config/fish/functions/pyenv.fish
Normal file
12
config/fish/functions/pyenv.fish
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
function pyenv
|
||||||
|
set command $argv[1]
|
||||||
|
set -e argv[1]
|
||||||
|
|
||||||
|
switch "$command"
|
||||||
|
case rehash shell
|
||||||
|
source (pyenv "sh-$command" $argv | psub)
|
||||||
|
|
||||||
|
case \*
|
||||||
|
command pyenv "$command" $argv
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user