diff --git a/NERDTreeBookmarks b/NERDTreeBookmarks index 8678a7a..63a7ea0 100644 --- a/NERDTreeBookmarks +++ b/NERDTreeBookmarks @@ -1,12 +1,9 @@ dl ~/Downloads dotfiles ~/dotfiles Downloads ~/Downloads -root ~/ +root ~ tm ~/Documents/workspace_tm obc ~/Documents/workspace_tm/obc private ~/Documents/workspace_private - -tix ~/Documents/workspace_tm/amadeus_api -dropbox ~/Dropbox -active ~/Documents/workspace_active archive ~/Documents/workspace_archive +active ~/Documents/workspace_active diff --git a/config/configstore/update-notifier-cordova.json b/config/configstore/update-notifier-cordova.json index d910e17..4b6f473 100644 --- a/config/configstore/update-notifier-cordova.json +++ b/config/configstore/update-notifier-cordova.json @@ -1,4 +1,4 @@ { "optOut": false, - "lastUpdateCheck": 1634293619280 + "lastUpdateCheck": 1697703361839 } \ No newline at end of file diff --git a/config/configstore/update-notifier-npm.json b/config/configstore/update-notifier-npm.json index 8936aa2..30f161b 100644 --- a/config/configstore/update-notifier-npm.json +++ b/config/configstore/update-notifier-npm.json @@ -1,4 +1,10 @@ { "optOut": false, - "lastUpdateCheck": 1634547408915 + "lastUpdateCheck": 1663659196272, + "update": { + "latest": "8.19.2", + "current": "6.14.17", + "type": "major", + "name": "npm" + } } \ No newline at end of file diff --git a/config/fish/config.fish b/config/fish/config.fish index f05b065..30eb4b0 100644 --- a/config/fish/config.fish +++ b/config/fish/config.fish @@ -1,6 +1,10 @@ # setting defualt editor set EDITOR vim +# add brew binaried +fish_add_path /opt/homebrew/opt/postgresql@11/bin +fish_add_path /opt/homebrew/bin + # setting PATH for rbenv # set PATH /usr/local/var/rbenv/shims $PATH status --is-interactive; and source (rbenv init -|psub) @@ -30,12 +34,16 @@ set -x -U GOPATH $HOME/Documents/workspace_go # definde Android SDK set -x -U ANDROID_SDK_ROOT $HOME/Library/Android/sdk +set -x -U ANDROID_HOME $HOME/Library/Android/sdk # set -x -U JAVA_HOME /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home -# set -x -U JAVA_HOME /Applications/Android\ Studio.app/Contents/jre/jdk/Contents/Home +set -x -U JAVA_HOME /Library/Java/JavaVirtualMachines/jdk-11.jdk/Contents/Home/ # setting GPG set GPG_TTY /dev/ttys001 +# set home +set -q XDG_CONFIG_HOME || set -U XDG_CONFIG_HOME $HOME/.config + # set abbveriations if status --is-interactive set -g fish_user_abbreviations @@ -78,3 +86,4 @@ set -g fish_user_paths "/usr/local/sbin" $fish_user_paths # kitty + complete setup fish | source set -g fish_user_paths "/usr/local/opt/postgresql@11/bin" $fish_user_paths set -g fish_user_paths "/usr/local/opt/imagemagick@6/bin" $fish_user_paths + diff --git a/config/fish/fish_plugins b/config/fish/fish_plugins index 594dfc0..14bdf5f 100644 --- a/config/fish/fish_plugins +++ b/config/fish/fish_plugins @@ -1 +1,3 @@ jorgebucaran/fisher +edc/bass +jorgebucaran/nvm.fish diff --git a/config/fish/fish_variables b/config/fish/fish_variables index 8c2aeb0..c81b026 100644 --- a/config/fish/fish_variables +++ b/config/fish/fish_variables @@ -1,16 +1,18 @@ # This file contains fish universal variable definitions. # VERSION: 3.0 -SETUVAR --export ANDROID_SDK_ROOT:/Users/michi/Library/Android/sdk +SETUVAR --export ANDROID_HOME:/Users/admin/Library/Android/sdk +SETUVAR --export ANDROID_SDK_ROOT:/Users/admin/Library/Android/sdk SETUVAR EDITOR:vim -SETUVAR --export --path GOPATH:/Users/michi/Documents/workspace_go -SETUVAR --export JAVA_HOME:/Library/Internet\x20Plug\x2dIns/JavaAppletPlugin\x2eplugin/Contents/Home +SETUVAR --export --path GOPATH:/Users/admin/Documents/workspace_go +SETUVAR --export JAVA_HOME:/Library/Java/JavaVirtualMachines/jdk\x2d11\x2ejdk/Contents/Home/ SETUVAR --export LANG:en_US\x2eUTF\x2d8 SETUVAR --export LC_ALL:en_US\x2eUTF\x2d8 +SETUVAR XDG_CONFIG_HOME:/Users/admin/\x2econfig SETUVAR __fish_classic_git_prompt_initialized:\x1d SETUVAR __fish_init_2_39_8:\x1d SETUVAR __fish_init_2_3_0:\x1d SETUVAR __fish_init_3_x:\x1d -SETUVAR __fish_initialized:3100 +SETUVAR __fish_initialized:3400 SETUVAR _fish_abbr_bb:brew\x20update\x3b\x20and\x20brew\x20outdated SETUVAR _fish_abbr_bx:bundle\x20exec SETUVAR _fish_abbr_bxrc:bundle\x20exec\x20rails\x20c @@ -38,8 +40,11 @@ SETUVAR _fish_abbr_pg__stop:pg_ctl\x20\x2dD\x20/usr/local/var/postgresql\x4011\x SETUVAR _fish_abbr_tix:cd\x20\x7e/Documents/workspace_tm/amadeus_api/ SETUVAR _fish_abbr_wgo:cd\x20\x7e/Documents/workspace_go/src SETUVAR _fish_abbr_wtm:cd\x20\x7e/Documents/workspace_tm -SETUVAR _fisher_jorgebucaran_2F_fisher_files:/Users/michi/\x2econfig/fish/functions/fisher\x2efish\x1e/Users/michi/\x2econfig/fish/completions/fisher\x2efish -SETUVAR _fisher_plugins:jorgebucaran/fisher +SETUVAR _fisher_edc_2F_bass_files:\x7e/\x2econfig/fish/functions/__bass\x2epy\x1e\x7e/\x2econfig/fish/functions/bass\x2efish +SETUVAR _fisher_jorgebucaran_2F_fisher_files:\x7e/\x2econfig/fish/functions/fisher\x2efish\x1e\x7e/\x2econfig/fish/completions/fisher\x2efish +SETUVAR _fisher_jorgebucaran_2F_nvm_2E_fish_files:\x7e/\x2econfig/fish/functions/_nvm_index_update\x2efish\x1e\x7e/\x2econfig/fish/functions/_nvm_list\x2efish\x1e\x7e/\x2econfig/fish/functions/_nvm_version_activate\x2efish\x1e\x7e/\x2econfig/fish/functions/_nvm_version_deactivate\x2efish\x1e\x7e/\x2econfig/fish/functions/nvm\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/nvm\x2efish\x1e\x7e/\x2econfig/fish/completions/nvm\x2efish +SETUVAR _fisher_plugins:jorgebucaran/fisher\x1eedc/bass\x1ejorgebucaran/nvm\x2efish +SETUVAR _fisher_upgraded_to_4_4:\x1d SETUVAR fish_color_autosuggestion:93a1a1 SETUVAR fish_color_cancel:\x2dr SETUVAR fish_color_command:586e75 @@ -69,5 +74,8 @@ SETUVAR fish_pager_color_completion:\x1d SETUVAR fish_pager_color_description:B3A06D\x1eyellow 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_selected_background:\x2dr SETUVAR fish_user_abbreviations:\x1d -SETUVAR fish_user_paths:/usr/local/opt/postgresql\x409\x2e5/bin\x1e/usr/local/sbin\x1e/Users/michi/\x2efzf/bin +SETUVAR fish_user_paths:/opt/homebrew/opt/postgresql\x4011/bin\x1e/usr/local/opt/imagemagick\x406/bin\x1e/usr/local/opt/postgresql\x4011/bin\x1e/usr/local/sbin\x1e/opt/homebrew/bin\x1e/usr/local/opt/postgresql\x409\x2e5/bin\x1e/Users/michi/\x2efzf/bin\x1e/opt/homebrew/opt/fzf/bin\x1e/Users/admin/\x2efzf/bin +SETUVAR nvm_data:/Users/admin/\x2elocal/share/nvm +SETUVAR nvm_mirror:https\x3a//nodejs\x2eorg/dist diff --git a/config/fish/functions/fisher.fish b/config/fish/functions/fisher.fish index a1fb6cf..c0a86fa 100644 --- a/config/fish/functions/fisher.fish +++ b/config/fish/functions/fisher.fish @@ -1,6 +1,6 @@ function fisher --argument-names cmd --description "A plugin manager for Fish" set --query fisher_path || set --local fisher_path $__fish_config_dir - set --local fisher_version 4.3.0 + set --local fisher_version 4.4.3 set --local fish_plugins $__fish_config_dir/fish_plugins switch "$cmd" @@ -15,6 +15,8 @@ function fisher --argument-names cmd --description "A plugin manager for Fish" echo "Options:" echo " -v or --version Print version" echo " -h or --help Print this help message" + echo "Variables:" + echo " \$fisher_path Plugin installation path. Default: $__fish_config_dir" | string replace --regex -- $HOME \~ case ls list string match --entire --regex -- "$argv[2]" $_fisher_plugins case install update remove @@ -27,17 +29,19 @@ function fisher --argument-names cmd --description "A plugin manager for Fish" set --local old_plugins $_fisher_plugins set --local new_plugins + test -e $fish_plugins && set --local file_plugins (string match --regex -- '^[^\s]+$' <$fish_plugins) + if ! set --query argv[2] if test "$cmd" != update echo "fisher: Not enough arguments for command: \"$cmd\"" >&2 && return 1 - else if test ! -e $fish_plugins + else if ! set --query file_plugins echo "fisher: \"$fish_plugins\" file not found: \"$cmd\"" >&2 && return 1 end - set arg_plugins (string match --regex -- '^[^\s]+$' <$fish_plugins) + set arg_plugins $file_plugins end for plugin in $arg_plugins - test -e "$plugin" && set plugin (realpath $plugin) + set plugin (test -e "$plugin" && realpath $plugin || string lower -- $plugin) contains -- "$plugin" $new_plugins || set --append new_plugins $plugin end @@ -68,30 +72,39 @@ function fisher --argument-names cmd --description "A plugin manager for Fish" set --local pid_list set --local source_plugins set --local fetch_plugins $update_plugins $install_plugins + set --local fish_path (status fish-path) + echo (set_color --bold)fisher $cmd version $fisher_version(set_color normal) for plugin in $fetch_plugins set --local source (command mktemp -d) set --append source_plugins $source - command mkdir -p $source/{completions,conf.d,functions} + command mkdir -p $source/{completions,conf.d,themes,functions} - fish --command " + $fish_path --command " if test -e $plugin command cp -Rf $plugin/* $source else set temp (command mktemp -d) - set name (string split \@ $plugin) || set name[2] HEAD - set url https://codeload.github.com/\$name[1]/tar.gz/\$name[2] + set repo (string split -- \@ $plugin) || set repo[2] HEAD + + if set path (string replace --regex -- '^(https://)?gitlab.com/' '' \$repo[1]) + set name (string split -- / \$path)[-1] + set url https://gitlab.com/\$path/-/archive/\$repo[2]/\$name-\$repo[2].tar.gz + else + set url https://api.github.com/repos/\$repo[1]/tarball/\$repo[2] + end echo Fetching (set_color --underline)\$url(set_color normal) - if curl --silent \$url | tar -xzC \$temp -f - 2>/dev/null + if curl --silent -L \$url | tar -xzC \$temp -f - 2>/dev/null command cp -Rf \$temp/*/* $source else echo fisher: Invalid plugin name or host unavailable: \\\"$plugin\\\" >&2 command rm -rf $source end + command rm -rf \$temp end @@ -121,31 +134,32 @@ function fisher --argument-names cmd --description "A plugin manager for Fish" for name in (string replace --filter --regex -- '.+/conf\.d/([^/]+)\.fish$' '$1' $$plugin_files_var) emit {$name}_uninstall end - printf "%s\n" Removing\ (set_color red --bold)$plugin(set_color normal) " "$$plugin_files_var + printf "%s\n" Removing\ (set_color red --bold)$plugin(set_color normal) " "$$plugin_files_var | string replace -- \~ ~ + set --erase _fisher_plugins[$index] end - command rm -rf $$plugin_files_var + command rm -rf (string replace -- \~ ~ $$plugin_files_var) + functions --erase (string replace --filter --regex -- '.+/functions/([^/]+)\.fish$' '$1' $$plugin_files_var) for name in (string replace --filter --regex -- '.+/completions/([^/]+)\.fish$' '$1' $$plugin_files_var) complete --erase --command $name end - set --erase _fisher_plugins[$index] set --erase $plugin_files_var end end if set --query update_plugins[1] || set --query install_plugins[1] - command mkdir -p $fisher_path/{functions,conf.d,completions} + command mkdir -p $fisher_path/{functions,themes,conf.d,completions} end for plugin in $update_plugins $install_plugins set --local source $source_plugins[(contains --index -- "$plugin" $fetch_plugins)] - set --local files $source/{functions,conf.d,completions}/* + set --local files $source/{functions,themes,conf.d,completions}/* if set --local index (contains --index -- $plugin $install_plugins) - set --local user_files $fisher_path/{functions,conf.d,completions}/* + set --local user_files $fisher_path/{functions,themes,conf.d,completions}/* set --local conflict_files for file in (string replace -- $source/ $fisher_path/ $files) @@ -159,18 +173,19 @@ function fisher --argument-names cmd --description "A plugin manager for Fish" end for file in (string replace -- $source/ "" $files) - command cp -Rf $source/$file $fisher_path/$file + command cp -RLf $source/$file $fisher_path/$file end set --local plugin_files_var _fisher_(string escape --style=var -- $plugin)_files - set --query files[1] && set --universal $plugin_files_var (string replace -- $source $fisher_path $files) + + set --query files[1] && set --universal $plugin_files_var (string replace -- $source $fisher_path $files | string replace -- ~ \~) contains -- $plugin $_fisher_plugins || set --universal --append _fisher_plugins $plugin contains -- $plugin $install_plugins && set --local event install || set --local event update - printf "%s\n" Installing\ (set_color --bold)$plugin(set_color normal) " "$$plugin_files_var + printf "%s\n" Installing\ (set_color --bold)$plugin(set_color normal) " "$$plugin_files_var | string replace -- \~ ~ - for file in (string match --regex -- '.+/[^/]+\.fish$' $$plugin_files_var) + for file in (string match --regex -- '.+/[^/]+\.fish$' $$plugin_files_var | string replace -- \~ ~) source $file if set --local name (string replace --regex -- '.+conf\.d/([^/]+)\.fish$' '$1' $file) emit {$name}_$event @@ -180,12 +195,25 @@ function fisher --argument-names cmd --description "A plugin manager for Fish" command rm -rf $source_plugins - set --query _fisher_plugins[1] || set --erase _fisher_plugins - set --query _fisher_plugins && - printf "%s\n" $_fisher_plugins >$fish_plugins || + if set --query _fisher_plugins[1] + set --local commit_plugins + + for plugin in $file_plugins + contains -- (string lower -- $plugin) (string lower -- $_fisher_plugins) && set --append commit_plugins $plugin + end + + for plugin in $_fisher_plugins + contains -- (string lower -- $plugin) (string lower -- $commit_plugins) || set --append commit_plugins $plugin + end + + printf "%s\n" $commit_plugins >$fish_plugins + else + set --erase _fisher_plugins command rm -f $fish_plugins + end set --local total (count $install_plugins) (count $update_plugins) (count $remove_plugins) + test "$total" != "0 0 0" && echo (string join ", " ( test $total[1] = 0 || echo "Installed $total[1]") ( test $total[2] = 0 || echo "Updated $total[2]") ( @@ -196,14 +224,17 @@ function fisher --argument-names cmd --description "A plugin manager for Fish" end end -## Migrations ## -function _fisher_fish_postexec --on-event fish_postexec +if ! set --query _fisher_upgraded_to_4_4 + set --universal _fisher_upgraded_to_4_4 if functions --query _fisher_list + set --query XDG_DATA_HOME[1] || set --local XDG_DATA_HOME ~/.local/share + command rm -rf $XDG_DATA_HOME/fisher + functions --erase _fisher_{list,plugin_parse} fisher update >/dev/null 2>/dev/null - set --query XDG_DATA_HOME || set --local XDG_DATA_HOME ~/.local/share - test -e $XDG_DATA_HOME/fisher && command rm -rf $XDG_DATA_HOME/fisher - functions --erase _fisher_list _fisher_plugin_parse - set --erase fisher_data + else + for var in (set --names | string match --entire --regex '^_fisher_.+_files$') + set $var (string replace -- ~ \~ $$var) + end + functions --erase _fisher_fish_postexec end - functions --erase _fisher_fish_postexec end diff --git a/config/fish/functions/fzf_key_bindings.fish b/config/fish/functions/fzf_key_bindings.fish index 1cd0480..7f6575c 120000 --- a/config/fish/functions/fzf_key_bindings.fish +++ b/config/fish/functions/fzf_key_bindings.fish @@ -1 +1 @@ -/Users/michi/.fzf/shell/key-bindings.fish \ No newline at end of file +/opt/homebrew/opt/fzf/shell/key-bindings.fish \ No newline at end of file diff --git a/config/fish/functions/kc.fish b/config/fish/functions/kc.fish index 62ba09f..465861a 100644 --- a/config/fish/functions/kc.fish +++ b/config/fish/functions/kc.fish @@ -1,3 +1,11 @@ function kc --description 'switch context to dev, int or prod' - kubectl config use-context aks-$argv + if test "$argv" = "dev" + kubectl config use-context tm-dev-aks-02 + else if test "$argv" = "int" + kubectl config use-context tm-int-aks-02 + else if test "$argv" = "prod" + kubectl config use-context tm-prd-aks-02 + else + kubectl config use-context aks-prod + end end diff --git a/config/fish/functions/nvm.fish b/config/fish/functions/nvm.fish index b21732f..131a030 100644 --- a/config/fish/functions/nvm.fish +++ b/config/fish/functions/nvm.fish @@ -1,3 +1,230 @@ -function nvm - bass source ~/.nvm/nvm.sh --no-use ';' nvm $argv +function nvm --description "Node version manager" + for silent in --silent -s + if set --local index (contains --index -- $silent $argv) + set --erase argv[$index] && break + end + 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 + return 1 + end + end + + set --local their_version $ver + + switch "$cmd" + case -v --version + echo "nvm, version 2.2.11" + case "" -h --help + echo "Usage: nvm install Download and activate the specified Node version" + echo " nvm install Install version from nearest .nvmrc file" + echo " nvm use Activate a version in the current shell" + echo " nvm use Activate version from nearest .nvmrc file" + echo " nvm list List installed versions" + echo " nvm list-remote List versions available to install" + echo " nvm list-remote List versions matching a given regular expression" + echo " nvm current Print the currently-active version" + echo " nvm uninstall Uninstall a version" + echo "Options:" + echo " -s or --silent Suppress standard output" + echo " -v or --version Print version" + echo " -h or --help Print this help message" + echo "Variables:" + echo " nvm_arch Override architecture, e.g. x64-musl" + echo " nvm_mirror Use a mirror of the Node binaries" + echo " nvm_default_version Set the default version for new shells" + echo " nvm_default_packages Install a list of packages every time you install a Node version" + case install + _nvm_index_update + + string match --entire --regex -- (_nvm_version_match $ver) <$nvm_data/.index | read ver alias + + if ! set --query ver[1] + echo "nvm: Invalid version number or alias: \"$their_version\"" >&2 + return 1 + end + + if test ! -e $nvm_data/$ver + set --local os (command uname -s | string lower) + set --local ext tar.gz + set --local arch (command uname -m) + + switch $os + case aix + set arch ppc64 + case sunos + case linux + case darwin + case {MSYS_NT,MINGW\*_NT}\* + set os win + set ext zip + case \* + echo "nvm: Unsupported operating system: \"$os\"" >&2 + return 1 + end + + switch $arch + case i\*86 + set arch x86 + case x86_64 + set arch x64 + case arm64 + string match --regex --quiet "v(?\d+)" $ver + if test "$os" = darwin -a $major -lt 16 + set arch x64 + end + case armv6 armv6l + set arch armv6l + case armv7 armv7l + set arch armv7l + case armv8 armv8l aarch64 + set arch arm64 + end + + set --query nvm_arch && set arch $nvm_arch + + set --local dir "node-$ver-$os-$arch" + set --local url $nvm_mirror/$ver/$dir.$ext + + command mkdir -p $nvm_data/$ver + + if ! set --query silent + echo -e "Installing Node \x1b[1m$ver\x1b[22m $alias" + echo -e "Fetching \x1b[4m$url\x1b[24m\x1b[7m" + end + + if ! command curl $silent --progress-bar --location $url | + command tar --extract --gzip --directory $nvm_data/$ver 2>/dev/null + command rm -rf $nvm_data/$ver + echo -e "\033[F\33[2K\x1b[0mnvm: Invalid mirror or host unavailable: \"$url\"" >&2 + return 1 + end + + set --query silent || echo -en "\033[F\33[2K\x1b[0m" + + if test "$os" = win + command mv $nvm_data/$ver/$dir $nvm_data/$ver/bin + else + command mv $nvm_data/$ver/$dir/* $nvm_data/$ver + command rm -rf $nvm_data/$ver/$dir + end + end + + if test $ver != "$nvm_current_version" + set --query nvm_current_version && _nvm_version_deactivate $nvm_current_version + _nvm_version_activate $ver + + set --query nvm_default_packages[1] && npm install --global $silent $nvm_default_packages + end + + set --query silent || printf "Now using Node %s (npm %s) %s\n" (_nvm_node_info) + case use + test $ver = default && set ver $nvm_default_version + _nvm_list | string match --entire --regex -- (_nvm_version_match $ver) | read ver __ + + if ! set --query ver[1] + echo "nvm: Can't use Node \"$their_version\", version must be installed first" >&2 + return 1 + end + + if test $ver != "$nvm_current_version" + set --query nvm_current_version && _nvm_version_deactivate $nvm_current_version + test $ver != system && _nvm_version_activate $ver + end + + set --query silent || printf "Now using Node %s (npm %s) %s\n" (_nvm_node_info) + case uninstall + if test -z "$ver" + echo "nvm: Not enough arguments for command: \"$cmd\"" >&2 + return 1 + end + + test $ver = default && test ! -z "$nvm_default_version" && set ver $nvm_default_version + + _nvm_list | string match --entire --regex -- (_nvm_version_match $ver) | read ver __ + + if ! set -q ver[1] + echo "nvm: Node version not installed or invalid: \"$their_version\"" >&2 + return 1 + end + + set --query silent || printf "Uninstalling Node %s %s\n" $ver (string replace ~ \~ "$nvm_data/$ver/bin/node") + + _nvm_version_deactivate $ver + + command rm -rf $nvm_data/$ver + case current + _nvm_current + case ls list + _nvm_list | _nvm_list_format (_nvm_current) $argv[2] + case lsr {ls,list}-remote + _nvm_index_update || return + _nvm_list | command awk ' + FILENAME == "-" && (is_local[$1] = FNR == NR) { next } { + print $0 (is_local[$1] ? " ✓" : "") + } + ' - $nvm_data/.index | _nvm_list_format (_nvm_current) $argv[2] + case \* + echo "nvm: Unknown command or option: \"$cmd\" (see nvm -h for usage)" >&2 + return 1 + end +end + +function _nvm_find_up --argument-names path file + test -e "$path/$file" && echo $path/$file || begin + test ! -z "$path" || return + _nvm_find_up (string replace --regex -- '/[^/]*$' "" $path) $file + end +end + +function _nvm_version_match --argument-names ver + string replace --regex -- '^v?(\d+|\d+\.\d+)$' 'v$1.' $ver | + string replace --filter --regex -- '^v?(\d+)' 'v$1' | + string escape --style=regex || + string lower '\b'$ver'(?:/\w+)?$' +end + +function _nvm_list_format --argument-names current regex + command awk -v current="$current" -v regex="$regex" ' + $0 ~ regex { + aliases[versions[i++] = $1] = $2 " " $3 + pad = (n = length($1)) > pad ? n : pad + } + END { + if (!i) exit 1 + while (i--) + printf((current == versions[i] ? " ▶ " : " ") "%"pad"s %s\n", + versions[i], aliases[versions[i]]) + } + ' +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_path (string replace bin/npm-cli.js "" (realpath (command --search npm))) + test -f $npm_path/package.json || set --local npm_version_default (command npm --version) + command node --eval " + console.log(process.version) + console.log('$npm_version_default' ? '$npm_version_default': require('$npm_path/package.json').version) + console.log(process.execPath.replace(require('os').homedir(), '~')) + " end diff --git a/gitconfig b/gitconfig index 2311f2d..bce1475 100644 --- a/gitconfig +++ b/gitconfig @@ -30,3 +30,5 @@ process = git-lfs filter-process required = true clean = git-lfs clean -- %f +[init] + defaultBranch = main diff --git a/make_my_dotfiles.sh b/make_my_dotfiles.sh index 63d95a2..56fdc50 100755 --- a/make_my_dotfiles.sh +++ b/make_my_dotfiles.sh @@ -3,8 +3,8 @@ # some variables _fish_shell="/usr/local/bin/fish" _homebrew=`which brew` -_to_install="the_silver_searcher imagemagick postgresql pgcli rbenv redis ruby-build tmux yasm youtube-dl elixir \ - git git-flow vim fish yarn azure-cli lens openssl fzf kubectl" +_to_install="the_silver_searcher imagemagick postgresql@11 pgcli rbenv redis ruby-build tmux yasm youtube-dl elixir \ + git git-flow vim fish yarn azure-cli openssl fzf kubectl typst" # Generate symlinks for files for i in gemrc gitconfig gitmessage gitignore gvimrc irbrc NERDTreeBookmarks rspec screenrc tmux.conf vimrc rubocop.yml prettierrc diff --git a/settings.json b/settings.json index b503346..5797e87 100644 --- a/settings.json +++ b/settings.json @@ -1,56 +1,55 @@ { - "go.formatTool": "goimports", - "go.useLanguageServer": true, - "editor.fontSize": 16, - "editor.fontFamily": "\"cascadia code\"", - "git.autofetch": true, - "git.autofetchPeriod": 3600, - "git.autoStash": true, - "git.enableCommitSigning": true, - "ruby.format": "rubocop", - "ruby.useBundler": true, - "workbench.enableExperiments": false, - "update.showReleaseNotes": false, - "files.trimTrailingWhitespace": true, - "extensions.ignoreRecommendations": false, - "explorer.confirmDragAndDrop": false, - "editor.tabSize": 2, - "javascript.updateImportsOnFileMove.enabled": "always", - "scm.defaultViewMode": "tree", - "todo-tree.general.tags": [ - "BUG", - "HACK", - "FIXME", - "TODO", - "XXX", - "[ ]", - "[x]" - ], - "todo-tree.regex.regex": "(//|#|