repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

nushell; update to 0.94 and clean up of config

664b9cbf86d11e6922caa272c1f432000d7eaaa6

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (37)

+596 / −651 text lines · all files grouped into 32 bars

Diff layout

cargo/config.toml

Modified

+1 / −0 text lines

11[build]
22# since we only care for builds for our own machine, let's benefit from thise juicy modern cpu features
33rustflags = ["-C", "target-cpu=native"]
4jobs = 8
56# let's have some fun with "omgz performance rice dat cake"
67# aaand we get out of memory errors when building nu...

fedora.symlinks

Modified

+7 / −4 text lines

3131nushell/env.nu
3232~/.config/nushell/env.nu
34nushell/modules
35~/.config/nushell/modules
34nushell/login.nu
35~/.config/nushell/login.nu
37nushell/plugin.nu
38~/.config/nushell/plugin.nu
37nushell/gen-aliases.nu
38~/.config/nushell/gen-aliases.nu
40nushell/scripts
41~/.config/nushell/scripts
4043topgrade/topgrade.linux.toml
4144~/.config/topgrade.toml

justfile

Modified

+3 / −0 text lines

2727# link dorkfiles into HOME
2828link:
2929 java bootstripper.java
31tools:
32 cd tools;java install.java

neovim/lazy-lock.json

Modified

+7 / −7 text lines

1818 "glow.nvim": { "branch": "main", "commit": "238070a686c1da3bccccf1079700eb4b5e19aea4" },
1919 "heirline.nvim": { "branch": "master", "commit": "0d797435e54645a5f98bad7ad6046aac1ef95c1e" },
2020 "indent-blankline.nvim": { "branch": "master", "commit": "d98f537c3492e87b6dc6c2e3f66ac517528f406f" },
21 "lazy.nvim": { "branch": "main", "commit": "24fa2a97085ca8a7220b5b078916f81e316036fd" },
21 "lazy.nvim": { "branch": "main", "commit": "eab487c2520f0fe9e54eb5e3ea0606e20512492e" },
2222 "lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" },
2323 "mini.bracketed": { "branch": "main", "commit": "06ad08fc75dc540cba76d3d8de0f2dc9f75b5812" },
2424 "mini.bufremove": { "branch": "main", "commit": "e6044aa28e61d4dd9ec86194d6f81743eced0c1c" },
2929 "nui.nvim": { "branch": "main", "commit": "b1b3dcd6ed8f355c78bad3d395ff645be5f8b6ae" },
3030 "nvim-autopairs": { "branch": "master", "commit": "c15de7e7981f1111642e7e53799e1211d4606cb9" },
3131 "nvim-cmp": { "branch": "main", "commit": "5260e5e8ecadaf13e6b82cf867a909f54e15fd07" },
32 "nvim-genghis": { "branch": "main", "commit": "7ed82d0d0513946bbc678f326e5750c79a942351" },
32 "nvim-genghis": { "branch": "main", "commit": "6c3a123dcd355a33f5dd624b0a841e8f88c11f8d" },
3333 "nvim-gomove": { "branch": "main", "commit": "2b44ae7ac0804f4e3959228122f7c85bef1964e3" },
3434 "nvim-lastplace": { "branch": "main", "commit": "0bb6103c506315044872e0f84b1f736c4172bb20" },
35 "nvim-lint": { "branch": "master", "commit": "e19842a05aae484957ad20710444757bc0a61d63" },
35 "nvim-lint": { "branch": "master", "commit": "2f90fe977ef21db3bf3b7a1ceaf4a1e3aafb2b26" },
3636 "nvim-lsp-file-operations": { "branch": "master", "commit": "223aca86b737dc66e9c51ebcda8788a8d9cc6cf2" },
3737 "nvim-navbuddy": { "branch": "master", "commit": "f22bac988f2dd073601d75ba39ea5636ab6e38cb" },
3838 "nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" },
3939 "nvim-neoclip.lua": { "branch": "main", "commit": "9b02a625dfa22499089458554be86171a1dfe8b1" },
4040 "nvim-spectre": { "branch": "master", "commit": "366f46fdd4a1593cc237aea13d5ef113739a472c" },
41 "nvim-surround": { "branch": "main", "commit": "fa5b365e847909df35cea184e13b7b811f346cda" },
41 "nvim-surround": { "branch": "main", "commit": "f1f0699a1d49f28e607ffa4361f1bbe757ac5ebc" },
4242 "nvim-tree.lua": { "branch": "master", "commit": "2bc725a3ebc23f0172fb0ab4d1134b81bcc13812" },
43 "nvim-treesitter": { "branch": "master", "commit": "5c924407cf110e9da4f3ba02ffed127b4198ad89" },
43 "nvim-treesitter": { "branch": "master", "commit": "979beffc1a86e7ba19bd6535c0370d8e1aaaad3c" },
4444 "nvim-treesitter-context": { "branch": "master", "commit": "f62bfe19e0fbc13ae95649dfb3cf22f4ff85b683" },
4545 "nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" },
46 "nvim-treesitter-textobjects": { "branch": "master", "commit": "3557e41418b4a6c5b85d5d64abe94c9c50fa9b14" },
46 "nvim-treesitter-textobjects": { "branch": "master", "commit": "fd41b7ccc5490a3a99c734d1ee418b68d06c48a9" },
4747 "nvim-ts-autotag": { "branch": "main", "commit": "bcf3146864262ef2d3c877beba3e222b5c73780d" },
4848 "nvim-ts-context-commentstring": { "branch": "main", "commit": "cb064386e667def1d241317deed9fd1b38f0dc2e" },
4949 "nvim-web-devicons": { "branch": "master", "commit": "b77921fdc44833c994fdb389d658ccbce5490c16" },
7373 "vim-startuptime": { "branch": "master", "commit": "ac2cccb5be617672add1f4f3c0a55ce99ba34e01" },
7474 "vim-vscode-snippets": { "branch": "master", "commit": "812e60d1c648f889328761ec71daff09d1eb3177" },
7575 "virt-column.nvim": { "branch": "master", "commit": "b62b4ef0774d19452d4ed18e473e824c7a756f2f" },
76 "which-key.nvim": { "branch": "main", "commit": "ce741eb559c924d72e3a67d2189ad3771a231414" },
76 "which-key.nvim": { "branch": "main", "commit": "4b7167f8fb2dba3d01980735e3509e172c024c29" },
7777 "zen-mode.nvim": { "branch": "main", "commit": "78557d972b4bfbb7488e17b5703d25164ae64e6a" }
7878}No final newline

neovim/puck.lua

Modified

+32 / −15 text lines

2626 return vim.fs.basename(plugin_coords):gsub( '(%w+)%.?%w*', '%1' )
2727end
29local download_plugin_into = function ( plugin_tarball_url, plugin_install_path )
29local download_plugin_into = function ( plugin_name, plugin_tarball_url, plugin_install_path )
3131 assert(vim.fn.executable 'curl', 'curl not found')
3232 assert(vim.fn.executable 'tar', 'tar not found')
34 vim.fn.mkdir( plugin_install_path, 'p' )
34 local tmp_dir = vim.uv.fs_mkdtemp(vim.fs.joinpath(vim.uv.os_tmpdir(),'puck_tmp_install_path_XXXXXX'))
35 -- vim.fn.mkdir( plugin_install_path, 'p' )
3637 local tarball_data_stream = vim.uv.new_pipe(true)
3738 local error_stream = vim.uv.new_pipe()
4445 local curl_handle, curl_pid = vim.uv.spawn( 'curl',
4546 {
4647 args = { '--silent', '--location', plugin_tarball_url },
47 cwd = plugin_install_path,
48 cwd = tmp_dir,
4849 stdio = {nil, tarball_data_stream, error_stream},
4950 hide = true,
50 },
51 function(code, signal)
52 vim.print('curl done', code, signal)
53 end )
51 })
52 -- function(code, signal)
53 -- --TODO: error handle
54 -- vim.print('curl done', code, signal)
55 -- end )
5456 local tar_handle, tar_pid = vim.uv.spawn( 'tar',
5557 {
5658 args = { '--extract','--gzip', '--file', '-' },
57 cwd = plugin_install_path,
59 cwd = tmp_dir,
5860 stdio = { tarball_data_stream, nil, error_stream},
5961 hide = true,
60 },
61 function(code, signal)
62 vim.print('tar done', code, signal)
63 end )
62 })
63 -- function(code, signal)
64 -- --TODO: error handle
65 -- vim.print('tar done', code, signal)
66 --
67 -- -- move from tmp_dir to install_dir
68 --
69 -- end )
65 print(curl_handle, curl_handle, tar_handle, tar_pid)
71 vim.print(tmp_dir)
72 local extracted_dir = vim.fs.find(
73 function(name, path) return name:find(plugin_name,0,true) end,
74 { path = tmp_dir, type = 'directory', limit = 1 }
75 )
76 vim.print(vim.inspect(extracted_dir))
77 assert(#extracted_dir ~= 0, 'No directory was found in tarball')
78 assert(#extracted_dir == 1, 'Too many directories were found in tarball. Expected one!')
79 -- the libuv way of getting files accross partitions is PITA
80 local ok = vim.fn.rename(extracted_dir[1], plugin_install_path)
81 vim.print(ok)
82 assert(ok, string.format('Failed to move extracted plugin from %s to %s.', extracted_dir[1], plugin_install_path))
6784 vim.uv.shutdown(tarball_data_stream, function()
6885 vim.uv.close(curl_handle, function()
113130local install_plugin = function ( puck_root, plugin_type, plugin_coords, plugin_rev )
114131 local plugin_name = as_name( plugin_coords )
115 local plugin_install_path = vim.fs.normalize( vim.fs.joinpath( puck_root, plugin_name ) ) --TODO unused?
132 local plugin_install_path = vim.fs.normalize( vim.fs.joinpath( puck_root, plugin_name ) )
116133 local plugin_install_path_stat = vim.uv.fs_stat( plugin_install_path )
117134 local plugin_already_exists = plugin_install_path_stat and plugin_install_path_stat.type == 'directory'
130147 local removed = delete_directory_recursive( plugin_install_path )
131148 local url_format = as_url_format(plugin_type)
132149 local plugin_tarball_url = url_format:format( plugin_coords, plugin_rev )
133 local ok = pcall( download_plugin_into, plugin_tarball_url, puck_root )
150 local ok = pcall( download_plugin_into, plugin_name, plugin_tarball_url, plugin_install_path )
134151 if ok then
135152 local mode = vim.uv.fs_access(plugin_install_rev_path, 'W') and 'w+' or 'w'
136153 local plugin_install_rev_file = io.open( plugin_install_rev_path, mode)

nushell/completions/svn-completions.nu

Deleted
deleted file mode 100644

+0 / −137 text lines

1def "complete svn subcommands" [] {
2 ^svn help
3 | lines
4 | skip until { | line | $line | str starts-with "Available subcommands:" }
5 | skip 1
6 | each { |line| $line | str trim }
7 | take until { |line| $line | empty? }
8 | split column " "
9 | get column1
10}
12# TODO: parse xml output
14def "complete svn add paths" [] {
15 ^svn status --depth infinity
16 | lines
17 | parse "{mode} {file}"
18 | str trim
19 | where mode == ?
20 | get file
21}
23def "complete svn revert paths" [] {
24 ^svn status --depth infinity
25 | lines
26 | parse "{mode} {file}"
27 | where mode == M
28 | str trim
29 | get file
30}
32def "complete svn depth" [] { ['empty', 'files', 'immediates', 'infinity'] }
34def "complete svn changelists" [] {
35 ^svn status --depth infinity
36 | lines
37 | parse "--- Changelist '{changelist}':"
38 | get --ignore-errors changelist
39}
41# FIXME: This is commented out in order to leave unexterne'd commands be.
42#
43# Subversion is a tool for version control.
44# For additional information, see http://subversion.apache.org/
45#export extern svn [
46 #subcommand?: string@"complete svn subcommands" # for help on a specific subcommand.
47 #--version # to see the program version and RA modules
48 #--quiet # to see just the version number
49 #--verbose # to see dependency versions as well
50#]
52# help (?, h): Describe the usage of this program or its subcommands.
53# usage: help [SUBCOMMAND...]
54export extern "svn help" [
55 subcommand?: string@"complete svn subcommands" # for help on a specific subcommand.
56 --verbose(-v) # also show experimental subcommands and options
57]
59# FIXME:
60# SVN has short options with double dashes: --changelist(--cl).
61# This is not allowed in nu.
63# FIXME:
64# Multiline doccomments will be rendered without the newlines.
66# Print the status of working copy files and directories.
67export extern "svn status" [
68 ...paths: path # PATHs
69 --show-updates(-u) # display update information
70 --verbose(-v) # print extra information
71 --depth: string@"complete svn depth" # limit operation by depth ARG ('empty', 'files', 'immediates', or 'infinity')
72 --revision(-r): string # ARG (some commands also take ARG1:ARG2 range)
73 # A revision argument can be one of:
74 # NUMBER revision number
75 # '{' DATE '}' revision at start of the date
76 # 'HEAD' latest in repository
77 # 'BASE' base rev of item's working copy
78 # 'COMMITTED' last commit at or before BASE
79 # 'PREV' revision just before COMMITTED
80 --quiet(-q) # don't print unversioned items
81 --no-ignore # disregard default and svn:ignore and svn:global-ignores property ignores
82 --incremental # give output suitable for concatenation
83 --xml # output in XML
84 --ignore-externals # ignore externals definitions
85 --changelist:string@"complete svn changelists" # operate only on members of changelist ARG
86]
88# FIXME: https://github.com/nushell/nushell/issues/5012
89# rest parameters do not play well with completions yet
90# the `paths` parameter should be `...paths`
92# Put new files and directories under version control.
93export extern "svn add" [
94 paths: path@"complete svn add paths" # unversioned PATHs for addition
95 --targets: path # pass contents of file ARG as additional args
96 --non-recursive(-N) # obsolete; same as --depth=empty
97 --depth: string@"complete svn depth" # limit operation by depth ARG ('empty', 'files', 'immediates', or 'infinity')
98 --quiet(-q) # print nothing, or only summary information
99 --force # ignore already versioned paths
100 --no-ignore # disregard default and svn:ignore and svn:global-ignores property ignores
101 --auto-props # enable automatic properties
102 --no-auto-props # disable automatic properties
103 --parents # add intermediate parents
104]
106# Restore pristine working copy state (undo local changes).
107export extern "svn revert" [
108 paths: path@"complete svn revert paths"
109 --targets: path # pass contents of file as additional args
110 --recursive(-R) # descend recursively, same as --depth=infinity
111 --depth: string@"complete svn depth" # limit operation by depth ARG ('empty', 'files', 'immediates', or 'infinity')
112 --quiet(-q) # print nothing, or only summary information
113 --changelist: string@"complete svn changelists" # operate only on members of changelist ARG
114 --remove-added # reverting an added item will remove it from disk
115]
117# FIXME
118# SVN uses aliases for subcommands. E.g. `co` for `checkout`.
119# How to express that with nu extern commands?
121# Check out a working copy from a repository.
122export extern "svn checkout" [
123 ...url_with_rev:string # source
124 path: path # destination
125 --revision(-r) # ARG (some commands also take ARG1:ARG2 range)
126 # A revision argument can be one of:
127 # NUMBER revision number
128 # '{' DATE '}' revision at start of the date
129 # 'HEAD' latest in repository
130 # 'BASE' base rev of item's working copy
131 # 'COMMITTED' last commit at or before BASE
132 # 'PREV' revision just before COMMITTED
133 --quiet(-q) # print nothing, or only summary information
134 --depth: string@"complete svn depth" # limit operation by depth ARG ('empty', 'files', 'immediates', or 'infinity')
135 --force # force operation to run
136 --ignore-externals # ignore externals definitions
137]No final newline

nushell/config.nu

Modified

+16 / −82 text lines

1# Nushell Config File
2use modules/table.nu *
3use modules/os.nu *
4use modules/prompt.nu *
5use modules/aliases.nu *
6use modules/todo.nu
7use modules/openssl.nu *
8use modules/md.nu
1use external_completer.nu
103# TODO: use nugu colors
114# for more information on themes see
125# https://github.com/nushell/nushell/blob/main/docs/How_To_Coloring_and_Theming.md
13let default_theme = {
14 # color for nushell primitives
15 separator: white
16 leading_trailing_space_bg: { attr: n } # no fg, no bg, attr non effectively turns this off
17 header: green_bold
18 empty: blue
19 bool: white
20 int: white
21 filesize: white
22 duration: white
23 date: white
24 range: white
25 float: white
26 string: white
27 nothing: white
28 binary: white
29 cellpath: white
30 row_index: green_bold
31 record: white
32 list: white
33 block: white
34 hints: dark_gray
36 # shapes are used to change the cli syntax highlighting
37 shape_garbage: { fg: "#FFFFFF" bg: "#FF0000" attr: b}
38 shape_binary: purple_bold
39 shape_bool: light_cyan
40 shape_int: purple_bold
41 shape_float: purple_bold
42 shape_range: yellow_bold
43 shape_internalcall: cyan_bold
44 shape_external: cyan
45 shape_externalarg: green_bold
46 shape_literal: blue
47 shape_operator: yellow
48 shape_signature: green_bold
49 shape_string: green
50 shape_string_interpolation: cyan_bold
51 shape_datetime: cyan_bold
52 shape_list: cyan_bold
53 shape_table: blue_bold
54 shape_record: cyan_bold
55 shape_block: blue_bold
56 shape_filepath: cyan
57 shape_globpattern: cyan_bold
58 shape_variable: purple
59 shape_flag: blue_bold
60 shape_custom: green
61 shape_nothing: light_cyan
62}
64# The default config record. This is where much of your global configuration is setup.
657$env.config = {
668 show_banner: false
679 table: {
68 mode: light # basic, compact, compact_double, light, thin, with_love, rounded, reinforced, heavy, none, other
69 }
70 ls: {
71 use_ls_colors: true
72 clickable_links: true
10 mode: none
7311 }
7412 rm: {
7513 always_trash: true
7614 }
77 color_config: $default_theme
78 use_grid_icons: true
79 footer_mode: "auto" # always, never, number_of_rows, auto
8015 completions: {
81 quick: true # set this to false to prevent auto-selecting completions when only one remains
82 partial: true # set this to false to prevent partial filling of the prompt
16 use_ls_colors: true
17 algorithm: "fuzzy"
18 external: {
19 completer: (external_completer)
20 }
8321 }
84 float_precision: 2
85 use_ansi_coloring: true
86 filesize: {
87 metric: false
88 format: "auto" # b, kb, kib, mb, mib, gb, gib, tb, tib, pb, pib, eb, eib, zb, zib, auto
89 }
90 edit_mode: emacs # emacs, vi
23 # some experimental options
24 buffer_editor: "nvim --clean"
25 highlight_resolved_externals : true
26 use_kitty_protocol : true
27 render_right_prompt_on_last_line: true
9129 history: {
92 file_format: "plaintext"
93 max_size: 10000
94 sync_on_enter: true # Enable to share the history between multiple sessions, else you have to close the session to persist history to file
30 file_format: "sqlite"
31 isolation: true
9532 }
98# must be done, after defining config, since zoxide mutates it
99# this will fail if zoxide is not installed yet
100source ($nu.config-path | path dirname | path join "zoxide.nu")

nushell/env.nu

Modified

+15 / −2 text lines

11# GLOBAL VARIABLES
33$env.WIN32 = ( $nu.os-info.name =~ "windows" )
4$env.NURC_DIR = ( $nu.config-path | path expand | path dirname )
5$env.DOTFILES = ( $env.NURC_DIR | path join ".." | path expand )
4
65$env.WORKSPACE = if $env.WIN32 { "~/Workspaces" } else { "~/Workspace" | path expand }
6$env.DOTFILES = ( $env.WORKSPACE | path join 'dotfiles' )
77$env.NOTES = ("~/Notes" | path expand)
88$env.TOOLS = ("~/Tools" | path expand)
3737 to_string: { |v| $v | str join (char esep) }
3838 }
41$env.NU_LIB_DIRS = [
42 ($nu.default-config-dir | path join 'scripts')
43]
45# generate aliases here and now, so that we can apply conditions.
46# later, in config.nu, the evaluated aliases will be sourced
47source ($nu.default-config-dir | path join 'gen-aliases.nu')
49# generate zoxide hooks for sourcing later on
50if not (which zoxide | is-empty) {
51 zoxide init nushell | save -f ($nu.default-config-dir | path join 'zoxide.nu')
52}

nushell/gen-aliases.nu

Modified

+38 / −13 text lines

1#!/usr/bin/env nu
2
1# create file initially, so that we can append to it later
32let file = $"($nu.default-config-dir)/aliases.nu"
4
5def save-alias [...args: string] {
6 $"alias ($args | str join ' ')\n" | save -a $file
7}
8
93'' | save -f $file
5def aka [
6 name: string # name of the new alias
7 command: string # program to alias to
8 ...args: string # optional arguemtns to program
9] {
11 if not (which $command | is-empty) {
12 $"alias ($name) = ($command) ($args | str join ' ')\n" | save -a $file
13 }
14}
1116########################################
1217# Start defining your aliases here
14if not (which bat | is-empty) {
15 save-alias cat = bat
16}
19aka cat bat
20aka show bat
21aka tar bsdtar
22aka walk yazi
23aka tree tre
24aka ll list
18if not (which bsdtar | is-empty) {
19 save-alias tar = bsdtar
20}
26aka browse firefox
28aka vim nvim
29aka code nvim
30aka edit nvim '--clean'
31aka ed nvim '--clean'
32aka vi nvim '--clean'
34# TODO write bak command
35# aka backup bak
37aka userctl systemctl '--user'
39# https://gist.github.com/mullnerz/9fff80593d6b442d5c1b
40aka archive wget "-mpck" "--html-extension" '--user-agent=""' "-e" "robots=off" "--wait" 1 "-P" .
42# CUSTOM LITTLE JAVA COMMANDS
43aka aes java ($env.DOTFILES + /tools/ + aes.java)
44aka download java ($env.DOTFILES + /tools/ + download.java)
45aka download_jar java ($env.DOTFILES + /tools/ + download_jar.java)

nushell/login.nu

Added
new file mode 100644

+12 / −0 text lines

1use prompt.nu *
2use commands.nu *
3use todo.nu
4use ssh-keygen-ed.nu
5use md.nu
6use start.nu
7
8source ($nu.default-config-dir | path join 'aliases.nu')
9
10# must be done, after defining config, since zoxide mutates it
11# this will fail if zoxide is not installed yet
12source ($nu.default-config-dir | path join "zoxide.nu")

nushell/modules/aliases.nu

Deleted
deleted file mode 100644

+0 / −41 text lines

1# Semantic aliases
2export alias show = bat
3export def list [] { ls --all --long --du --mime-type | where type == dir | append (ls --all --long --du --mime-type | where type != dir) }
4export alias walk = yazi
5export alias browse = firefox
6export alias vim = nvim
7export alias edit = nvim --clean
8
9# TODO ewrite bak command
10export alias backup = bak
11
12export alias userctl = systemctl --user
13
14# https://gist.github.com/mullnerz/9fff80593d6b442d5c1b
15export alias archive = wget -mpck --html-extension --user-agent="" -e robots=off --wait 1 -P .
16
17
18export def fkill [ query:string ] {
19 let pid = (^ps -ef | sed 1d | fzf -m --query $query | awk '{print $2}')
20 if not ($pid | is-empty) {
21 kill ($pid | into int )
22 }
23}
24
25export def --env yy [...args] {
26 let tmp = (mktemp -t "yazi-cwd.XXXXXX")
27 yazi ...$args --cwd-file $tmp
28 let cwd = (open $tmp)
29 if $cwd != "" and $cwd != $env.PWD {
30 cd $cwd
31 }
32 rm -fp $tmp
33}
34
35# TODO: HOST SPECIFIC ALIASES
36# I do not see a way right now the have different aliases per host with nu.
37
38# CUSTOM LITTLE JAVA COMMANDS
39export alias aes = java ($env.DOTFILES + /tools/ + aes.java)
40export alias download = java ($env.DOTFILES + /tools/ + download.java)
41export alias download_jar = java ($env.DOTFILES + /tools/ + download_jar.java)

nushell/modules/md.nu

Deleted
deleted file mode 100644

+0 / −5 text lines

1# create new directory and change into to.
2export def --env main [ p:path ] {
3 mkdir $p
4 cd $p
5}

nushell/modules/openssl.nu

Deleted
deleted file mode 100644

+0 / −6 text lines

1# Generate a new ed25519 SSH private key
2export def ssh-keygen-ed [
3 email: string # Identifier for the COMMENT section of the key
4] {
5 ssh-keygen -t ed25519 -C $email
6}

nushell/modules/os.nu

Deleted
deleted file mode 100644

+0 / −11 text lines

1
2# Opens the given resource in the operating systems preferred application.
3export def start [
4 ...rest: string # Paths or URLs the OS should open for you.
5] {
6 if $env.WIN32 {
7 $rest | each { |thing| ^start $thing}
8 } else {
9 $rest | each { |thing| ^xdg-open $thing }
10 }
11}No final newline

nushell/modules/prompt.nu

Deleted
deleted file mode 100644

+0 / −109 text lines

1# Map of paths to icons.
2# These will be used to replace certain path segments in the prompt for example.
3# Order these paths for precedence.
4def icons [] {
5 [
6 [ path icon ];
7
8 [ "/home/oli/Notes" (char -u "03C0") ]
9 [ "/home/bugabinga/Notes" (char -u "03C0") ]
10 [ "C:\\Users\\okr\\Notizen" (char -u "03C0") ]
12 [ "/home/oli/Workspace" (char -u "03BB") ]
13 [ "/home/bugabinga/Workspace" (char -u "03BB") ]
14 [ "C:\\Users\\okr\\Workspaces" (char -u "03BB") ]
16 [ "/home/oli" (char home) ]
17 [ "/home/bugabinga" (char home) ]
18 [ "C:\\Users\\okr" (char home) ]
19 ]
20}
22# Uses a special escape code to set the window title of the terminal emulator.
23# This will be ignored in terminal emulator, that do not support that escape code.
24# The title to be set is derived from the current working directory.
25# Special types of directories, e.g. HOME, get custom icons.
26def set-window-title [] {
27 # Some terminals freeze, if they do not support this OSC
28 if ($env | get -i TERM_PROGRAM) == WezTerm {
29 # normalize path
30 let pwd = ( $env.PWD | path expand )
31 let icon = if (icons | any { |icon| $icon.path == $pwd } ) { ( icons | where path == $pwd | get icon.0 ) } else { $"(char nf_folder1)" }
32 echo ([ (ansi title) $icon " " ( $pwd | path basename ) (ansi reset) ] | str join)
33 }
34}
36def prompt-git-branch [] {
37}
39def get_vcs_path [] {
40 #normalize path
41 let pwd = ($env.PWD | path expand)
43 let svn_relative_cmd = ( do --ignore-errors { ^svn info --show-item relative-url --no-newline $pwd | complete } )
44 let svn_relative_path = if ( (not ($svn_relative_cmd | is-empty)) and ($svn_relative_cmd.exit_code == 0)) { $" 🐢 (char nf_branch) ($svn_relative_cmd.stdout)" }
46 let git_branch_cmd = ( do -i { ^git rev-parse --abbrev-ref HEAD | complete } )
47 let git_path = if (not ($git_branch_cmd | is-empty) and ($git_branch_cmd.exit_code == 0)) { $" (char nf_git) (char nf_branch) ($git_branch_cmd.stdout | str trim -r)" }
49 [
50 $svn_relative_path
51 $git_path
52 ] | str join
53}
55def create_left_prompt [] {
56 set-window-title
58 # normalize path
59 let pwd = ($env.PWD | path expand)
60 let pwd = ( (icons) | reduce --fold $pwd { |item, accumulator| $accumulator | str replace $item.path $item.icon })
61 let truncate_level = 5
62 let truncate_symbol = $"…(char path_sep)"
63 let path_segment = if ($pwd | path split | length) >= $truncate_level { ($pwd | path dirname --num-levels 2 --replace $truncate_symbol ) } else { $pwd }
65 let vcs_segment = (get_vcs_path)
67 [
68 (ansi dark_gray)
69 $path_segment
70 (ansi reset)
71 (ansi green)
72 $vcs_segment
73 (ansi reset)
74 ] | str join
75}
77def create_right_prompt [] {
78 let time_segment = ([
79 (date now | format date '%d.%m %R')
80 ] | str join)
82 let command_status_segment = if $env.LAST_EXIT_CODE == 0 { $" (char -u '2713') " } else { $"(ansi red) (char failed) (ansi reset)" }
83 let command_duration_segment = if ( $env.CMD_DURATION_MS | into int) > 0 { $"($env.CMD_DURATION_MS)ms" | into duration }
85 [
86 (ansi dark_gray_dimmed)
87 $command_duration_segment
88 (ansi reset)
89 (ansi dark_gray)
90 $command_status_segment
91 (ansi reset)
92 (ansi dark_gray)
93 ( if (sys host).hostname == "x230" { (akku) } else { $time_segment })
94 (ansi reset)
95 ] | str join
96}
98export-env {
99 # Use nushell functions to define your right and left prompt
100 $env.PROMPT_COMMAND = { || create_left_prompt }
101 $env.PROMPT_COMMAND_RIGHT = { || create_right_prompt }
103 # The prompt indicators are environmental variables that represent
104 # the state of the prompt
105 $env.PROMPT_INDICATOR = $"(ansi green) (char prompt) (ansi reset)"
106 $env.PROMPT_INDICATOR_VI_INSERT = $"(ansi magenta) (char pipe) (ansi reset)"
107 $env.PROMPT_INDICATOR_VI_NORMAL = $"(ansi magenta) (char prompt) (ansi reset)"
108 $env.PROMPT_MULTILINE_INDICATOR = $"(ansi magenta) (char prompt)(char prompt) (ansi reset)"
109}

nushell/modules/syncthing.nu

Deleted
deleted file mode 100644

+0 / −48 text lines

1export def "conflicts list" [] {
2 fd --hidden --no-ignore sync-conflict $env.HOME |
3 lines |
4 filter { |path| not ($path =~ "/Trash/") }
5}
6
7export def "conflicts merge" [] {
8 (conflicts list) |
9 each { |conflict|
10 merge ( to_original $conflict ) $conflict
11 let input = ( input $"Merge successful? \((ansi pb)Y(ansi reset)/n\) \n" )
12 let sanitize = ( $input | str trim | str downcase | str substring 0..1 )
13 if ($sanitize | is-empty) or $sanitize == 'y' {
14 rm --verbose --interactive $conflict
15 } else {
16 $conflict
17 }
18 }
19}
21export def "conflicts diff" [] {
22 (conflicts list) |
23 each { |conflict|
24 diff ( to_original $conflict ) $conflict
25 }
26}
28def parse-sync-conflict [] {
29 parse -r '(?<filename>.*)\.sync-conflict-(?<date>.\d+)-(?<time>.\d+)-(?<id>\w+)\.?(?<extension>.*)?'
30}
32def to_original [ file: path ] {
33 let conflict = ( $file | parse-sync-conflict )
34 mut filename = ($conflict | get filename.0)
35 let extension = ($conflict | get extension.0)
36 if not ($extension | is-empty) {
37 $filename = $filename + '.' + $extension
38 }
39 $filename
40}
42def diff [ a: path, b: path ] {
43 print $"diffing ($a) and ($b)"
44 ^difft $a $b
45}
46def merge [ a: path, b: path ] {
47 meld $a $b
48}

nushell/modules/table.nu

Deleted
deleted file mode 100644

+0 / −10 text lines

1# Check whether table in pipeline has a column with given name
2export def "has-column?" [
3 name: string # Name of the column to check for
4] {
5 transpose | values | get 0 | any { |column| $column == $name }
6}
7
8# Flattens a table into a string separated by a single space character.
9export def to-string [] { flatten | into string | str join ' ' }

nushell/modules/todo.nu

Deleted
deleted file mode 100644

+0 / −11 text lines

1# Render my To-Do file in the terminal
2export def main [] { mdcat ($env.NOTES | path join "TODO.md") }
3
4# Open my To-Do file for editing
5export def edit [] { hx ($env.NOTES | path join "TODO.md") }
6
7# Open a list of commands, that I would like to remember to use
8export def commands [] { mdcat ($env.NOTES | path join "COMMANDS.md") }
9
10# Open the list of commands to remember for editing.
11export def "commands edit" [] { vim ($env.NOTES | path join "COMMANDS.md") }

nushell/scripts/commands.nu

Added
new file mode 100644

+18 / −0 text lines

1export def list [] { ls --all --long --du --mime-type | where type == dir | append (ls --all --long --du --mime-type | where type != dir) }
2
3export def fkill [ query:string ] {
4 let pid = (^ps -ef | sed 1d | fzf -m --query $query | awk '{print $2}')
5 if not ($pid | is-empty) {
6 kill ($pid | into int )
7 }
8}
9
10export def --env yy [...args] {
11 let tmp = (mktemp -t "yazi-cwd.XXXXXX")
12 yazi ...$args --cwd-file $tmp
13 let cwd = (open $tmp)
14 if $cwd != "" and $cwd != $env.PWD {
15 cd $cwd
16 }
17 rm -fp $tmp
18}

nushell/scripts/external_completer.nu

Added
new file mode 100644

+36 / −0 text lines

1export def main [] {
2
3 let carapace_completer = {|spans: list<string>|
4 carapace $spans.0 nushell ...$spans
5 | from json
6 | if ($in | default [] | where value =~ '^-.*ERR$' | is-empty) { $in } else { null }
7 }
8
9 let zoxide_completer = {|spans|
10 $spans | skip 1 | zoxide query -l ...$in | lines | where {|x| $x != $env.PWD}
11 }
13 # This completer will use carapace by default
14 let external_completer = {|spans|
15 # https://github.com/nushell/nushell/issues/8483
16 let expanded_alias = scope aliases
17 | where name == $spans.0
18 | get -i 0.expansion
20 let spans = if $expanded_alias != null {
21 $spans
22 | skip 1
23 | prepend ($expanded_alias | split row ' ' | take 1)
24 } else {
25 $spans
26 }
28 match $spans.0 {
29 # use zoxide completions for zoxide commands
30 __zoxide_z | __zoxide_zi => $zoxide_completer
31 _ => $carapace_completer
32 } | do $in $spans
33 }
35 $external_completer
36}

nushell/scripts/md.nu

Added
new file mode 100644

+5 / −0 text lines

1# create new directory and change into to.
2export def --env main [ p:path ] {
3 mkdir $p
4 cd $p
5}

nushell/scripts/prompt.nu

Added
new file mode 100644

+109 / −0 text lines

1# Map of paths to icons.
2# These will be used to replace certain path segments in the prompt for example.
3# Order these paths for precedence.
4def icons [] {
5 [
6 [ path icon ];
7
8 [ "/home/oli/Notes" (char -u "03C0") ]
9 [ "/home/bugabinga/Notes" (char -u "03C0") ]
10 [ "C:\\Users\\okr\\Notizen" (char -u "03C0") ]
12 [ "/home/oli/Workspace" (char -u "03BB") ]
13 [ "/home/bugabinga/Workspace" (char -u "03BB") ]
14 [ "C:\\Users\\okr\\Workspaces" (char -u "03BB") ]
16 [ "/home/oli" (char home) ]
17 [ "/home/bugabinga" (char home) ]
18 [ "C:\\Users\\okr" (char home) ]
19 ]
20}
22# Uses a special escape code to set the window title of the terminal emulator.
23# This will be ignored in terminal emulator, that do not support that escape code.
24# The title to be set is derived from the current working directory.
25# Special types of directories, e.g. HOME, get custom icons.
26def set-window-title [] {
27 # Some terminals freeze, if they do not support this OSC
28 if ($env | get -i TERM_PROGRAM) == WezTerm {
29 # normalize path
30 let pwd = ( $env.PWD | path expand )
31 let icon = if (icons | any { |icon| $icon.path == $pwd } ) { ( icons | where path == $pwd | get icon.0 ) } else { $"(char nf_folder1)" }
32 echo ([ (ansi title) $icon " " ( $pwd | path basename ) (ansi reset) ] | str join)
33 }
34}
36def prompt-git-branch [] {
37}
39def get_vcs_path [] {
40 #normalize path
41 let pwd = ($env.PWD | path expand)
43 let svn_relative_cmd = ( do --ignore-errors { ^svn info --show-item relative-url --no-newline $pwd | complete } )
44 let svn_relative_path = if ( (not ($svn_relative_cmd | is-empty)) and ($svn_relative_cmd.exit_code == 0)) { $" 🐢 (char nf_branch) ($svn_relative_cmd.stdout)" }
46 let git_branch_cmd = ( do -i { ^git rev-parse --abbrev-ref HEAD | complete } )
47 let git_path = if (not ($git_branch_cmd | is-empty) and ($git_branch_cmd.exit_code == 0)) { $" (char nf_git) (char nf_branch) ($git_branch_cmd.stdout | str trim -r)" }
49 [
50 $svn_relative_path
51 $git_path
52 ] | str join
53}
55def create_left_prompt [] {
56 set-window-title
58 # normalize path
59 let pwd = ($env.PWD | path expand)
60 let pwd = ( (icons) | reduce --fold $pwd { |item, accumulator| $accumulator | str replace $item.path $item.icon })
61 let truncate_level = 5
62 let truncate_symbol = $"…(char path_sep)"
63 let path_segment = if ($pwd | path split | length) >= $truncate_level { ($pwd | path dirname --num-levels 2 --replace $truncate_symbol ) } else { $pwd }
65 let vcs_segment = (get_vcs_path)
67 [
68 (ansi dark_gray)
69 $path_segment
70 (ansi reset)
71 (ansi green)
72 $vcs_segment
73 (ansi reset)
74 ] | str join
75}
77def create_right_prompt [] {
78 let time_segment = ([
79 (date now | format date '%d.%m %R')
80 ] | str join)
82 let command_status_segment = if $env.LAST_EXIT_CODE == 0 { $" (char -u '2713') " } else { $"(ansi red) (char failed) (ansi reset)" }
83 let command_duration_segment = if ( $env.CMD_DURATION_MS | into int) > 0 { $"($env.CMD_DURATION_MS)ms" | into duration }
85 [
86 (ansi dark_gray_dimmed)
87 $command_duration_segment
88 (ansi reset)
89 (ansi dark_gray)
90 $command_status_segment
91 (ansi reset)
92 (ansi dark_gray)
93 ( if (sys host).hostname == "x230" { (akku) } else { $time_segment })
94 (ansi reset)
95 ] | str join
96}
98export-env {
99 # Use nushell functions to define your right and left prompt
100 $env.PROMPT_COMMAND = { || create_left_prompt }
101 $env.PROMPT_COMMAND_RIGHT = { || create_right_prompt }
103 # The prompt indicators are environmental variables that represent
104 # the state of the prompt
105 $env.PROMPT_INDICATOR = $"(ansi green) (char prompt) (ansi reset)"
106 $env.PROMPT_INDICATOR_VI_INSERT = $"(ansi magenta) (char pipe) (ansi reset)"
107 $env.PROMPT_INDICATOR_VI_NORMAL = $"(ansi magenta) (char prompt) (ansi reset)"
108 $env.PROMPT_MULTILINE_INDICATOR = $"(ansi magenta) (char prompt)(char prompt) (ansi reset)"
109}

nushell/scripts/ssh-keygen-ed.nu

Added
new file mode 100644

+6 / −0 text lines

1# Generate a new ed25519 SSH private key
2export def main [
3 email: string # Identifier for the COMMENT section of the key
4] {
5 ssh-keygen -t ed25519 -C $email
6}

nushell/scripts/start.nu

Added
new file mode 100644

+11 / −0 text lines

1
2# Opens the given resource in the operating systems preferred application.
3export def main [
4 ...rest: string # Paths or URLs the OS should open for you.
5] {
6 if $env.WIN32 {
7 $rest | each { |thing| ^start $thing}
8 } else {
9 $rest | each { |thing| ^xdg-open $thing }
10 }
11}

nushell/scripts/syncthing.nu

Added
new file mode 100644

+48 / −0 text lines

1export def "conflicts list" [] {
2 fd --hidden --no-ignore sync-conflict $env.HOME |
3 lines |
4 filter { |path| not ($path =~ "/Trash/") }
5}
6
7export def "conflicts merge" [] {
8 (conflicts list) |
9 each { |conflict|
10 merge ( to_original $conflict ) $conflict
11 let input = ( input $"Merge successful? \((ansi pb)Y(ansi reset)/n\) \n" )
12 let sanitize = ( $input | str trim | str downcase | str substring 0..1 )
13 if ($sanitize | is-empty) or $sanitize == 'y' {
14 rm --verbose --interactive $conflict
15 } else {
16 $conflict
17 }
18 }
19}
21export def "conflicts diff" [] {
22 (conflicts list) |
23 each { |conflict|
24 diff ( to_original $conflict ) $conflict
25 }
26}
28def parse-sync-conflict [] {
29 parse -r '(?<filename>.*)\.sync-conflict-(?<date>.\d+)-(?<time>.\d+)-(?<id>\w+)\.?(?<extension>.*)?'
30}
32def to_original [ file: path ] {
33 let conflict = ( $file | parse-sync-conflict )
34 mut filename = ($conflict | get filename.0)
35 let extension = ($conflict | get extension.0)
36 if not ($extension | is-empty) {
37 $filename = $filename + '.' + $extension
38 }
39 $filename
40}
42def diff [ a: path, b: path ] {
43 print $"diffing ($a) and ($b)"
44 ^difft $a $b
45}
46def merge [ a: path, b: path ] {
47 meld $a $b
48}

nushell/scripts/todo.nu

Added
new file mode 100644

+11 / −0 text lines

1# Render my To-Do file in the terminal
2export def main [] { mdcat ($env.NOTES | path join "TODO.md") }
3
4# Open my To-Do file for editing
5export def edit [] { hx ($env.NOTES | path join "TODO.md") }
6
7# Open a list of commands, that I would like to remember to use
8export def commands [] { mdcat ($env.NOTES | path join "COMMANDS.md") }
9
10# Open the list of commands to remember for editing.
11export def "commands edit" [] { vim ($env.NOTES | path join "COMMANDS.md") }

nushell/scripts/vivid-themes.nu

Added
new file mode 100755

+13 / −0 text lines

1export def --env main [] {
2 (vivid themes) |
3 lines |
4 str trim |
5 each { |theme|
6 print $"theme: (ansi black_bold)($theme)(ansi reset)"
7 with-env { LS_COLORS: (vivid generate $theme) } {
8 ls $env.HOME
9 print "\n"
10 print "\n"
11 }
12 }
13}

tools/cargo-tools.nu

Deleted
deleted file mode 100644

+0 / −53 text lines

1# names of binaries in cargo must not necessarily be equal to the crate name.
2# this table resolves the binary name of a crate.
3# also, a crate can have more than one binary, but for the purpose of checking if a crate is
4# already installed on the system, finding one binary is sufficient.
5# we also cannot use `cargo install --list` to search for the binary name, in case the crate
6# is not installed yet
7let cargo_crates = [
8 [ name bin crago_args];
9 [ "bat" "bat" [] ]
10 [ "bottom" "btm" [] ]
11 [ "cargo-cache" "cargo-cache" [] ]
12 [ "cargo-update" "cargo-install-update" [] ]
13 [ "choose", "choose", [] ]
14 [ "eva" "eva" [] ]
15 [ "eva" "eva" [] ]
16 [ "fd-find" "fd" [] ]
17 [ "git-delta" "delta" [] ]
18 [ "gitu" "gitu" [ "--locked" ] ]
19 [ "hexyl" "hexyl" [] ]
20 [ "hyperfine" "hyperfine" [] ]
21 [ "just" "just" [] ]
22 [ "lms" "lms" [] ]
23 [ "lychee" "lychee" [ "--locked" "--no-default-features" "--features" "rustls-tls,email-check"] ]
24 [ "mdcat" "mdcat" [] ]
25 [ "mdsh" "mdsh" [] ]
26 [ "nu" "nu" [ "--features" "extra" ] ]
27 [ "ouch" "ouch" [] ]
28 [ "pastel" "pastel" [] ]
29 [ "ripgrep" "rg" [] ]
30 [ "sd" "sd" [] ]
31 [ "selene" "selene" [ "--no-default-features" ] ]
32 [ "stylua" "stylua" [ "--features" "lua52" ] ]
33 [ "taplo-cli" "taplo" [] ]
34 [ "tealdeer" "tldr" [] ]
35 [ "tokei" "tokei" [] ]
36 [ "viu" "viu" [] ]
37 [ "vivid" "vivid" [] ]
38 [ "yazi-cli" "ya" [ "--locked" ] ]
39 [ "yazi-fm" "yazi" [ "--locked" ] ]
40 [ "zoxide" "zoxide" [] ]
41]
43# install all my favorite crate, only if they are not already in PATH.
44def main [] {
45 $cargo_crates | each { | crate |
46 if ( which $crate.bin | is-empty ) {
47 echo $'cargo install ($crate.name) ($crate.crago_args)'
48 cargo install $crate.name ...$crate.crago_args
49 } else {
50 echo $"($crate.name) already installed"
51 }
52 }
53}

tools/download_jar.java

Modified

+1 / −1 text lines

171171 }
173173 static void usage() {
174 out.printf("%s: java download_jar.java <artifact id> <group id> <version>%n", emphasize_global("Usage"));
174 out.printf("%s: java download_jar.java <group id> <artifact id> <version>%n", emphasize_global("Usage"));
175175 }
177177 static void exit() {

tools/install.java

Added
new file mode 100644

+141 / −0 text lines

1import static java.lang.System.out;
2import static java.lang.System.err;
3
4import java.nio.file.Files;
5import java.nio.file.Path;
6import java.nio.file.Paths;
7import java.util.Arrays;
8
9final class install {
10 static final String CARGO_PACKAGES_CSV_FILE = "tools.csv";
12 public static void main(String[] __)
13 throws Throwable {
14 exec("cargo", "--version");
16 var csv = Path.of(CARGO_PACKAGES_CSV_FILE);
17 if (!Files.exists(csv)) {
18 throw fail("Expected a CSV file with cargo crates!");
19 }
21 var lines = Files.lines(csv).toArray(String[]::new);
22 for (int index = 1; index < lines.length; ++index) {
23 var line = lines[index];
24 var spec = parse(line);
25 if (!which(spec.bin)) {
26 install(spec);
27 }
28 }
29 }
31 static boolean which(String program) {
32 var pathEnv = System.getenv("PATH");
34 if (pathEnv == null || pathEnv.isEmpty()) {
35 return false;
36 }
38 var paths = pathEnv.split(System.getProperty("path.separator"));
39 var extensions = new String[] { "", ".exe", ".bat", ".cmd", ".com" };
41 for (var path : paths) {
42 for (var extension : extensions) {
43 var fullPath = Paths.get(path, program + extension);
44 if (Files.exists(fullPath) && Files.isExecutable(fullPath)) {
45 return true;
46 }
47 }
48 }
50 return false;
51 }
53 static void exec(String... command)
54 throws Exception {
55 var proc = new ProcessBuilder(command).inheritIO().start();
56 proc.waitFor();
57 var exit = proc.exitValue();
58 if (exit != 0) {
59 dbg("process failed to exec with code %d.%nproc: %s", exit, emphasize_local(Arrays.toString(command)));
60 }
61 }
63 static void install(Spec spec)
64 throws Throwable {
65 out("cargo install %s (%s) %s",
66 emphasize_global(spec.name),
67 emphasize_local(spec.bin),
68 emphasize_local(Arrays.toString(spec.flags)));
70 var cmd = new String[3 + spec.flags.length];
71 cmd[0] = "cargo";
72 cmd[1] = "install";
73 cmd[2] = spec.name;
75 System.arraycopy(spec.flags, 0, cmd, 3, spec.flags.length);
77 exec(cmd);
78 }
80 record Spec(String name, String bin, String... flags) {
81 };
83 static Spec parse(String line)
84 throws Throwable {
85 var by_comma = line.split(";");
86 if (by_comma.length == 0) {
87 throw fail("empty line in CSV");
88 }
89 if (by_comma.length > 3) {
90 throw fail("line in CSV should have 1-3 fields%nfound: %s", emphasize_local(line));
91 }
92 var name = by_comma[0].strip();
93 var bin = name;
94 if (by_comma.length > 1) {
95 bin = by_comma[1].strip();
96 }
97 var flags = new String[] {};
98 if (by_comma.length == 3) {
99 flags = by_comma[2].strip().split(" ");
100 }
101 return new Spec(name, bin, flags);
102 }
104 static void out(String fmt, Object... args) {
105 out.printf(fmt, args);
106 out.println();
107 }
109 static void dbg(String fmt, Object... args) {
110 System.err.print("[DBG]: ");
111 System.err.printf(fmt, args);
112 System.err.println();
113 }
115 static Throwable exit() {
116 System.exit(0);
117 // abuse control flow to make compiler realize `exit` will never return
118 return new Throwable();
119 }
121 static String emphasize_global(String message) {
122 return "\033[4m" + message + "\033[0m";
123 }
125 static String emphasize_local(String message) {
126 return "\033[3m" + message + "\033[0m";
127 }
129 static Throwable fail(String message, Object... arguments) {
130 err.printf(message, arguments);
131 System.exit(-1);
132 // abuse control flow to make compiler realize `fail` will never return
133 return new Throwable();
134 }
136 static Throwable fail() {
137 System.exit(-1);
138 // abuse control flow to make compiler realize `fail` will never return
139 return new Throwable();
140 }
141}

tools/install_wezterm_terminfo.sh

Deleted
deleted file mode 100755

+0 / −4 text lines

1tempfile=$(mktemp) \
2 && curl -o "$tempfile" https://raw.githubusercontent.com/wez/wezterm/main/termwiz/data/wezterm.terminfo \
3 && tic -x -o ~/.terminfo "$tempfile" \
4 && rm "$tempfile"

tools/nerd-font.sh

Deleted
deleted file mode 100644

+0 / −29 text lines

1#!/bin/bash
2set -eu fail
3
4# rewrite this some time...
5
6declare -a fonts=(
7 IBMPlexMono
8 VictorMono
9)
11version='3.0.2'
12fonts_dir="${HOME}/.local/share/fonts"
14if [[ ! -d "$fonts_dir" ]]; then
15 mkdir -p "$fonts_dir"
16fi
18for font in "${fonts[@]}"; do
19 zip_file="${font}.zip"
20 download_url="https://github.com/ryanoasis/nerd-fonts/releases/download/v${version}/${zip_file}"
21 echo "Downloading $download_url"
22 wget "$download_url"
23 unzip -d "$fonts_dir" "$zip_file"
24 rm "$zip_file"
25done
27find "$fonts_dir" -name '*Windows Compatible*' -delete
29fc-cache -fv

tools/parsing-equals-test.nu

Deleted
deleted file mode 100644

+0 / −45 text lines

1def main [] {
2 assert-is-a { "" } string
3 assert-is-a { "=" } string
4 assert-is-a { "-" } string
5 assert-is-a { "-=" } string
6 assert-is-a { "-=-" } string
7 assert-is-a { "=-" } string
8
9 assert-is-a { [""] } list<string>
10 assert-is-a { ["="] } list<string>
11 assert-is-a { ["-"] } list<string>
12 assert-is-a { ["-="] } list<string>
13
14 # error: unknown command
15 #assert-is-a { ["-=-"] } list<string>
16 #assert-is-a { ["=-"] } list<string>
17 #assert-is-a { ["=-"] } list<string>
19 assert-is-a { ["= "] } list<string>
20 assert-is-a { [ "="] } list<string>
21 assert-is-a { ["=" ] } list<string>
22 assert-is-a { [ "=" ] } list<string>
24 assert-is-a { [ "=OK" ] } list<string>
25}
27def assert-is-a [
28 code: block # some nu expression
29 expected_type: string # expected nu type of given expression, as printed by `describe`
30] {
31 let span = (metadata $code).span;
32 let actual_type = ( do $code | describe )
33 if $actual_type == $expected_type {
34 echo $"(char sun)\t(ansi green_bold)OK(ansi reset)\t($actual_type)"
35 } else {
36 error make {
37 msg: $"(char cloud)\t(ansi red_bold)FAIL(ansi reset)",
38 label: {
39 text: $"expected a `($expected_type)` but got a `($actual_type)`",
40 start: $span.start,
41 end: $span.end
42 }
43 }
44 }
45}No final newline

tools/tools.csv

Added
new file mode 100644

+55 / −0 text lines

1name;bin;cargo_args
2asm-cli-rust; asm-cli-rust; --git https://github.com/cch123/asm-cli-rust
3bat
4bartib
5bottom; btm
6broot
7cargo-cache
8cargo-update;cargo-install-update
9choose
10du-dust; dust
11eva
12exa
13fend
14fd-find;fd
15git-delta;delta
16gitu;gitu; --locked
17hck
18hexyl
19hyperfine
20inlyne
21jj-cli; jj; --locked --bin jj
22jaq;jaq; --locked
23just
24lemmeknow
25lms
26lurk-cli; lurk
27lychee;lychee; --locked --no-default-features --features rustls-tls,email-check
28mask
29macchina
30mdbook
31mdcat
32mdsh
33monolith
34netscanner
35nu;nu; --locked
36ouch
37pastel
38pueue;pueue;--locked
39ripgrep;rg
40rust-parallel
41sd
42sniffnet
43selene;selene; --no-default-features
44starship
45stylua;stylua; --features lua52
46taplo-cli;taplo
47tealdeer;tldr
48tokei
49ugdb
50unf
51viu
52vivid
53yazi-cli;ya; --locked
54yazi-fm;yazi; --locked
55zoxide

tools/vivid_themes.nu

Deleted
deleted file mode 100755

+0 / −14 text lines

1#!/usr/bin/env nu
2
3def main [] {
4 (vivid themes) |
5 lines |
6 str trim |
7 each { |theme|
8 print $"theme: (ansi black_bold)($theme)(ansi reset)"
9 with-env { LS_COLORS: (vivid generate $theme) } {
10 exa
11 print "\n"
12 }
13 }
14}

tools/wezterm_terminfo.sh

Added
new file mode 100755

+4 / −0 text lines

1tempfile=$(mktemp) \
2 && curl -o "$tempfile" https://raw.githubusercontent.com/wez/wezterm/main/termwiz/data/wezterm.terminfo \
3 && tic -x -o ~/.terminfo "$tempfile" \
4 && rm "$tempfile"

x230.symlinks

Modified

+7 / −4 text lines

1313nushell/env.nu
1414~/.config/nushell/env.nu
16nushell/modules
17~/.config/nushell/modules
16nushell/login.nu
17~/.config/nushell/login.nu
19nushell/plugin.nu
20~/.config/nushell/plugin.nu
19nushell/gen-aliases.nu
20~/.config/nushell/gen-aliases.nu
22nushell/scripts
23~/.config/nushell/scripts
2225icc/thinkpad_x230.icc
2326~/.config/icc/thinkpad_x230.icc