more updates

This commit is contained in:
2024-01-26 10:30:08 +01:00
parent ba4ec367ab
commit 2028b178e1
15 changed files with 372 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
complete --command nvm --exclusive
complete --command nvm --exclusive --long version --description "Print version"
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 use --description "Activate a 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-remote --description "List versions available to install matching optional regex"
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments current --description "Print the currently-active version"
complete --command nvm --exclusive --condition "__fish_seen_subcommand_from install" --arguments "(
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_use_subcommand --arguments uninstall --description "Uninstall a version"
complete --command nvm --exclusive --condition "__fish_seen_subcommand_from uninstall" --arguments "(
_nvm_list | string split ' ' | string replace system ''
)"
complete --command nvm --exclusive --condition "__fish_seen_subcommand_from use uninstall" --arguments "(
set --query nvm_default_version && echo default
)"

View File

@@ -0,0 +1,28 @@
function _nvm_install --on-event nvm_install
set --query nvm_mirror || set --universal nvm_mirror https://nodejs.org/dist
set --query XDG_DATA_HOME || set --local XDG_DATA_HOME ~/.local/share
set --universal nvm_data $XDG_DATA_HOME/nvm
test ! -d $nvm_data && command mkdir -p $nvm_data
echo "Downloading the Node distribution index..." 2>/dev/null
_nvm_index_update
end
function _nvm_update --on-event nvm_update
set --query nvm_mirror || set --universal nvm_mirror https://nodejs.org/dist
set --query XDG_DATA_HOME || set --local XDG_DATA_HOME ~/.local/share
set --universal nvm_data $XDG_DATA_HOME/nvm
end
function _nvm_uninstall --on-event 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_")
end
if status is-interactive && set --query nvm_default_version && ! set --query nvm_current_version
nvm use --silent $nvm_default_version
end

View File

@@ -0,0 +1,138 @@
"""
To be used with a companion fish function like this:
function refish
set -l _x (python /tmp/bass.py source ~/.nvm/nvim.sh ';' nvm use iojs); source $_x; and rm -f $_x
end
"""
from __future__ import print_function
import json
import os
import signal
import subprocess
import sys
import traceback
BASH = 'bash'
FISH_READONLY = [
'PWD', 'SHLVL', 'history', 'pipestatus', 'status', 'version',
'FISH_VERSION', 'fish_pid', 'hostname', '_', 'fish_private_mode'
]
IGNORED = [
'PS1', 'XPC_SERVICE_NAME'
]
def ignored(name):
if name == 'PWD': # this is read only, but has special handling
return False
# ignore other read only variables
if name in FISH_READONLY:
return True
if name in IGNORED or name.startswith("BASH_FUNC"):
return True
return False
def escape(string):
# use json.dumps to reliably escape quotes and backslashes
return json.dumps(string).replace(r'$', r'\$')
def escape_identifier(word):
return escape(word.replace('?', '\\?'))
def comment(string):
return '\n'.join(['# ' + line for line in string.split('\n')])
def gen_script():
# Use the following instead of /usr/bin/env to read environment so we can
# deal with multi-line environment variables (and other odd cases).
env_reader = "%s -c 'import os,json; print(json.dumps({k:v for k,v in os.environ.items()}))'" % (sys.executable)
args = [BASH, '-c', env_reader]
output = subprocess.check_output(args, universal_newlines=True)
old_env = output.strip()
pipe_r, pipe_w = os.pipe()
if sys.version_info >= (3, 4):
os.set_inheritable(pipe_w, True)
command = 'eval $1 && ({}; alias) >&{}'.format(
env_reader,
pipe_w
)
args = [BASH, '-c', command, 'bass', ' '.join(sys.argv[1:])]
p = subprocess.Popen(args, universal_newlines=True, close_fds=False)
os.close(pipe_w)
with os.fdopen(pipe_r) as f:
new_env = f.readline()
alias_str = f.read()
if p.wait() != 0:
raise subprocess.CalledProcessError(
returncode=p.returncode,
cmd=' '.join(sys.argv[1:]),
output=new_env + alias_str
)
new_env = new_env.strip()
old_env = json.loads(old_env)
new_env = json.loads(new_env)
script_lines = []
for k, v in new_env.items():
if ignored(k):
continue
v1 = old_env.get(k)
if not v1:
script_lines.append(comment('adding %s=%s' % (k, v)))
elif v1 != v:
script_lines.append(comment('updating %s=%s -> %s' % (k, v1, v)))
# process special variables
if k == 'PWD':
script_lines.append('cd %s' % escape(v))
continue
else:
continue
if k == 'PATH':
value = ' '.join([escape(directory)
for directory in v.split(':')])
else:
value = escape(v)
script_lines.append('set -g -x %s %s' % (k, value))
for var in set(old_env.keys()) - set(new_env.keys()):
script_lines.append(comment('removing %s' % var))
script_lines.append('set -e %s' % var)
script = '\n'.join(script_lines)
alias_lines = []
for line in alias_str.splitlines():
_, rest = line.split(None, 1)
k, v = rest.split("=", 1)
alias_lines.append("alias " + escape_identifier(k) + "=" + v)
alias = '\n'.join(alias_lines)
return script + '\n' + alias
script_file = os.fdopen(3, 'w')
if not sys.argv[1:]:
print('__bass_usage', file=script_file, end='')
sys.exit(0)
try:
script = gen_script()
except subprocess.CalledProcessError as e:
sys.exit(e.returncode)
except Exception:
print('Bass internal error!', file=sys.stderr)
raise # traceback will output to stderr
except KeyboardInterrupt:
signal.signal(signal.SIGINT, signal.SIG_DFL)
os.kill(os.getpid(), signal.SIGINT)
else:
script_file.write(script)

View File

@@ -0,0 +1,20 @@
function _nvm_index_update
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
echo "nvm: Can't update index, host unavailable: \"$nvm_mirror\"" >&2
return 1
end
command awk -v OFS=\t '
/v0.9.12/ { exit } # Unsupported
NR > 1 {
print $1 (NR == 2 ? " latest" : $10 != "-" ? " lts/" tolower($10) : "")
}
' $index.temp >$index
command rm -f $index.temp
end

View File

@@ -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

View File

@@ -0,0 +1,4 @@
function _nvm_version_activate --argument-names ver
set --global --export nvm_current_version $ver
set --prepend PATH $nvm_data/$ver/bin
end

View File

@@ -0,0 +1,5 @@
function _nvm_version_deactivate --argument-names ver
test "$nvm_current_version" = "$ver" && set --erase nvm_current_version
set --local index (contains --index -- $nvm_data/$ver/bin $PATH) &&
set --erase PATH[$index]
end

View File

@@ -0,0 +1,29 @@
function bass
set -l bash_args $argv
set -l bass_debug
if test "$bash_args[1]_" = '-d_'
set bass_debug true
set -e bash_args[1]
end
set -l script_file (mktemp)
if command -v python3 >/dev/null 2>&1
command python3 -sS (dirname (status -f))/__bass.py $bash_args 3>$script_file
else
command python -sS (dirname (status -f))/__bass.py $bash_args 3>$script_file
end
set -l bass_status $status
if test $bass_status -ne 0
return $bass_status
end
if test -n "$bass_debug"
cat $script_file
end
source $script_file
command rm $script_file
end
function __bass_usage
echo "Usage: bass [-d] <bash-command>"
end

Submodule config/typst/packages/local/lttr/0.1.0 added at ac86c0b509

79
config/zed/.tmp1ATCuE Normal file
View File

@@ -0,0 +1,79 @@
{"signed_in":false,"type":"Setting","setting":"theme","value":"One Dark","milliseconds_since_first_event":0}
{"signed_in":false,"type":"Setting","setting":"keymap","value":"VSCode","milliseconds_since_first_event":0}
{"signed_in":false,"type":"App","operation":"first open","milliseconds_since_first_event":0}
{"signed_in":false,"type":"App","operation":"open project","milliseconds_since_first_event":0}
{"signed_in":false,"type":"App","operation":"welcome page: close","milliseconds_since_first_event":15472}
{"signed_in":false,"type":"Editor","operation":"open","file_extension":"js","vim_mode":false,"copilot_enabled":true,"copilot_enabled_for_language":true,"milliseconds_since_first_event":20405}
{"signed_in":false,"type":"Editor","operation":"open","file_extension":"rb","vim_mode":false,"copilot_enabled":true,"copilot_enabled_for_language":true,"milliseconds_since_first_event":23710}
{"signed_in":false,"type":"Editor","operation":"open","file_extension":"rb","vim_mode":false,"copilot_enabled":true,"copilot_enabled_for_language":true,"milliseconds_since_first_event":26508}
{"signed_in":true,"type":"Editor","operation":"open","file_extension":"json","vim_mode":false,"copilot_enabled":true,"copilot_enabled_for_language":true,"milliseconds_since_first_event":50706}
{"signed_in":true,"type":"Call","operation":"accept incoming","room_id":206704,"channel_id":null,"milliseconds_since_first_event":81586}
{"signed_in":true,"type":"Editor","operation":"open","file_extension":"config","vim_mode":false,"copilot_enabled":true,"copilot_enabled_for_language":true,"milliseconds_since_first_event":82311}
{"signed_in":true,"type":"Editor","operation":"open","file_extension":"properties","vim_mode":false,"copilot_enabled":true,"copilot_enabled_for_language":true,"milliseconds_since_first_event":82331}
{"signed_in":true,"type":"Editor","operation":"open","file_extension":"yaml","vim_mode":false,"copilot_enabled":true,"copilot_enabled_for_language":true,"milliseconds_since_first_event":82347}
{"signed_in":true,"type":"Editor","operation":"open","file_extension":"gradle","vim_mode":false,"copilot_enabled":true,"copilot_enabled_for_language":true,"milliseconds_since_first_event":82366}
{"signed_in":true,"type":"Editor","operation":"open","file_extension":null,"vim_mode":false,"copilot_enabled":true,"copilot_enabled_for_language":true,"milliseconds_since_first_event":82428}
{"signed_in":true,"type":"Call","operation":"disable microphone","room_id":206704,"channel_id":null,"milliseconds_since_first_event":94145}
{"signed_in":true,"type":"Editor","operation":"open","file_extension":"yaml","vim_mode":false,"copilot_enabled":true,"copilot_enabled_for_language":true,"milliseconds_since_first_event":129611}
{"signed_in":true,"type":"Editor","operation":"open","file_extension":"java","vim_mode":false,"copilot_enabled":true,"copilot_enabled_for_language":true,"milliseconds_since_first_event":150028}
{"signed_in":true,"type":"Editor","operation":"open","file_extension":"java","vim_mode":false,"copilot_enabled":true,"copilot_enabled_for_language":true,"milliseconds_since_first_event":182461}
{"signed_in":true,"type":"Editor","operation":"open","file_extension":"java","vim_mode":false,"copilot_enabled":true,"copilot_enabled_for_language":true,"milliseconds_since_first_event":183369}
{"signed_in":true,"type":"Editor","operation":"open","file_extension":"json","vim_mode":false,"copilot_enabled":true,"copilot_enabled_for_language":true,"milliseconds_since_first_event":188335}
{"signed_in":true,"type":"Call","operation":"hang up","room_id":206704,"channel_id":null,"milliseconds_since_first_event":211202}
{"signed_in":true,"type":"Editor","operation":"open","file_extension":"rb","vim_mode":false,"copilot_enabled":true,"copilot_enabled_for_language":true,"milliseconds_since_first_event":219994}
{"signed_in":true,"type":"Editor","operation":"open","file_extension":"rb","vim_mode":false,"copilot_enabled":true,"copilot_enabled_for_language":true,"milliseconds_since_first_event":221460}
{"signed_in":true,"type":"Editor","operation":"open","file_extension":"rb","vim_mode":false,"copilot_enabled":true,"copilot_enabled_for_language":true,"milliseconds_since_first_event":222081}
{"signed_in":true,"type":"Memory","memory_in_bytes":303874048,"virtual_memory_in_bytes":421287198720,"milliseconds_since_first_event":236172}
{"signed_in":true,"type":"Cpu","usage_as_percentage":8.611634,"core_count":10,"milliseconds_since_first_event":236172}
{"signed_in":true,"type":"Edit","duration":32186,"environment":"editor","milliseconds_since_first_event":0}
{"signed_in":true,"type":"Editor","operation":"open","file_extension":"rb","vim_mode":false,"copilot_enabled":true,"copilot_enabled_for_language":true,"milliseconds_since_first_event":12919}
{"signed_in":true,"type":"Editor","operation":"open","file_extension":"rb","vim_mode":false,"copilot_enabled":true,"copilot_enabled_for_language":true,"milliseconds_since_first_event":12919}
{"signed_in":true,"type":"Editor","operation":"open","file_extension":"rb","vim_mode":false,"copilot_enabled":true,"copilot_enabled_for_language":true,"milliseconds_since_first_event":12923}
{"signed_in":true,"type":"Editor","operation":"open","file_extension":"rb","vim_mode":false,"copilot_enabled":true,"copilot_enabled_for_language":true,"milliseconds_since_first_event":12923}
{"signed_in":true,"type":"Editor","operation":"open","file_extension":"rb","vim_mode":false,"copilot_enabled":true,"copilot_enabled_for_language":true,"milliseconds_since_first_event":12923}
{"signed_in":true,"type":"Editor","operation":"open","file_extension":null,"vim_mode":false,"copilot_enabled":true,"copilot_enabled_for_language":true,"milliseconds_since_first_event":147553}
{"signed_in":true,"type":"App","operation":"project diagnostics: open","milliseconds_since_first_event":147554}
{"signed_in":true,"type":"Memory","memory_in_bytes":380108800,"virtual_memory_in_bytes":421215223808,"milliseconds_since_first_event":175203}
{"signed_in":true,"type":"Cpu","usage_as_percentage":4.8547387,"core_count":10,"milliseconds_since_first_event":175203}
{"signed_in":true,"type":"Editor","operation":"open","file_extension":"json","vim_mode":false,"copilot_enabled":true,"copilot_enabled_for_language":true,"milliseconds_since_first_event":190473}
{"signed_in":true,"type":"Editor","operation":"open","file_extension":null,"vim_mode":false,"copilot_enabled":true,"copilot_enabled_for_language":true,"milliseconds_since_first_event":196755}
{"signed_in":true,"type":"Edit","duration":2353,"environment":"terminal","milliseconds_since_first_event":212271}
{"signed_in":true,"type":"Editor","operation":"open","file_extension":"json","vim_mode":false,"copilot_enabled":true,"copilot_enabled_for_language":true,"milliseconds_since_first_event":229450}
{"signed_in":true,"type":"Edit","duration":2740,"environment":"editor","milliseconds_since_first_event":254961}
{"signed_in":true,"type":"Editor","operation":"save","file_extension":"json","vim_mode":false,"copilot_enabled":true,"copilot_enabled_for_language":true,"milliseconds_since_first_event":259078}
{"signed_in":true,"type":"Editor","operation":"save","file_extension":"json","vim_mode":false,"copilot_enabled":false,"copilot_enabled_for_language":true,"milliseconds_since_first_event":284037}
{"signed_in":true,"type":"Editor","operation":"save","file_extension":"json","vim_mode":false,"copilot_enabled":false,"copilot_enabled_for_language":true,"milliseconds_since_first_event":0}
{"signed_in":true,"type":"Editor","operation":"save","file_extension":"json","vim_mode":true,"copilot_enabled":false,"copilot_enabled_for_language":true,"milliseconds_since_first_event":4482}
{"signed_in":true,"type":"Edit","duration":52591,"environment":"editor","milliseconds_since_first_event":25852}
{"signed_in":true,"type":"Action","source":"command palette","action":":write","milliseconds_since_first_event":34927}
{"signed_in":true,"type":"Editor","operation":"save","file_extension":"json","vim_mode":true,"copilot_enabled":false,"copilot_enabled_for_language":true,"milliseconds_since_first_event":34942}
{"signed_in":true,"type":"Edit","duration":7427,"environment":"editor","milliseconds_since_first_event":72766}
{"signed_in":true,"type":"Action","source":"command palette","action":":write","milliseconds_since_first_event":77482}
{"signed_in":true,"type":"Editor","operation":"save","file_extension":"json","vim_mode":true,"copilot_enabled":false,"copilot_enabled_for_language":true,"milliseconds_since_first_event":77500}
{"signed_in":true,"type":"Editor","operation":"save","file_extension":"json","vim_mode":true,"copilot_enabled":false,"copilot_enabled_for_language":false,"milliseconds_since_first_event":78123}
{"signed_in":true,"type":"Memory","memory_in_bytes":400998400,"virtual_memory_in_bytes":421232656384,"milliseconds_since_first_event":111447}
{"signed_in":true,"type":"Cpu","usage_as_percentage":6.7091107,"core_count":10,"milliseconds_since_first_event":111447}
{"signed_in":true,"type":"Edit","duration":3213,"environment":"editor","milliseconds_since_first_event":237006}
{"signed_in":true,"type":"Editor","operation":"save","file_extension":"json","vim_mode":true,"copilot_enabled":false,"copilot_enabled_for_language":false,"milliseconds_since_first_event":242522}
{"signed_in":true,"type":"Action","source":"command palette","action":":write","milliseconds_since_first_event":245645}
{"signed_in":true,"type":"Editor","operation":"save","file_extension":"json","vim_mode":true,"copilot_enabled":false,"copilot_enabled_for_language":false,"milliseconds_since_first_event":245668}
{"signed_in":true,"type":"Edit","duration":4938,"environment":"editor","milliseconds_since_first_event":0}
{"signed_in":true,"type":"Action","source":"command palette","action":":write","milliseconds_since_first_event":10319}
{"signed_in":true,"type":"Editor","operation":"save","file_extension":"json","vim_mode":true,"copilot_enabled":false,"copilot_enabled_for_language":false,"milliseconds_since_first_event":10339}
{"signed_in":true,"type":"Edit","duration":7124,"environment":"editor","milliseconds_since_first_event":44570}
{"signed_in":true,"type":"Memory","memory_in_bytes":409436160,"virtual_memory_in_bytes":421235834880,"milliseconds_since_first_event":49565}
{"signed_in":true,"type":"Cpu","usage_as_percentage":7.526642,"core_count":10,"milliseconds_since_first_event":49565}
{"signed_in":true,"type":"Editor","operation":"save","file_extension":"json","vim_mode":true,"copilot_enabled":false,"copilot_enabled_for_language":false,"milliseconds_since_first_event":53401}
{"signed_in":true,"type":"Edit","duration":7828,"environment":"editor","milliseconds_since_first_event":75226}
{"signed_in":true,"type":"Editor","operation":"save","file_extension":"json","vim_mode":true,"copilot_enabled":false,"copilot_enabled_for_language":false,"milliseconds_since_first_event":110004}
{"signed_in":true,"type":"Edit","duration":33658,"environment":"editor","milliseconds_since_first_event":183643}
{"signed_in":true,"type":"Action","source":"command palette","action":":write","milliseconds_since_first_event":191298}
{"signed_in":true,"type":"Editor","operation":"save","file_extension":"json","vim_mode":true,"copilot_enabled":false,"copilot_enabled_for_language":false,"milliseconds_since_first_event":191299}
{"signed_in":true,"type":"Edit","duration":5516,"environment":"editor","milliseconds_since_first_event":210028}
{"signed_in":true,"type":"Action","source":"command palette","action":":write","milliseconds_since_first_event":214996}
{"signed_in":true,"type":"Editor","operation":"save","file_extension":"json","vim_mode":true,"copilot_enabled":false,"copilot_enabled_for_language":false,"milliseconds_since_first_event":215019}
{"signed_in":true,"type":"Editor","operation":"save","file_extension":"json","vim_mode":true,"copilot_enabled":false,"copilot_enabled_for_language":false,"milliseconds_since_first_event":218892}
{"signed_in":true,"type":"Action","source":"command palette","action":":write","milliseconds_since_first_event":240247}
{"signed_in":true,"type":"Editor","operation":"save","file_extension":"json","vim_mode":true,"copilot_enabled":false,"copilot_enabled_for_language":false,"milliseconds_since_first_event":240276}
{"signed_in":true,"type":"Action","source":"command palette","action":":write","milliseconds_since_first_event":243193}
{"signed_in":true,"type":"Editor","operation":"save","file_extension":"json","vim_mode":true,"copilot_enabled":false,"copilot_enabled_for_language":false,"milliseconds_since_first_event":243219}

Binary file not shown.

Binary file not shown.

Binary file not shown.

0
config/zed/keymap.json Normal file
View File

36
config/zed/settings.json Normal file
View File

@@ -0,0 +1,36 @@
// Zed settings
//
// For information on how to configure Zed, see the Zed
// documentation: https://zed.dev/docs/configuring-zed
//
// To see all of Zed's default settings without changing your
// custom settings, run the `open default settings` command
// from the command palette or from `Zed` application menu.
{
"project_panel": {
"dock": "right"
},
"ui_font_size": 18,
"buffer_font_size": 16,
"features": {
"copilot": false
},
"vim_mode": true,
"confirm_quit": true,
"show_copilot_suggestions": false,
"dock": "right",
"assistant": {
"button": false
},
"tabs": {
"git_status": true
},
// WATCH OUT FOR THIS!!!!!
"remove_trailing_whitespace_on_save": true,
"preferred_line_length": 120,
"tab_size": 2,
"telemetry": {
"diagnostics": false,
"metrics": false
}
}