mirror of
https://github.com/SeriousBug/dotfiles
synced 2024-05-19 19:29:04 -05:00
Compare commits
3 commits
a5bd92397b
...
e07b04ee21
Author | SHA1 | Date | |
---|---|---|---|
Kaan Barmore-Genç | e07b04ee21 | ||
Kaan Barmore-Genç | 3e92698070 | ||
Kaan Barmore-Genç | 23f052ff83 |
|
@ -50,6 +50,9 @@ depends = ["theme", "system"]
|
||||||
[system.variables]
|
[system.variables]
|
||||||
has_battery = false
|
has_battery = false
|
||||||
intel_backlight = false
|
intel_backlight = false
|
||||||
|
platform = "linux"
|
||||||
|
force_fish_shell = false
|
||||||
|
has_gpg = true
|
||||||
|
|
||||||
[theme.variables]
|
[theme.variables]
|
||||||
# These are specified in bg-fg pairs, background and text color. The _fg color
|
# These are specified in bg-fg pairs, background and text color. The _fg color
|
||||||
|
|
|
@ -1,16 +1,18 @@
|
||||||
|
complete --command nvm --exclusive
|
||||||
complete --command nvm --exclusive --long version --description "Print version"
|
complete --command nvm --exclusive --long version --description "Print version"
|
||||||
complete --command nvm --exclusive --long help --description "Print help"
|
complete --command nvm --exclusive --long help --description "Print help"
|
||||||
|
complete --command nvm --long silent --description "Suppress standard output"
|
||||||
|
|
||||||
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments install --description "Download and activate the specified Node version"
|
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments install --description "Download and activate the specified Node version"
|
||||||
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments use --description "Activate a version in the current shell"
|
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments use --description "Activate the specified Node version in the current shell"
|
||||||
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list --description "List installed versions"
|
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list --description "List installed Node versions"
|
||||||
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list-remote --description "List versions available to install matching optional regex"
|
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list-remote --description "List available Node versions to install"
|
||||||
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments current --description "Print the currently-active version"
|
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments current --description "Print the currently-active Node version"
|
||||||
complete --command nvm --exclusive --condition "__fish_seen_subcommand_from install" --arguments "(
|
complete --command nvm --exclusive --condition "__fish_seen_subcommand_from install" --arguments "(
|
||||||
test -e $nvm_data && string split ' ' <$nvm_data/.index
|
test -e $nvm_data && string split ' ' <$nvm_data/.index
|
||||||
)"
|
)"
|
||||||
complete --command nvm --exclusive --condition "__fish_seen_subcommand_from use" --arguments "(_nvm_list | string split ' ')"
|
complete --command nvm --exclusive --condition "__fish_seen_subcommand_from use" --arguments "(_nvm_list | string split ' ')"
|
||||||
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments uninstall --description "Uninstall a version"
|
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments uninstall --description "Uninstall the specified Node version"
|
||||||
complete --command nvm --exclusive --condition "__fish_seen_subcommand_from uninstall" --arguments "(
|
complete --command nvm --exclusive --condition "__fish_seen_subcommand_from uninstall" --arguments "(
|
||||||
_nvm_list | string split ' ' | string replace system ''
|
_nvm_list | string split ' ' | string replace system ''
|
||||||
)"
|
)"
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
function _nvm_install --on-event nvm_install
|
set --query nvm_mirror || set --global nvm_mirror https://nodejs.org/dist
|
||||||
set --query XDG_DATA_HOME || set --local XDG_DATA_HOME ~/.local/share
|
set --query XDG_DATA_HOME || set --local XDG_DATA_HOME ~/.local/share
|
||||||
set --universal nvm_data $XDG_DATA_HOME/nvm
|
set --global nvm_data $XDG_DATA_HOME/nvm
|
||||||
set --query nvm_mirror || set --universal nvm_mirror https://nodejs.org/dist
|
|
||||||
|
|
||||||
|
function _nvm_install --on-event nvm_install
|
||||||
test ! -d $nvm_data && command mkdir -p $nvm_data
|
test ! -d $nvm_data && command mkdir -p $nvm_data
|
||||||
echo "Downloading the Node distribution index..." 2>/dev/null
|
echo "Downloading the Node distribution index..." 2>/dev/null
|
||||||
_nvm_index_update $nvm_mirror $nvm_data/.index
|
_nvm_index_update
|
||||||
end
|
end
|
||||||
|
|
||||||
function _nvm_update --on-event nvm_update
|
function _nvm_update --on-event nvm_update
|
||||||
set --query XDG_DATA_HOME || set --local XDG_DATA_HOME ~/.local/share
|
set --query --universal nvm_data && set --erase --universal nvm_data
|
||||||
set --universal nvm_data $XDG_DATA_HOME/nvm
|
set --query --universal nvm_mirror && set --erase --universal nvm_mirror
|
||||||
set --query nvm_mirror || set --universal nvm_mirror https://nodejs.org/dist
|
set --query nvm_mirror || set --global nvm_mirror https://nodejs.org/dist
|
||||||
end
|
end
|
||||||
|
|
||||||
function _nvm_uninstall --on-event nvm_uninstall
|
function _nvm_uninstall --on-event nvm_uninstall
|
||||||
|
@ -24,5 +24,5 @@ function _nvm_uninstall --on-event nvm_uninstall
|
||||||
end
|
end
|
||||||
|
|
||||||
if status is-interactive && set --query nvm_default_version && ! set --query nvm_current_version
|
if status is-interactive && set --query nvm_default_version && ! set --query nvm_current_version
|
||||||
nvm use $nvm_default_version >/dev/null
|
nvm use --silent $nvm_default_version
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,7 +3,7 @@ if status is-interactive
|
||||||
end
|
end
|
||||||
# set up direnv
|
# set up direnv
|
||||||
direnv hook fish | source
|
direnv hook fish | source
|
||||||
|
{{#if (eq platform "linux") }}
|
||||||
# set current desktop, needed for desktop sharing with Wayland
|
# set current desktop, needed for desktop sharing with Wayland
|
||||||
set -gx XDG_CURRENT_DESKTOP sway
|
set -gx XDG_CURRENT_DESKTOP sway
|
||||||
|
|
||||||
|
@ -26,3 +26,11 @@ for flatpakdir in ~/.local/share/flatpak/exports/bin /var/lib/flatpak/exports/bi
|
||||||
contains $flatpakdir $PATH; or set -a PATH $flatpakdir
|
contains $flatpakdir $PATH; or set -a PATH $flatpakdir
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{#if (eq platform "macos") }}
|
||||||
|
# Set Mac keyboard shortcuts
|
||||||
|
bind \u0192 forward-word
|
||||||
|
bind \u222B backward-word
|
||||||
|
bind \u2202 kill-word
|
||||||
|
{{/if}}
|
||||||
|
|
|
@ -3,7 +3,9 @@
|
||||||
SETUVAR --export ANDROID_HOME:/home/kaan/Android/Sdk/
|
SETUVAR --export ANDROID_HOME:/home/kaan/Android/Sdk/
|
||||||
SETUVAR --export BROWSER:firefox
|
SETUVAR --export BROWSER:firefox
|
||||||
SETUVAR --export CROSS_CONTAINER_ENGINE:podman
|
SETUVAR --export CROSS_CONTAINER_ENGINE:podman
|
||||||
|
{{#if (eq platform "Linux" )}}
|
||||||
SETUVAR --export DOCKER_HOST:unix\x3a///run/user/1000/docker\x2esock
|
SETUVAR --export DOCKER_HOST:unix\x3a///run/user/1000/docker\x2esock
|
||||||
|
{{/if}}
|
||||||
SETUVAR --export EDITOR:nano
|
SETUVAR --export EDITOR:nano
|
||||||
SETUVAR --export --path GOPATH:/home/kaan/\x2ego
|
SETUVAR --export --path GOPATH:/home/kaan/\x2ego
|
||||||
SETUVAR --export MOZ_ENABLE_WAYLAND:1
|
SETUVAR --export MOZ_ENABLE_WAYLAND:1
|
||||||
|
@ -12,7 +14,7 @@ SETUVAR --export TSC_WATCHFILE:UseFsEventsWithFallbackDynamicPolling
|
||||||
SETUVAR --export XDG_CURRENT_DESKTOP:sway
|
SETUVAR --export XDG_CURRENT_DESKTOP:sway
|
||||||
SETUVAR __fish_initialized:3400
|
SETUVAR __fish_initialized:3400
|
||||||
SETUVAR _fisher_jorgebucaran_2F_fisher_files:/home/kaan/\x2econfig/fish/functions/fisher\x2efish\x1e/home/kaan/\x2econfig/fish/completions/fisher\x2efish
|
SETUVAR _fisher_jorgebucaran_2F_fisher_files:/home/kaan/\x2econfig/fish/functions/fisher\x2efish\x1e/home/kaan/\x2econfig/fish/completions/fisher\x2efish
|
||||||
SETUVAR _fisher_jorgebucaran_2F_nvm_2E_fish_files:/home/kaan/\x2econfig/fish/functions/_nvm_index_update\x2efish\x1e/home/kaan/\x2econfig/fish/functions/_nvm_list\x2efish\x1e/home/kaan/\x2econfig/fish/functions/_nvm_version_activate\x2efish\x1e/home/kaan/\x2econfig/fish/functions/_nvm_version_deactivate\x2efish\x1e/home/kaan/\x2econfig/fish/functions/nvm\x2efish\x1e/home/kaan/\x2econfig/fish/conf\x2ed/nvm\x2efish\x1e/home/kaan/\x2econfig/fish/completions/nvm\x2efish
|
SETUVAR _fisher_jorgebucaran_2F_nvm_2E_fish_files:/Users/kaan/\x2econfig/fish/functions/_nvm_index_update\x2efish\x1e/Users/kaan/\x2econfig/fish/functions/_nvm_list\x2efish\x1e/Users/kaan/\x2econfig/fish/functions/_nvm_version_activate\x2efish\x1e/Users/kaan/\x2econfig/fish/functions/_nvm_version_deactivate\x2efish\x1e/Users/kaan/\x2econfig/fish/functions/nvm\x2efish\x1e/Users/kaan/\x2econfig/fish/conf\x2ed/nvm\x2efish\x1e/Users/kaan/\x2econfig/fish/completions/nvm\x2efish
|
||||||
SETUVAR _fisher_plugins:jorgebucaran/fisher\x1ejorgebucaran/nvm\x2efish
|
SETUVAR _fisher_plugins:jorgebucaran/fisher\x1ejorgebucaran/nvm\x2efish
|
||||||
SETUVAR fish_color_autosuggestion:555\x1ebrblack
|
SETUVAR fish_color_autosuggestion:555\x1ebrblack
|
||||||
SETUVAR fish_color_cancel:\x2dr
|
SETUVAR fish_color_cancel:\x2dr
|
||||||
|
@ -43,5 +45,3 @@ SETUVAR fish_pager_color_prefix:white\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
|
||||||
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
|
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
|
||||||
SETUVAR fish_pager_color_selected_background:\x2dr
|
SETUVAR fish_pager_color_selected_background:\x2dr
|
||||||
SETUVAR fish_user_paths:/home/kaan/\x2ecargo/bin\x1e/home/kaan/Android/Sdk/platform\x2dtools\x1e/home/kaan/Android/Sdk/tools/bin\x1e/home/kaan/Android/Sdk/tools\x1e/home/kaan/Android/Sdk/emulator\x1e/home/kaan/\x2elocal/bin
|
SETUVAR fish_user_paths:/home/kaan/\x2ecargo/bin\x1e/home/kaan/Android/Sdk/platform\x2dtools\x1e/home/kaan/Android/Sdk/tools/bin\x1e/home/kaan/Android/Sdk/tools\x1e/home/kaan/Android/Sdk/emulator\x1e/home/kaan/\x2elocal/bin
|
||||||
SETUVAR nvm_data:/home/kaan/\x2elocal/share/nvm
|
|
||||||
SETUVAR nvm_mirror:https\x3a//nodejs\x2eorg/dist
|
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
function _nvm_index_update --argument-names mirror index
|
function _nvm_index_update
|
||||||
if not command curl --location --silent $mirror/index.tab >$index.temp
|
test ! -d $nvm_data && command mkdir -p $nvm_data
|
||||||
|
|
||||||
|
set --local index $nvm_data/.index
|
||||||
|
|
||||||
|
if not command curl --location --silent $nvm_mirror/index.tab >$index.temp
|
||||||
command rm -f $index.temp
|
command rm -f $index.temp
|
||||||
echo "nvm: Can't update index, host unavailable: \"$mirror\"" >&2
|
echo "nvm: Can't update index, host unavailable: \"$nvm_mirror\"" >&2
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
function _nvm_version_activate --argument-names v
|
function _nvm_version_activate --argument-names ver
|
||||||
set --global --export nvm_current_version $v
|
set --global --export nvm_current_version $ver
|
||||||
set --prepend PATH $nvm_data/$v/bin
|
set --prepend PATH $nvm_data/$ver/bin
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
function _nvm_version_deactivate --argument-names v
|
function _nvm_version_deactivate --argument-names ver
|
||||||
test "$nvm_current_version" = "$v" && set --erase nvm_current_version
|
test "$nvm_current_version" = "$ver" && set --erase nvm_current_version
|
||||||
set --local index (contains --index -- $nvm_data/$v/bin $PATH) &&
|
set --local index (contains --index -- $nvm_data/$ver/bin $PATH) &&
|
||||||
set --erase PATH[$index]
|
set --erase PATH[$index]
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,47 +1,70 @@
|
||||||
function nvm --argument-names cmd v --description "Node version manager"
|
function nvm --description "Node version manager"
|
||||||
if test -z "$v" && contains -- "$cmd" install use
|
for silent in --silent -s
|
||||||
for file in .nvmrc .node-version
|
if set --local index (contains --index -- $silent $argv)
|
||||||
set file (_nvm_find_up $PWD $file) && read v <$file && break
|
set --erase argv[$index] && break
|
||||||
end
|
end
|
||||||
if test -z "$v"
|
set --erase silent
|
||||||
|
end
|
||||||
|
|
||||||
|
set --local cmd $argv[1]
|
||||||
|
set --local ver $argv[2]
|
||||||
|
|
||||||
|
if set --query silent && ! set --query cmd[1]
|
||||||
|
echo "nvm: Version number not specified (see nvm -h for usage)" >&2
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
|
||||||
|
if ! set --query ver[1] && contains -- "$cmd" install use
|
||||||
|
for file in .nvmrc .node-version
|
||||||
|
set file (_nvm_find_up $PWD $file) && read ver <$file && break
|
||||||
|
end
|
||||||
|
|
||||||
|
if ! set --query ver[1]
|
||||||
echo "nvm: Invalid version or missing \".nvmrc\" file" >&2
|
echo "nvm: Invalid version or missing \".nvmrc\" file" >&2
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
set --local their_version $v
|
set --local their_version $ver
|
||||||
|
|
||||||
switch "$cmd"
|
switch "$cmd"
|
||||||
case -v --version
|
case -v --version
|
||||||
echo "nvm, version 2.2.7"
|
echo "nvm, version 2.2.13"
|
||||||
case "" -h --help
|
case "" -h --help
|
||||||
echo "Usage: nvm install <version> Download and activate the specified Node version"
|
echo "Usage: nvm install <version> Download and activate the specified Node version"
|
||||||
echo " nvm install Install version from nearest .nvmrc file"
|
echo " nvm install Install the version specified in the nearest .nvmrc file"
|
||||||
echo " nvm use <version> Activate a version in the current shell"
|
echo " nvm use <version> Activate the specified Node version in the current shell"
|
||||||
echo " nvm use Activate version from nearest .nvmrc file"
|
echo " nvm use Activate the version specified in the nearest .nvmrc file"
|
||||||
echo " nvm list List installed versions"
|
echo " nvm list List installed Node versions"
|
||||||
echo " nvm list-remote List versions available to install"
|
echo " nvm list-remote List available Node versions to install"
|
||||||
echo " nvm list-remote <regex> List versions matching a given regular expression"
|
echo " nvm list-remote <regex> List Node versions matching a given regex pattern"
|
||||||
echo " nvm current Print the currently-active version"
|
echo " nvm current Print the currently-active Node version"
|
||||||
echo " nvm uninstall <version> Uninstall a version"
|
echo " nvm uninstall <version> Uninstall the specified Node version"
|
||||||
echo "Options:"
|
echo "Options:"
|
||||||
echo " -v or --version Print version"
|
echo " -s, --silent Suppress standard output"
|
||||||
echo " -h or --help Print this help message"
|
echo " -v, --version Print the version of nvm"
|
||||||
|
echo " -h, --help Print this help message"
|
||||||
echo "Variables:"
|
echo "Variables:"
|
||||||
echo " nvm_arch Override architecture, e.g. x64-musl"
|
echo " nvm_arch Override architecture, e.g. x64-musl"
|
||||||
echo " nvm_mirror Set the Node download mirror"
|
echo " nvm_mirror Use a mirror for downloading Node binaries"
|
||||||
echo " nvm_default_version Set the default version for new shells"
|
echo " nvm_default_version Set the default version for new shells"
|
||||||
|
echo " nvm_default_packages Install a list of packages every time a Node version is installed"
|
||||||
|
echo "Examples:"
|
||||||
|
echo " nvm install latest Install the latest version of Node"
|
||||||
|
echo " nvm use 14.15.1 Use Node version 14.15.1"
|
||||||
|
echo " nvm use system Activate the system's Node version"
|
||||||
|
|
||||||
case install
|
case install
|
||||||
_nvm_index_update $nvm_mirror $nvm_data/.index || return
|
_nvm_index_update
|
||||||
|
|
||||||
string match --entire --regex -- (_nvm_version_match $v) <$nvm_data/.index | read v alias
|
string match --entire --regex -- (_nvm_version_match $ver) <$nvm_data/.index | read ver alias
|
||||||
|
|
||||||
if ! set --query v[1]
|
if ! set --query ver[1]
|
||||||
echo "nvm: Invalid version number or alias: \"$their_version\"" >&2
|
echo "nvm: Invalid version number or alias: \"$their_version\"" >&2
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
if test ! -e $nvm_data/$v
|
if test ! -e $nvm_data/$ver
|
||||||
set --local os (command uname -s | string lower)
|
set --local os (command uname -s | string lower)
|
||||||
set --local ext tar.gz
|
set --local ext tar.gz
|
||||||
set --local arch (command uname -m)
|
set --local arch (command uname -m)
|
||||||
|
@ -66,7 +89,7 @@ function nvm --argument-names cmd v --description "Node version manager"
|
||||||
case x86_64
|
case x86_64
|
||||||
set arch x64
|
set arch x64
|
||||||
case arm64
|
case arm64
|
||||||
string match --regex --quiet "v(?<major>\d+)" $v
|
string match --regex --quiet "v(?<major>\d+)" $ver
|
||||||
if test "$os" = darwin -a $major -lt 16
|
if test "$os" = darwin -a $major -lt 16
|
||||||
set arch x64
|
set arch x64
|
||||||
end
|
end
|
||||||
|
@ -80,101 +103,104 @@ function nvm --argument-names cmd v --description "Node version manager"
|
||||||
|
|
||||||
set --query nvm_arch && set arch $nvm_arch
|
set --query nvm_arch && set arch $nvm_arch
|
||||||
|
|
||||||
set --local dir "node-$v-$os-$arch"
|
set --local dir "node-$ver-$os-$arch"
|
||||||
set --local url $nvm_mirror/$v/$dir.$ext
|
set --local url $nvm_mirror/$ver/$dir.$ext
|
||||||
|
|
||||||
command mkdir -p $nvm_data/$v
|
command mkdir -p $nvm_data/$ver
|
||||||
|
|
||||||
echo -e "Installing Node \x1b[1m$v\x1b[22m $alias"
|
if ! set --query silent
|
||||||
echo -e "Fetching \x1b[4m$url\x1b[24m\x1b[7m"
|
echo -e "Installing Node \x1b[1m$ver\x1b[22m $alias"
|
||||||
|
echo -e "Fetching \x1b[4m$url\x1b[24m\x1b[7m"
|
||||||
|
end
|
||||||
|
|
||||||
if ! command curl --progress-bar --location $url \
|
if ! command curl $silent --progress-bar --location $url |
|
||||||
| command tar --extract --gzip --directory $nvm_data/$v 2>/dev/null
|
command tar --extract --gzip --directory $nvm_data/$ver 2>/dev/null
|
||||||
command rm -rf $nvm_data/$v
|
command rm -rf $nvm_data/$ver
|
||||||
echo -e "\033[F\33[2K\x1b[0mnvm: Invalid mirror or host unavailable: \"$url\"" >&2
|
echo -e "\033[F\33[2K\x1b[0mnvm: Invalid mirror or host unavailable: \"$url\"" >&2
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
echo -en "\033[F\33[2K\x1b[0m"
|
set --query silent || echo -en "\033[F\33[2K\x1b[0m"
|
||||||
|
|
||||||
if test "$os" = win
|
if test "$os" = win
|
||||||
command mv $nvm_data/$v/$dir $nvm_data/$v/bin
|
command mv $nvm_data/$ver/$dir $nvm_data/$ver/bin
|
||||||
else
|
else
|
||||||
command mv $nvm_data/$v/$dir/* $nvm_data/$v
|
command mv $nvm_data/$ver/$dir/* $nvm_data/$ver
|
||||||
command rm -rf $nvm_data/$v/$dir
|
command rm -rf $nvm_data/$ver/$dir
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if test $v != "$nvm_current_version"
|
if test $ver != "$nvm_current_version"
|
||||||
set --query nvm_current_version && _nvm_version_deactivate $nvm_current_version
|
set --query nvm_current_version && _nvm_version_deactivate $nvm_current_version
|
||||||
_nvm_version_activate $v
|
_nvm_version_activate $ver
|
||||||
|
|
||||||
|
set --query nvm_default_packages[1] && npm install --global $silent $nvm_default_packages
|
||||||
end
|
end
|
||||||
|
|
||||||
printf "Now using Node %s (npm %s) %s\n" (_nvm_node_info)
|
set --query silent || printf "Now using Node %s (npm %s) %s\n" (_nvm_node_info)
|
||||||
case use
|
case use
|
||||||
test $v = default && set v $nvm_default_version
|
test $ver = default && set ver $nvm_default_version
|
||||||
_nvm_list | string match --entire --regex -- (_nvm_version_match $v) | read v __
|
_nvm_list | string match --entire --regex -- (_nvm_version_match $ver) | read ver __
|
||||||
|
|
||||||
if ! set --query v[1]
|
if ! set --query ver[1]
|
||||||
echo "nvm: Can't use Node \"$their_version\", version must be installed first" >&2
|
echo "nvm: Can't use Node \"$their_version\", version must be installed first" >&2
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
if test $v != "$nvm_current_version"
|
if test $ver != "$nvm_current_version"
|
||||||
set --query nvm_current_version && _nvm_version_deactivate $nvm_current_version
|
set --query nvm_current_version && _nvm_version_deactivate $nvm_current_version
|
||||||
test $v != system && _nvm_version_activate $v
|
test $ver != system && _nvm_version_activate $ver
|
||||||
end
|
end
|
||||||
|
|
||||||
printf "Now using Node %s (npm %s) %s\n" (_nvm_node_info)
|
set --query silent || printf "Now using Node %s (npm %s) %s\n" (_nvm_node_info)
|
||||||
case uninstall
|
case uninstall
|
||||||
if test -z "$v"
|
if test -z "$ver"
|
||||||
echo "nvm: Not enough arguments for command: \"$cmd\"" >&2
|
echo "nvm: Not enough arguments for command: \"$cmd\"" >&2
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
test $v = default && test ! -z "$nvm_default_version" && set v $nvm_default_version
|
test $ver = default && test ! -z "$nvm_default_version" && set ver $nvm_default_version
|
||||||
|
|
||||||
_nvm_list | string match --entire --regex -- (_nvm_version_match $v) | read v __
|
_nvm_list | string match --entire --regex -- (_nvm_version_match $ver) | read ver __
|
||||||
|
|
||||||
if ! set -q v[1]
|
if ! set -q ver[1]
|
||||||
echo "nvm: Node version not installed or invalid: \"$their_version\"" >&2
|
echo "nvm: Node version not installed or invalid: \"$their_version\"" >&2
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
printf "Uninstalling Node %s %s\n" $v (string replace ~ \~ "$nvm_data/$v/bin/node")
|
set --query silent || printf "Uninstalling Node %s %s\n" $ver (string replace ~ \~ "$nvm_data/$ver/bin/node")
|
||||||
|
|
||||||
_nvm_version_deactivate $v
|
_nvm_version_deactivate $ver
|
||||||
|
|
||||||
command rm -rf $nvm_data/$v
|
command rm -rf $nvm_data/$ver
|
||||||
case current
|
case current
|
||||||
_nvm_current
|
_nvm_current
|
||||||
case ls list
|
case ls list
|
||||||
_nvm_list | _nvm_list_format (_nvm_current) $argv[2]
|
_nvm_list | _nvm_list_format (_nvm_current) $argv[2]
|
||||||
case lsr {ls,list}-remote
|
case lsr {ls,list}-remote
|
||||||
_nvm_index_update $nvm_mirror $nvm_data/.index || return
|
_nvm_index_update || return
|
||||||
_nvm_list | command awk '
|
_nvm_list | command awk '
|
||||||
FILENAME == "-" && (is_local[$1] = FNR == NR) { next } {
|
FILENAME == "-" && (is_local[$1] = FNR == NR) { next } {
|
||||||
print $0 (is_local[$1] ? " ✓" : "")
|
print $0 (is_local[$1] ? " ✓" : "")
|
||||||
}
|
}
|
||||||
' - $nvm_data/.index | _nvm_list_format (_nvm_current) $argv[2]
|
' - $nvm_data/.index | _nvm_list_format (_nvm_current) $argv[2]
|
||||||
case \*
|
case \*
|
||||||
echo "nvm: Unknown command or option: \"$cmd\" (see nvm -h)" >&2
|
echo "nvm: Unknown command or option: \"$cmd\" (see nvm -h for usage)" >&2
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function _nvm_find_up --argument-names path file
|
function _nvm_find_up --argument-names path file
|
||||||
test -e "$path/$file" && echo $path/$file || begin
|
test -e "$path/$file" && echo $path/$file || begin
|
||||||
test "$path" != / || return
|
test ! -z "$path" || return
|
||||||
_nvm_find_up (command dirname $path) $file
|
_nvm_find_up (string replace --regex -- '/[^/]*$' "" $path) $file
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function _nvm_version_match --argument-names v
|
function _nvm_version_match --argument-names ver
|
||||||
string replace --regex -- '^v?(\d+|\d+\.\d+)$' 'v$1.' $v |
|
string replace --regex -- '^v?(\d+|\d+\.\d+)$' 'v$1.' $ver |
|
||||||
string replace --filter --regex -- '^v?(\d+)' 'v$1' |
|
string replace --filter --regex -- '^v?(\d+)' 'v$1' |
|
||||||
string escape --style=regex ||
|
string escape --style=regex || string lower '\b'$ver'(?:/\w+)?$'
|
||||||
string lower '\b'$v'(?:/\w+)?$'
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function _nvm_list_format --argument-names current regex
|
function _nvm_list_format --argument-names current regex
|
||||||
|
@ -203,6 +229,6 @@ function _nvm_node_info
|
||||||
command node --eval "
|
command node --eval "
|
||||||
console.log(process.version)
|
console.log(process.version)
|
||||||
console.log('$npm_version_default' ? '$npm_version_default': require('$npm_path/package.json').version)
|
console.log('$npm_version_default' ? '$npm_version_default': require('$npm_path/package.json').version)
|
||||||
console.log(process.execPath.replace(require('os').homedir(), '~'))
|
console.log(process.execPath)
|
||||||
"
|
" | string replace -- ~ \~
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,39 +1,41 @@
|
||||||
[user]
|
[user]
|
||||||
email = kaan@bgenc.net
|
email = kaan@bgenc.net
|
||||||
name = Kaan Barmore-Genc
|
name = Kaan Barmore-Genc
|
||||||
signingkey = F5DEC5268AA501F35FBD5978B2E280771CD62FCF
|
signingkey = F5DEC5268AA501F35FBD5978B2E280771CD62FCF
|
||||||
[init]
|
[init]
|
||||||
defaultBranch = main
|
defaultBranch = main
|
||||||
[pull]
|
[pull]
|
||||||
rebase = true
|
rebase = true
|
||||||
|
{{#if has_gpg}}
|
||||||
[commit]
|
[commit]
|
||||||
gpgSign = true
|
gpgSign = true
|
||||||
[tag]
|
[tag]
|
||||||
gpgsign = true
|
gpgsign = true
|
||||||
|
{{/if}}
|
||||||
[pager]
|
[pager]
|
||||||
diff = delta
|
diff = delta
|
||||||
log = delta
|
log = delta
|
||||||
reflog = delta
|
reflog = delta
|
||||||
show = delta
|
show = delta
|
||||||
[interactive]
|
[interactive]
|
||||||
diffFilter = delta --color-only
|
diffFilter = delta --color-only
|
||||||
[delta]
|
[delta]
|
||||||
features = side-by-side line-numbers decorations
|
features = side-by-side line-numbers decorations
|
||||||
whitespace-error-style = 22 reverse
|
whitespace-error-style = 22 reverse
|
||||||
[merge]
|
[merge]
|
||||||
ff = no
|
ff = no
|
||||||
[alias]
|
[alias]
|
||||||
stat = status
|
stat = status
|
||||||
[core]
|
[core]
|
||||||
editor = code --wait
|
editor = code --wait
|
||||||
[credential]
|
[credential]
|
||||||
helper = store
|
helper = store
|
||||||
[filter "lfs"]
|
[filter "lfs"]
|
||||||
required = true
|
required = true
|
||||||
clean = git-lfs clean -- %f
|
clean = git-lfs clean -- %f
|
||||||
smudge = git-lfs smudge -- %f
|
smudge = git-lfs smudge -- %f
|
||||||
process = git-lfs filter-process
|
process = git-lfs filter-process
|
||||||
[push]
|
[push]
|
||||||
autoSetupRemote = true
|
autoSetupRemote = true
|
||||||
[submodule]
|
[submodule]
|
||||||
recurse = true
|
recurse = true
|
||||||
|
|
|
@ -1090,7 +1090,11 @@ mark3_background #f274bc
|
||||||
|
|
||||||
#: Advanced
|
#: Advanced
|
||||||
|
|
||||||
|
{{#if force_fish_shell }}
|
||||||
|
shell /usr/local/bin/fish --login --interactive
|
||||||
|
{{else}}
|
||||||
shell .
|
shell .
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
#: The shell program to execute. The default value of . means to use
|
#: The shell program to execute. The default value of . means to use
|
||||||
#: whatever shell is set as the default shell for the current user.
|
#: whatever shell is set as the default shell for the current user.
|
||||||
|
|
Loading…
Reference in a new issue