Crazy push with lots of changes.
This commit is contained in:
parent
13be74b0c0
commit
076a0fb958
|
|
@ -1,4 +1,6 @@
|
||||||
python.setInterpreter
|
python.setInterpreter
|
||||||
|
python.setLinter
|
||||||
|
python.execInTerminal
|
||||||
snippets.editSnippets
|
snippets.editSnippets
|
||||||
fzf-preview.Jumps
|
fzf-preview.Jumps
|
||||||
explorer
|
explorer
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
"coc-marketplace": ">=1.7.0",
|
"coc-marketplace": ">=1.7.0",
|
||||||
"coc-pairs": ">=1.2.21",
|
"coc-pairs": ">=1.2.21",
|
||||||
"coc-prettier": ">=1.1.17",
|
"coc-prettier": ">=1.1.17",
|
||||||
"coc-python": ">=1.2.12",
|
"coc-python": ">=1.2.13",
|
||||||
"coc-sh": ">=0.6.0",
|
"coc-sh": ">=0.6.0",
|
||||||
"coc-snippets": ">=2.2.1",
|
"coc-snippets": ">=2.2.1",
|
||||||
"coc-svg": ">=0.0.13",
|
"coc-svg": ">=0.0.13",
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
"L2hvbWUvc2hhd24vV29ya3NwYWNlL0xURvCfmoAvVGhlRm94aG91bmRQcm9qZWN0L2ZveGhvdW5kL3NpZ2ludA==": [
|
||||||
|
"exit",
|
||||||
|
"python.setInterp",
|
||||||
|
"python.setin"
|
||||||
|
],
|
||||||
|
"L2hvbWUvc2hhd24vV29ya3NwYWNlL0xURvCfmoAvVGhlRm94aG91bmRQcm9qZWN0": [
|
||||||
|
"exit"
|
||||||
|
],
|
||||||
|
"L2hvbWUvc2hhd24vV29ya3NwYWNlL0xURvCfmoAvVGhlRm94aG91bmRQcm9qZWN0L2ZveGhvdW5k": [
|
||||||
|
"python.se"
|
||||||
|
],
|
||||||
|
"L2hvbWUvc2hhd24vV29ya3NwYWNlL0xURvCfmoAvVGhlRm94aG91bmRQcm9qZWN0L3Rlc3Rz": [
|
||||||
|
"python.setin",
|
||||||
|
"python.setint"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
{}
|
||||||
|
|
@ -1,6 +1,19 @@
|
||||||
complete -xc nvm -n __fish_use_subcommand -a ls -d "List available versions matching <regex>"
|
complete -c nvm --exclusive --long version -d "Print version"
|
||||||
complete -xc nvm -n __fish_use_subcommand -a use -d "Download <version> and modify PATH so it's available"
|
complete -c nvm --exclusive --long help -d "Print this help message"
|
||||||
complete -xc nvm -n __fish_use_subcommand -a --help -d "Show usage help"
|
|
||||||
complete -xc nvm -n __fish_use_subcommand -a --version -d "Show the current version of nvm"
|
|
||||||
|
|
||||||
nvm complete
|
complete -c nvm --exclusive --condition "__fish_use_subcommand" -a install -d "Download and activate the specified Node version"
|
||||||
|
complete -c nvm --exclusive --condition "__fish_use_subcommand" -a use -d "Activate a version in the current shell"
|
||||||
|
complete -c nvm --exclusive --condition "__fish_use_subcommand" -a list -d "List installed versions"
|
||||||
|
complete -c nvm --exclusive --condition "__fish_use_subcommand" -a list-remote -d "List versions available to install matching optional regex"
|
||||||
|
complete -c nvm --exclusive --condition "__fish_use_subcommand" -a current -d "Print the currently-active version"
|
||||||
|
complete -c nvm --exclusive --condition "__fish_seen_subcommand_from install" -a "(
|
||||||
|
test -e $nvm_data && string split ' ' <$nvm_data/.index
|
||||||
|
)"
|
||||||
|
complete -c nvm --exclusive --condition "__fish_seen_subcommand_from use" -a "(_nvm_list | string split ' ')"
|
||||||
|
complete -c nvm --exclusive --condition "__fish_use_subcommand" -a uninstall -d "Uninstall a version"
|
||||||
|
complete -c nvm --exclusive --condition "__fish_seen_subcommand_from uninstall" -a "(
|
||||||
|
_nvm_list | string split ' ' | string replace system ''
|
||||||
|
)"
|
||||||
|
complete -c nvm --exclusive --condition "__fish_seen_subcommand_from use uninstall" -a "(
|
||||||
|
set --query nvm_default_version && echo default
|
||||||
|
)"
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
/home/ygg/.config/fish/fisher/fish-github/conf.d/github.fish
|
/home/shawn/.config/fish/fisher/fish-github/conf.d/github.fish
|
||||||
|
|
@ -1,15 +1,23 @@
|
||||||
function _nvm_uninstall -e nvm_uninstall
|
set --query XDG_DATA_HOME \
|
||||||
if test -s "$nvm_config/version"
|
&& set --global nvm_data $XDG_DATA_HOME/nvm \
|
||||||
read -l ver <$nvm_config/version
|
|| set --global nvm_data ~/.local/share/nvm
|
||||||
if set -l i (contains -i -- "$nvm_config/$ver/bin" $fish_user_paths)
|
set --query nvm_mirror || set --global nvm_mirror https://nodejs.org/dist
|
||||||
set -e fish_user_paths[$i]
|
|
||||||
end
|
|
||||||
command rm -f $nvm_config/version
|
|
||||||
end
|
|
||||||
|
|
||||||
for name in (set -n | command awk '/^nvm_/')
|
if set --query nvm_default_version && ! set --query nvm_current_version
|
||||||
set -e "$name"
|
nvm use $nvm_default_version >/dev/null
|
||||||
end
|
|
||||||
|
|
||||||
functions -e (functions -a | command awk '/^_nvm_/')
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function _nvm_install -e nvm_install
|
||||||
|
test ! -d $nvm_data && command mkdir -p $nvm_data
|
||||||
|
echo "Downloading the Node distribution index for the first time..." 2>/dev/null
|
||||||
|
_nvm_index_update $nvm_mirror/index.tab $nvm_data/.index
|
||||||
|
end
|
||||||
|
|
||||||
|
function _nvm_uninstall -e nvm_uninstall
|
||||||
|
command rm -rf $nvm_data
|
||||||
|
set --query nvm_current_version && _nvm_version_deactivate $nvm_current_version
|
||||||
|
|
||||||
|
set --names | string replace --filter --regex "^nvm_" -- "set --erase nvm_" | source
|
||||||
|
functions --erase (functions --all | string match --entire --regex "^_nvm_")
|
||||||
|
complete --erase --command nvm
|
||||||
|
end
|
||||||
|
|
@ -54,3 +54,7 @@ end
|
||||||
abbr gc git commit -m
|
abbr gc git commit -m
|
||||||
abbr gp git push origin master
|
abbr gp git push origin master
|
||||||
abbr python python
|
abbr python python
|
||||||
|
|
||||||
|
set -gx GOPATH $HOME/go; set -gx GOROOT $HOME/.go; set -gx PATH $GOPATH/bin $PATH; # g-install: do NOT edit, see https://github.com/stefanmaric/g
|
||||||
|
abbr cat batcat
|
||||||
|
abbr pip pip3
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
/home/ygg/.config/fish/fisher/fish-utils/EditDailyLog.fish
|
/home/shawn/.config/fish/fisher/fish-utils/EditDailyLog.fish
|
||||||
|
|
@ -1 +1 @@
|
||||||
/home/ygg/.config/fish/fisher/fish-utils/LogDirectory.fish
|
/home/shawn/.config/fish/fisher/fish-utils/LogDirectory.fish
|
||||||
|
|
@ -1 +1 @@
|
||||||
/home/ygg/.config/fish/fisher/fish-utils/OpenLogDirectory.fish
|
/home/shawn/.config/fish/fisher/fish-utils/OpenLogDirectory.fish
|
||||||
|
|
@ -1 +1 @@
|
||||||
/home/ygg/.config/fish/fisher/fish-utils/RunBackup.fish
|
/home/shawn/.config/fish/fisher/fish-utils/RunBackup.fish
|
||||||
|
|
@ -1 +1 @@
|
||||||
/home/ygg/.config/fish/fisher/fish-fzf/__fzf_display_value_or_error.fish
|
/home/shawn/.config/fish/fisher/fish-fzf/__fzf_display_value_or_error.fish
|
||||||
|
|
@ -1 +1 @@
|
||||||
/home/ygg/.config/fish/fisher/fish-fzf/__fzf_preview_file.fish
|
/home/shawn/.config/fish/fisher/fish-fzf/__fzf_preview_file.fish
|
||||||
|
|
@ -1 +1 @@
|
||||||
/home/ygg/.config/fish/fisher/fish-fzf/__fzf_report_file_type.fish
|
/home/shawn/.config/fish/fisher/fish-fzf/__fzf_report_file_type.fish
|
||||||
|
|
@ -1 +1 @@
|
||||||
/home/ygg/.config/fish/fisher/fish-fzf/__fzf_search_current_dir.fish
|
/home/shawn/.config/fish/fisher/fish-fzf/__fzf_search_current_dir.fish
|
||||||
|
|
@ -1 +1 @@
|
||||||
/home/ygg/.config/fish/fisher/fish-fzf/__fzf_search_git_log.fish
|
/home/shawn/.config/fish/fisher/fish-fzf/__fzf_search_git_log.fish
|
||||||
|
|
@ -1 +1 @@
|
||||||
/home/ygg/.config/fish/fisher/fish-fzf/__fzf_search_git_status.fish
|
/home/shawn/.config/fish/fisher/fish-fzf/__fzf_search_git_status.fish
|
||||||
|
|
@ -1 +1 @@
|
||||||
/home/ygg/.config/fish/fisher/fish-fzf/__fzf_search_history.fish
|
/home/shawn/.config/fish/fisher/fish-fzf/__fzf_search_history.fish
|
||||||
|
|
@ -1 +1 @@
|
||||||
/home/ygg/.config/fish/fisher/fish-fzf/__fzf_search_shell_variables.fish
|
/home/shawn/.config/fish/fisher/fish-fzf/__fzf_search_shell_variables.fish
|
||||||
|
|
@ -1 +1 @@
|
||||||
/home/ygg/.config/fish/fisher/fish-github/__github_add_org.fish
|
/home/shawn/.config/fish/fisher/fish-github/__github_add_org.fish
|
||||||
|
|
@ -1 +1 @@
|
||||||
/home/ygg/.config/fish/fisher/fish-github/__github_get_org_repos.fish
|
/home/shawn/.config/fish/fisher/fish-github/__github_get_org_repos.fish
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
function _nvm_index_update -a mirror index
|
||||||
|
command curl --location --silent $mirror | command awk -v OFS=\t '
|
||||||
|
/v0.9.12/ { exit } # Unsupported
|
||||||
|
NR > 1 {
|
||||||
|
print $1 (NR == 2 ? " latest" : $10 != "-" ? " lts/" tolower($10) : "")
|
||||||
|
}
|
||||||
|
' > $index.temp && command mv $index.temp $index && return
|
||||||
|
|
||||||
|
command rm -f $index.temp
|
||||||
|
echo "nvm: Invalid index or unavailable host: \"$mirror\"" >&2
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
function _nvm_list
|
||||||
|
set --local versions $nvm_data/*
|
||||||
|
set --query versions[1] \
|
||||||
|
&& string match --entire --regex (string match --regex "v\d.+" $versions \
|
||||||
|
| string escape --style=regex \
|
||||||
|
| string join "|"
|
||||||
|
) <$nvm_data/.index
|
||||||
|
|
||||||
|
command --all node | string match --quiet --invert --regex "^$nvm_data" \
|
||||||
|
&& echo system
|
||||||
|
end
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
function _nvm_version_activate -a v
|
||||||
|
set --global --export nvm_current_version $v
|
||||||
|
set --prepend PATH $nvm_data/$v/bin
|
||||||
|
end
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
function _nvm_version_deactivate -a v
|
||||||
|
test "$nvm_current_version" = "$v" && set --erase nvm_current_version
|
||||||
|
set --local index (contains --index -- $nvm_data/$v/bin $PATH) \
|
||||||
|
&& set --erase PATH[$index]
|
||||||
|
end
|
||||||
|
|
@ -1 +1 @@
|
||||||
/home/ygg/.config/fish/fisher/fish-utils/create_daily_log.fish
|
/home/shawn/.config/fish/fisher/fish-utils/create_daily_log.fish
|
||||||
|
|
@ -1 +1 @@
|
||||||
/home/ygg/.config/fish/fisher/fish-fzf/d.fish
|
/home/shawn/.config/fish/fisher/fish-fzf/d.fish
|
||||||
|
|
@ -1 +1 @@
|
||||||
/home/ygg/.config/fish/fisher/fish-github/fcd.fish
|
/home/shawn/.config/fish/fisher/fish-github/fcd.fish
|
||||||
|
|
@ -1 +1 @@
|
||||||
/home/ygg/.config/fish/fisher/fish-github/fclone.fish
|
/home/shawn/.config/fish/fisher/fish-github/fclone.fish
|
||||||
|
|
@ -1 +1 @@
|
||||||
/home/ygg/.config/fish/fisher/fish-github/fhub.fish
|
/home/shawn/.config/fish/fisher/fish-github/fhub.fish
|
||||||
|
|
@ -1 +1 @@
|
||||||
/home/ygg/.config/fish/fisher/fish-github/fkill.fish
|
/home/shawn/.config/fish/fisher/fish-github/fkill.fish
|
||||||
|
|
@ -1 +1 @@
|
||||||
/home/ygg/.config/fish/fisher/fish-github/forgit.plugin.fish
|
/home/shawn/.config/fish/fisher/fish-github/forgit.plugin.fish
|
||||||
|
|
@ -1 +1 @@
|
||||||
/home/ygg/.config/fish/fisher/fish-fzf/fzf-bcd-widget.fish
|
/home/shawn/.config/fish/fisher/fish-fzf/fzf-bcd-widget.fish
|
||||||
|
|
@ -1 +1 @@
|
||||||
/home/ygg/.config/fish/fisher/fish-fzf/fzf-cdhist-widget.fish
|
/home/shawn/.config/fish/fisher/fish-fzf/fzf-cdhist-widget.fish
|
||||||
|
|
@ -1 +1 @@
|
||||||
/home/ygg/.config/fish/fisher/fish-fzf/fzf-complete.fish
|
/home/shawn/.config/fish/fisher/fish-fzf/fzf-complete.fish
|
||||||
|
|
@ -1 +1 @@
|
||||||
/home/ygg/.config/fish/fisher/fish-fzf/fzf-select.fish
|
/home/shawn/.config/fish/fisher/fish-fzf/fzf-select.fish
|
||||||
|
|
@ -1 +1 @@
|
||||||
/home/shawn/.fzf/shell/key-bindings.fish
|
/home/shawn/.config/fish/fisher/fish-fzf/fzf_key_bindings.fish
|
||||||
|
|
@ -1,168 +1,65 @@
|
||||||
set -g nvm_version 1.1.0
|
function nvm -a cmd v -d "Node version manager"
|
||||||
|
if test -z "$v" && contains -- "$cmd" install use
|
||||||
function nvm -a cmd -d "Node.js version manager"
|
for file in .nvmrc .node-version
|
||||||
set -q XDG_CONFIG_HOME; or set XDG_CONFIG_HOME ~/.config
|
set file (_nvm_find_up $PWD $file) && read v <$file && break
|
||||||
set -g nvm_config $XDG_CONFIG_HOME/nvm
|
end
|
||||||
set -g nvm_file .nvmrc
|
if test -z "$v"
|
||||||
set -q nvm_mirror; or set -g nvm_mirror "https://nodejs.org/dist"
|
echo "nvm: Invalid version or missing \".nvmrc\" file" >&2
|
||||||
|
return 1
|
||||||
if test ! -d $nvm_config
|
end
|
||||||
command mkdir -p $nvm_config
|
|
||||||
end
|
end
|
||||||
|
|
||||||
switch "$cmd"
|
switch "$cmd"
|
||||||
case ls list
|
case -v --version
|
||||||
set -e argv[1]
|
echo "nvm, version 2.0.1"
|
||||||
_nvm_ls $argv
|
case "" -h --help
|
||||||
case use
|
echo "Usage: nvm install <version> Download and activate the specified Node version"
|
||||||
set -e argv[1]
|
echo " nvm install Install version from nearest .nvmrc file"
|
||||||
_nvm_use $argv
|
echo " nvm use <version> Activate a version in the current shell"
|
||||||
case ""
|
echo " nvm use Activate version from nearest .nvmrc file"
|
||||||
if isatty
|
echo " nvm list List installed versions"
|
||||||
if set -l root (_nvm_find_up (pwd) $nvm_file)
|
echo " nvm list-remote List versions available to install"
|
||||||
read cmd <$root/$nvm_file
|
echo " nvm list-remote <regex> List versions matching a given regular expression"
|
||||||
end
|
echo " nvm current Print the currently-active version"
|
||||||
else
|
echo " nvm uninstall <version> Uninstall a version"
|
||||||
read cmd
|
echo "Options:"
|
||||||
end
|
echo " -v or --version Print version"
|
||||||
if not set -q cmd[1]
|
echo " -h or --help Print this help message"
|
||||||
echo "nvm: version or .nvmrc file missing" >&2
|
echo "Variables:"
|
||||||
_nvm_help >&2
|
echo " nvm_mirror Set mirror for Node binaries"
|
||||||
|
echo " nvm_default_version Set the default version for new shells"
|
||||||
|
case install
|
||||||
|
_nvm_index_update $nvm_mirror/index.tab $nvm_data/.index || return
|
||||||
|
|
||||||
|
string match --entire --regex (_nvm_version_match $v) <$nvm_data/.index | read v alias
|
||||||
|
|
||||||
|
if ! set --query v[1]
|
||||||
|
echo "nvm: Invalid version number or alias: \"$argv[2..-1]\"" >&2
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
_nvm_use $cmd
|
if test ! -e $nvm_data/$v
|
||||||
case {,-}-v{ersion,}
|
set --local os (uname -s | string lower)
|
||||||
echo "nvm version $nvm_version"
|
set --local ext tar.gz
|
||||||
case {,-}-h{elp,}
|
set --local arch (uname -m)
|
||||||
_nvm_help
|
|
||||||
case complete
|
|
||||||
_nvm_complete "$nvm_config/index"
|
|
||||||
case \*
|
|
||||||
echo "nvm: unknown flag or command \"$cmd\"" >&2
|
|
||||||
_nvm_help >&2
|
|
||||||
return 1
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function _nvm_help
|
switch $os
|
||||||
echo "usage: nvm --help Show this help"
|
case aix
|
||||||
echo " nvm --version Show the current version of nvm"
|
set arch ppc64
|
||||||
echo " nvm ls [<regex>] List available versions matching <regex>"
|
case sunos
|
||||||
echo " nvm use <version> Download <version> and modify PATH to use it"
|
case linux
|
||||||
echo " nvm Use version in .nvmrc (or stdin if not a tty)"
|
case darwin
|
||||||
echo "examples:"
|
case {MSYS_NT,MINGW\*_NT}\*
|
||||||
echo " nvm use 14"
|
set os win
|
||||||
echo " nvm use lts"
|
set ext zip
|
||||||
echo " nvm use latest"
|
case \*
|
||||||
echo " nvm use dubnium"
|
echo "nvm: Unsupported operating system: \"$os\"" >&2
|
||||||
echo " nvm ls '^1|9\$'"
|
return 1
|
||||||
echo " nvm ls 12"
|
end
|
||||||
echo " nvm <file"
|
|
||||||
end
|
|
||||||
|
|
||||||
function _nvm_complete -a index
|
switch $arch
|
||||||
if test -s "$index"
|
case i\*86
|
||||||
for alias in (command awk '
|
set arch x86
|
||||||
$4 {
|
|
||||||
for (i = split($4, alias, "|"); i; i--)
|
|
||||||
if (!seen[alias[i]]++) print alias[i]
|
|
||||||
}
|
|
||||||
$2 != "-" && !seen[$2]++ { print $2 } { print $1 }
|
|
||||||
' <$index)
|
|
||||||
complete -xc nvm -n "__fish_seen_subcommand_from use" -a $alias
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function _nvm_get_index
|
|
||||||
set -l index "$nvm_config/index"
|
|
||||||
set -q nvm_index_update_interval; or set -g nvm_index_update_interval 0
|
|
||||||
|
|
||||||
if test ! -e $index -o (math (command date +%s) - $nvm_index_update_interval) -gt 120
|
|
||||||
command curl -sS $nvm_mirror/index.tab | command awk -v OFS=\t '
|
|
||||||
NR > 1 && !/^v0\.[1-9]\./ {
|
|
||||||
split($1 = substr($1, 2), v, ".")
|
|
||||||
is_latest = NR == 2
|
|
||||||
alias = ($10 = tolower($10)) == "-" ? "" : "lts|"$10
|
|
||||||
is_lts = alias != ""
|
|
||||||
print $1, (/^0/ ? "-" : v[1]), v[1]"."v[2],
|
|
||||||
is_latest ? is_lts ? alias"|latest" : "latest" : is_lts ? alias : ""
|
|
||||||
}
|
|
||||||
' >$index 2>/dev/null
|
|
||||||
|
|
||||||
if test ! -s "$index"
|
|
||||||
echo "nvm: invalid mirror index -- is \"$nvm_mirror\" a valid host?" >&2
|
|
||||||
return 1
|
|
||||||
end
|
|
||||||
|
|
||||||
_nvm_complete $index
|
|
||||||
set -g nvm_index_update_interval (command date +%s)
|
|
||||||
end
|
|
||||||
|
|
||||||
echo $index
|
|
||||||
end
|
|
||||||
|
|
||||||
function _nvm_ls -a query
|
|
||||||
set -l index (_nvm_get_index); or return
|
|
||||||
test -s "$nvm_config/version"; and read -l current <"$nvm_config/version"
|
|
||||||
command awk -v current="$current" '
|
|
||||||
$1 ~ /'"$query"'/ {
|
|
||||||
gsub(/\|/, "/", $4)
|
|
||||||
out[n++] = $1
|
|
||||||
out[n++] = $4 ($1 == current ? ($4 ? "/" : "") "current" : "")
|
|
||||||
pad = pad < length($1) ? length($1) : pad
|
|
||||||
}
|
|
||||||
END {
|
|
||||||
for (i = n - 1; i > 0; i -= 2) {
|
|
||||||
printf("%"pad"s %s\n", out[i - 1] , out[i] ? "("out[i]")": "")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
' <$index 2>/dev/null
|
|
||||||
end
|
|
||||||
|
|
||||||
function _nvm_resolve_version
|
|
||||||
set -l index (_nvm_get_index); or return
|
|
||||||
set -l ver (command awk -v ver="$argv[1]" '
|
|
||||||
BEGIN {
|
|
||||||
if (match(ver, /v[0-9]/)) gsub(/^[ \t]*v|[ \t]*$/, "", ver)
|
|
||||||
if ((n = split(tolower(ver), a, "/")) > 3) exit
|
|
||||||
for (ver = a[1]; n > 0; n--) {
|
|
||||||
if (a[n] != "*" && a[n] != "latest" && (ver = a[n]) != "lts")
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ver == $1"" || ver == $2"" || ver == $3"" || $4 && ver ~ $4 {
|
|
||||||
print $1
|
|
||||||
exit
|
|
||||||
}
|
|
||||||
' <$index 2>/dev/null)
|
|
||||||
|
|
||||||
if not set -q ver[1]
|
|
||||||
return 1
|
|
||||||
end
|
|
||||||
|
|
||||||
echo $ver
|
|
||||||
end
|
|
||||||
|
|
||||||
function _nvm_use
|
|
||||||
set -l index (_nvm_get_index); or return
|
|
||||||
set -l ver (_nvm_resolve_version $argv[1])
|
|
||||||
|
|
||||||
if not set -q ver[1]
|
|
||||||
echo "nvm: invalid version number or alias: \"$argv[1]\"" >&2
|
|
||||||
return 1
|
|
||||||
end
|
|
||||||
|
|
||||||
if test ! -d "$nvm_config/$ver/bin"
|
|
||||||
set -l os
|
|
||||||
set -l arch
|
|
||||||
set -l name "node-v$ver"
|
|
||||||
set -l target "$nvm_config/$ver"
|
|
||||||
switch (uname -s)
|
|
||||||
case Linux
|
|
||||||
set os linux
|
|
||||||
switch (uname -m)
|
|
||||||
case x86_64
|
case x86_64
|
||||||
set arch x64
|
set arch x64
|
||||||
case armv6 armv6l
|
case armv6 armv6l
|
||||||
|
|
@ -171,62 +68,131 @@ function _nvm_use
|
||||||
set arch armv7l
|
set arch armv7l
|
||||||
case armv8 armv8l aarch64
|
case armv8 armv8l aarch64
|
||||||
set arch arm64
|
set arch arm64
|
||||||
case \*
|
|
||||||
set arch x86
|
|
||||||
end
|
end
|
||||||
set name "$name-linux-$arch.tar.gz"
|
|
||||||
case Darwin
|
set --local dir "node-$v-$os-$arch"
|
||||||
set os darwin
|
set --local url $nvm_mirror/$v/$dir.$ext
|
||||||
set arch x64
|
|
||||||
case \*
|
command mkdir -p $nvm_data/$v
|
||||||
echo "nvm: OS not implemented -- request it on https://git.io/fish-nvm" >&2
|
|
||||||
|
echo -e "Installing Node \x1b[1m$v\x1b[22m $alias"
|
||||||
|
echo -e "Fetching \x1b[4m$url\x1b[24m\x1b[7m"
|
||||||
|
|
||||||
|
if ! command curl --progress-bar --location $url \
|
||||||
|
| command tar --extract --gzip --directory $nvm_data/$v 2>/dev/null
|
||||||
|
command rm -rf $nvm_data/$v
|
||||||
|
echo -e "\033[F\33[2K\x1b[0mnvm: Invalid mirror or host unavailable: \"$url\"" >&2
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
|
||||||
|
echo -en "\033[F\33[2K\x1b[0m"
|
||||||
|
|
||||||
|
if test "$os" = "win"
|
||||||
|
command mv $nvm_data/$v/$dir $nvm_data/$v/bin
|
||||||
|
else
|
||||||
|
command mv $nvm_data/$v/$dir/* $nvm_data/$v
|
||||||
|
command rm -rf $nvm_data/$v/$dir
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if test $v != "$nvm_current_version"
|
||||||
|
set --query nvm_current_version && _nvm_version_deactivate $nvm_current_version
|
||||||
|
_nvm_version_activate $v
|
||||||
|
end
|
||||||
|
|
||||||
|
printf "Now using Node %s (npm %s) %s\n" (_nvm_node_info)
|
||||||
|
case use
|
||||||
|
test $v = default && set v $nvm_default_version
|
||||||
|
_nvm_list | string match --entire --regex (_nvm_version_match $v) | read v __
|
||||||
|
|
||||||
|
if ! set --query v[1]
|
||||||
|
echo "nvm: Node version not installed or invalid: \"$argv[2..-1]\"" >&2
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
set -l name "node-v$ver-$os-$arch"
|
if test $v != "$nvm_current_version"
|
||||||
set -l url $nvm_mirror/v$ver/$name
|
set --query nvm_current_version && _nvm_version_deactivate $nvm_current_version
|
||||||
|
test $v != system && _nvm_version_activate $v
|
||||||
|
end
|
||||||
|
|
||||||
echo "fetching $url" >&2
|
printf "Now using Node %s (npm %s) %s\n" (_nvm_node_info)
|
||||||
command mkdir -p $target/$name
|
case uninstall
|
||||||
|
if test -z "$v"
|
||||||
|
echo "nvm: Not enough arguments for command: \"$cmd\"" >&2
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
|
||||||
if not command curl -L --fail --progress-bar $url.tar.gz | command tar -xzf- -C $target/$name
|
test $v = default && test ! -z "$nvm_default_version" && set v $nvm_default_version
|
||||||
command rm -rf $target
|
|
||||||
echo "nvm: fetch error -- are you offline?" >&2
|
_nvm_list | string match --entire --regex (_nvm_version_match $v) | read v __
|
||||||
|
|
||||||
|
if ! set -q v[1]
|
||||||
|
echo "nvm: Node version not installed or invalid: \"$argv[2..-1]\"" >&2
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
|
||||||
|
echo -e "Uninstalling Node $v "(command --search node | string replace ~ \~)
|
||||||
|
|
||||||
|
_nvm_version_deactivate $v
|
||||||
|
|
||||||
|
command rm -rf $nvm_data/$v
|
||||||
|
case current
|
||||||
|
_nvm_current
|
||||||
|
case ls list
|
||||||
|
_nvm_list | _nvm_list_format (_nvm_current) $argv[2]
|
||||||
|
case lsr {ls,list}-remote
|
||||||
|
_nvm_index_update $nvm_mirror/index.tab $nvm_data/.index || return
|
||||||
|
_nvm_list | command awk '
|
||||||
|
FNR == NR && FILENAME == "-" {
|
||||||
|
is_local[$1]++
|
||||||
|
next
|
||||||
|
} { print $0 (is_local[$1] ? " ✓" : "") }
|
||||||
|
' - $nvm_data/.index | _nvm_list_format (_nvm_current) $argv[2]
|
||||||
|
case \*
|
||||||
|
echo "nvm: Unknown flag or command: \"$cmd\" (see `nvm -h`)" >&2
|
||||||
return 1
|
return 1
|
||||||
end
|
|
||||||
|
|
||||||
command mv -f $target/$name/$name $nvm_config/$ver.
|
|
||||||
command rm -rf $target
|
|
||||||
command mv -f $nvm_config/$ver. $target
|
|
||||||
end
|
|
||||||
|
|
||||||
if test -s "$nvm_config/version"
|
|
||||||
read -l last <"$nvm_config/version"
|
|
||||||
if set -l i (contains -i -- "$nvm_config/$last/bin" $fish_user_paths)
|
|
||||||
set -e fish_user_paths[$i]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if set -l root (_nvm_find_up (pwd) $nvm_file)
|
|
||||||
read -l line <$root/$nvm_file
|
|
||||||
if test $ver != (_nvm_resolve_version $line)
|
|
||||||
echo $argv[1] >$root/$nvm_file
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
echo $ver >$nvm_config/version
|
|
||||||
|
|
||||||
if not contains -- "$nvm_config/$ver/bin" $fish_user_paths
|
|
||||||
set -U fish_user_paths "$nvm_config/$ver/bin" $fish_user_paths
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function _nvm_find_up -a path file
|
function _nvm_find_up -a path file
|
||||||
if test -e "$path/$file"
|
test -e "$path/$file" && echo $path/$file || begin
|
||||||
echo $path
|
test "$path" != / || return
|
||||||
else if test "$path" != /
|
|
||||||
_nvm_find_up (command dirname $path) $file
|
_nvm_find_up (command dirname $path) $file
|
||||||
else
|
|
||||||
return 1
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function _nvm_version_match -a v
|
||||||
|
string replace --regex '^v?(\d+|\d+\.\d+)$' 'v$1.' $v \
|
||||||
|
| string replace --filter --regex '^v?(\d+)' 'v$1' \
|
||||||
|
| string escape --style=regex || string lower '\b'$v'(?:/\w+)?$'
|
||||||
|
end
|
||||||
|
|
||||||
|
function _nvm_list_format -a current filter
|
||||||
|
command awk -v current="$current" -v filter="$filter" '
|
||||||
|
$0 ~ filter {
|
||||||
|
len = ++i
|
||||||
|
indent = (n = length($1)) > indent ? n : indent
|
||||||
|
versions[len] = $1
|
||||||
|
aliases[len] = $2 " " $3
|
||||||
|
}
|
||||||
|
END {
|
||||||
|
for (i = len; i > 0; i--) {
|
||||||
|
printf((current == versions[i] ? " ▶ " : " ") "%"indent"s %s\n", versions[i], aliases[i])
|
||||||
|
}
|
||||||
|
exit (len == 0)
|
||||||
|
}
|
||||||
|
'
|
||||||
|
end
|
||||||
|
|
||||||
|
function _nvm_current
|
||||||
|
command --search --quiet node || return
|
||||||
|
set --query nvm_current_version && echo $nvm_current_version || echo system
|
||||||
|
end
|
||||||
|
|
||||||
|
function _nvm_node_info
|
||||||
|
set --local npm_pkg_json (realpath (command --search npm))
|
||||||
|
command node --eval "
|
||||||
|
console.log(process.version)
|
||||||
|
console.log(require('"(string replace bin/npm-cli.js package.json $npm_pkg_json)"').version)"
|
||||||
|
command --search node | string replace ~ \~
|
||||||
|
end
|
||||||
|
|
@ -1 +1 @@
|
||||||
/home/ygg/.config/fish/fisher/fish-audio/pacmd-loopback.fish
|
/home/shawn/.config/fish/fisher/fish-audio/pacmd-loopback.fish
|
||||||
|
|
@ -1 +1 @@
|
||||||
/home/ygg/.config/fish/fisher/fish-github/readme.fish
|
/home/shawn/.config/fish/fisher/fish-github/readme.fish
|
||||||
|
|
@ -27,3 +27,7 @@ noremap <C-k> kk
|
||||||
" This makes the location of the current open file always the current working
|
" This makes the location of the current open file always the current working
|
||||||
" directory of vim. This pairs very nicely with tmux. Added - Sept 15th 2020
|
" directory of vim. This pairs very nicely with tmux. Added - Sept 15th 2020
|
||||||
autocmd BufEnter * lcd %:p:h
|
autocmd BufEnter * lcd %:p:h
|
||||||
|
|
||||||
|
" Spookie bug. I think I was hacked and that someone i fucking with me.
|
||||||
|
" Whenever I would pres shift K it would open a new tab in nvim.
|
||||||
|
inoremap <S-k> <S-k>
|
||||||
|
|
|
||||||
|
|
@ -27,11 +27,15 @@ vnoremap <leader>P "+P
|
||||||
|
|
||||||
|
|
||||||
" tab navigation mappings
|
" tab navigation mappings
|
||||||
map tt :tabnew
|
map tt :tabnew<CR>
|
||||||
map <M-Right> :tabn<CR>
|
map <S-k> :tabn<CR>
|
||||||
imap <M-Right> <ESC>:tabn<CR>
|
imap <S-k> <ESC>:tabn<CR>
|
||||||
map <M-Left> :tabp<CR>
|
map <S-j> :tabp<CR>
|
||||||
imap <M-Left> <ESC>:tabp<CR>
|
imap <S-j> <ESC>:tabp<CR>
|
||||||
|
map <M-k> :tabn<CR>
|
||||||
|
imap <M-k> <ESC>:tabn<CR>
|
||||||
|
map <M-j> :tabp<CR>
|
||||||
|
imap <M-j> <ESC>:tabp<CR>
|
||||||
|
|
||||||
" clear search results
|
" clear search results
|
||||||
nnoremap <silent> // :noh<CR>
|
nnoremap <silent> // :noh<CR>
|
||||||
|
|
|
||||||
|
|
@ -178,6 +178,11 @@ Plug 'junegunn/goyo.vim'
|
||||||
" Goyo mappings
|
" Goyo mappings
|
||||||
nmap <C-g> :Goyo<CR>
|
nmap <C-g> :Goyo<CR>
|
||||||
|
|
||||||
|
" Slimux
|
||||||
|
Plug 'esamattis/slimux'
|
||||||
|
map <M-s> :SlimuxREPLSendLine<CR>j
|
||||||
|
vmap <M-s> :SlimuxREPLSendSelection<CR>
|
||||||
|
|
||||||
|
|
||||||
" Tell vim-plug we finished declaring plugins, so it can load them
|
" Tell vim-plug we finished declaring plugins, so it can load them
|
||||||
call plug#end()
|
call plug#end()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue