dotfiles
bugabingas dorkfiles
owned by bugabinga
Merge branch 'trunk' of github.com:bugabinga/dotfiles into trunk
ba3f97721a36026807f1247b19e9494ee3de6375
Oliver Krylow <o.krylow@isp-insoft.de> ·
unsigned
Browse filesCompare with HEAD
Changed files (37)
+600 / −655 text lines · all files grouped into 32 bars
cargo/config.toml
Modified+1 / −0 text lines
3 3 rustflags = [
"-C",
"target-cpu=native"]
+7 / −4 text lines
32 32 ~/.config/nushell/env.nu
35 -~/.config/nushell/modules
35 +~/.config/nushell/login.nu
38 -~/.config/nushell/plugin.nu
37 +nushell/gen-aliases.nu
38 +~/.config/nushell/gen-aliases.nu
41 +~/.config/nushell/scripts
40 43 topgrade/topgrade.linux.toml
41 44 ~/.config/topgrade.toml
+3 / −0 text lines
29 29 java bootstripper.java
32 + cd tools;java install.java
neovim/lazy-lock.json
Modified+11 / −11 text lines
18 18 "glow.nvim": {
"branch":
"main",
"commit":
"238070a686c1da3bccccf1079700eb4b5e19aea4" },
19 19 "heirline.nvim": {
"branch":
"master",
"commit":
"0d797435e54645a5f98bad7ad6046aac1ef95c1e" },
20 20 "indent-blankline.nvim": {
"branch":
"master",
"commit":
"d98f537c3492e87b6dc6c2e3f66ac517528f406f" },
21 - "lazy.nvim": {
"branch":
"main",
"commit":
"89ddc59d19513c5c19c8f8d2ad8573890bd00eef" },
21 + "lazy.nvim": {
"branch":
"main",
"commit":
"eab487c2520f0fe9e54eb5e3ea0606e20512492e" },
22 22 "lspkind.nvim": {
"branch":
"master",
"commit":
"1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" },
23 23 "mini.bracketed": {
"branch":
"main",
"commit":
"06ad08fc75dc540cba76d3d8de0f2dc9f75b5812" },
24 24 "mini.bufremove": {
"branch":
"main",
"commit":
"e6044aa28e61d4dd9ec86194d6f81743eced0c1c" },
29 29 "nui.nvim": {
"branch":
"main",
"commit":
"322978c734866996274467de084a95e4f9b5e0b1" },
30 30 "nvim-autopairs": {
"branch":
"master",
"commit":
"c15de7e7981f1111642e7e53799e1211d4606cb9" },
31 31 "nvim-cmp": {
"branch":
"main",
"commit":
"5260e5e8ecadaf13e6b82cf867a909f54e15fd07" },
32 - "nvim-genghis": {
"branch":
"main",
"commit":
"7055134943460d962b4909b43b4c3cd5f011c153" },
32 + "nvim-genghis": {
"branch":
"main",
"commit":
"6c3a123dcd355a33f5dd624b0a841e8f88c11f8d" },
33 33 "nvim-gomove": {
"branch":
"main",
"commit":
"2b44ae7ac0804f4e3959228122f7c85bef1964e3" },
34 34 "nvim-lastplace": {
"branch":
"main",
"commit":
"0bb6103c506315044872e0f84b1f736c4172bb20" },
35 - "nvim-lint": {
"branch":
"master",
"commit":
"1a3a8d047bc01f1760ae4a0f5e80f111ea222e67" },
35 + "nvim-lint": {
"branch":
"master",
"commit":
"2f90fe977ef21db3bf3b7a1ceaf4a1e3aafb2b26" },
36 36 "nvim-lsp-file-operations": {
"branch":
"master",
"commit":
"223aca86b737dc66e9c51ebcda8788a8d9cc6cf2" },
37 37 "nvim-navbuddy": {
"branch":
"master",
"commit":
"f22bac988f2dd073601d75ba39ea5636ab6e38cb" },
38 38 "nvim-navic": {
"branch":
"master",
"commit":
"8649f694d3e76ee10c19255dece6411c29206a54" },
39 - "nvim-neoclip.lua": {
"branch":
"main",
"commit":
"709c97fabec9da7d04f7d2f5e207423af8c02871" },
40 - "nvim-spectre": {
"branch":
"master",
"commit":
"4d22fe03554056de4325762add3e546c77e3a275" },
41 - "nvim-surround": {
"branch":
"main",
"commit":
"ae876ab0f8d41213131c3ed4eeb4c48328f45e12" },
39 + "nvim-neoclip.lua": {
"branch":
"main",
"commit":
"9b02a625dfa22499089458554be86171a1dfe8b1" },
40 + "nvim-spectre": {
"branch":
"master",
"commit":
"366f46fdd4a1593cc237aea13d5ef113739a472c" },
41 + "nvim-surround": {
"branch":
"main",
"commit":
"f1f0699a1d49f28e607ffa4361f1bbe757ac5ebc" },
42 42 "nvim-tree.lua": {
"branch":
"master",
"commit":
"2bc725a3ebc23f0172fb0ab4d1134b81bcc13812" },
43 - "nvim-treesitter": {
"branch":
"master",
"commit":
"3a74b5831058d0daf8952a5b8c556c61b30a3f46" },
44 - "nvim-treesitter-context": {
"branch":
"master",
"commit":
"5efba33af0f39942e426340da7bc15d7dec16474" },
43 + "nvim-treesitter": {
"branch":
"master",
"commit":
"979beffc1a86e7ba19bd6535c0370d8e1aaaad3c" },
44 + "nvim-treesitter-context": {
"branch":
"master",
"commit":
"f62bfe19e0fbc13ae95649dfb3cf22f4ff85b683" },
45 45 "nvim-treesitter-endwise": {
"branch":
"master",
"commit":
"8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" },
46 - "nvim-treesitter-textobjects": {
"branch":
"master",
"commit":
"34867c69838078df7d6919b130c0541c0b400c47" },
47 - "nvim-ts-autotag": {
"branch":
"main",
"commit":
"6eb4120a1aadef07ac312f1c4bc6456712220007" },
46 + "nvim-treesitter-textobjects": {
"branch":
"master",
"commit":
"fd41b7ccc5490a3a99c734d1ee418b68d06c48a9" },
47 + "nvim-ts-autotag": {
"branch":
"main",
"commit":
"bcf3146864262ef2d3c877beba3e222b5c73780d" },
48 48 "nvim-ts-context-commentstring": {
"branch":
"main",
"commit":
"cb064386e667def1d241317deed9fd1b38f0dc2e" },
49 49 "nvim-web-devicons": {
"branch":
"master",
"commit":
"b4b302d6ae229f67df7a87ef69fa79473fe788a9" },
50 50 "nvim-window": {
"branch":
"main",
"commit":
"81f29840ac3aaeea6fc2153edfabebd00d692476" },
75 75 "virt-column.nvim": {
"branch":
"master",
"commit":
"b62b4ef0774d19452d4ed18e473e824c7a756f2f" },
76 76 "which-key.nvim": {
"branch":
"main",
"commit":
"4b7167f8fb2dba3d01980735e3509e172c024c29" },
77 77 "zen-mode.nvim": {
"branch":
"main",
"commit":
"78557d972b4bfbb7488e17b5703d25164ae64e6a" }
+32 / −15 text lines
26 26 return vim.fs.basename(plugin_coords):gsub(
'(%w+)%.?%w*',
'%1' )
29 -local download_plugin_into = function ( plugin_tarball_url, plugin_install_path )
29 +local download_plugin_into = function ( plugin_name, plugin_tarball_url, plugin_install_path )
31 31 assert(vim.fn.executable
'curl',
'curl not found')
32 32 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'))
36 37 local tarball_data_stream
= vim.uv.new_pipe(
true)
37 38 local error_stream
= vim.uv.new_pipe()
44 45 local curl_handle, curl_pid
= vim.uv.spawn(
'curl',
46 47 args = {
'--silent',
'--location', plugin_tarball_url },
47 - cwd = plugin_install_path,
48 49 stdio = {
nil, tarball_data_stream, error_stream},
51 - function(code, signal)
52 - vim.print(
'curl done', code, signal)
54 56 local tar_handle, tar_pid
= vim.uv.spawn(
'tar',
56 58 args = {
'--extract',
'--gzip',
'--file',
'-' },
57 - cwd = plugin_install_path,
58 60 stdio = { tarball_data_stream,
nil, error_stream},
61 - function(code, signal)
62 - vim.print(
'tar done', code, signal)
65 - print(curl_handle, curl_handle, tar_handle, tar_pid)
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 }
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!')
80 + local ok
= vim.fn.rename(extracted_dir[
1], plugin_install_path)
82 + assert(ok,
string.
format(
'Failed to move extracted plugin from %s to %s.', extracted_dir[
1], plugin_install_path))
67 84 vim.uv.shutdown(tarball_data_stream,
function()
68 85 vim.uv.close(curl_handle,
function()
113 130 local install_plugin = function ( puck_root, plugin_type, plugin_coords, plugin_rev )
114 131 local plugin_name
= as_name( plugin_coords )
115 - local plugin_install_path
= vim.fs.normalize( vim.fs.joinpath( puck_root, plugin_name ) )
132 + local plugin_install_path
= vim.fs.normalize( vim.fs.joinpath( puck_root, plugin_name ) )
116 133 local plugin_install_path_stat
= vim.uv.fs_stat( plugin_install_path )
117 134 local plugin_already_exists
= plugin_install_path_stat
and plugin_install_path_stat.type
== 'directory' 130 147 local removed
= delete_directory_recursive( plugin_install_path )
131 148 local url_format
= as_url_format(plugin_type)
132 149 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 )
135 152 local mode
= vim.uv.fs_access(plugin_install_rev_path,
'W')
and 'w+' or 'w' 136 153 local plugin_install_rev_file
= io.
open( plugin_install_rev_path, mode)
nushell/completions/svn-completions.nu
Deleteddeleted file mode 100644+0 / −137 text lines
1 -def "complete svn subcommands" [] {
4 - | skip until { | line |
$line | str starts-with
"Available subcommands:" }
6 - |
each { |line|
$line | str trim }
7 - | take until { |line|
$line | empty? }
14 -def "complete svn add paths" [] {
15 - ^svn status --depth infinity
17 - | parse
"{mode} {file}" 23 -def "complete svn revert paths" [] {
24 - ^svn status --depth infinity
26 - | parse
"{mode} {file}" 32 -def "complete svn depth" [] { [
'empty',
'files',
'immediates',
'infinity'] }
34 -def "complete svn changelists" [] {
35 - ^svn status --depth infinity
37 - | parse
"--- Changelist '{changelist}':" 38 - | get --ignore-errors changelist
54 -export extern "svn help" [
55 - subcommand?: string@
"complete svn subcommands" 67 -export extern "svn status" [
71 - --depth: string@
"complete svn depth" 72 - --revision(-r): string
85 - --changelist:string@
"complete svn changelists" 93 -export extern "svn add" [
94 - paths: path@
"complete svn add paths" 97 - --depth: string@
"complete svn depth" 107 -export extern "svn revert" [
108 - paths: path@
"complete svn revert paths" 111 - --depth: string@
"complete svn depth" 113 - --changelist: string@
"complete svn changelists" 122 -export extern "svn checkout" [
123 - ...url_with_rev:string
134 - --depth: string@
"complete svn depth" nushell/config.nu
Modified+16 / −82 text lines
2 -use modules/table.nu *
4 -use modules/prompt.nu *
5 -use modules/aliases.nu *
7 -use modules/openssl.nu *
1 +use external_completer.nu
13 -let default_theme = {
16 - leading_trailing_space_bg: { attr: n }
30 - row_index: green_bold
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
47 - shape_operator: yellow
48 - shape_signature: green_bold
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
61 - shape_nothing: light_cyan
72 - clickable_links: true
77 - color_config:
$default_theme 78 - use_grid_icons: true
19 + completer: (external_completer)
85 - use_ansi_coloring: true
24 + buffer_editor:
"nvim --clean" 25 + highlight_resolved_externals : true
26 + use_kitty_protocol : true
27 + render_right_prompt_on_last_line: true
92 - file_format:
"plaintext" 30 + file_format:
"sqlite" 100 -source (
$nu.config-path | path dirname | path join
"zoxide.nu")
+15 / −2 text lines
3 3 $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 )
6 5 $env.WORKSPACE =
if $env.WIN32 {
"~/Workspaces" }
else {
"~/Workspace" | path expand }
6 +$env.DOTFILES = (
$env.WORKSPACE | path join
'dotfiles' )
7 7 $env.NOTES = (
"~/Notes" | path expand)
8 8 $env.TOOLS = (
"~/Tools" | path expand)
37 37 to_string: { |v|
$v | str join (char esep) }
42 + (
$nu.default-config-dir | path join
'scripts')
47 +source (
$nu.default-config-dir | path join
'gen-aliases.nu')
50 +if not (which zoxide | is-empty) {
51 + zoxide init nushell | save -f (
$nu.default-config-dir | path join
'zoxide.nu')
nushell/gen-aliases.nu
Modified+38 / −13 text lines
3 2 let file = $
"($nu.default-config-dir)/aliases.nu" 5 -def save-alias [...args: string] {
6 - $
"alias ($args | str join ' ')\n" | save -a
$file 11 + if not (which
$command | is-empty) {
12 + $
"alias ($name) = ($command) ($args | str join ' ')\n" | save -a
$file 14 -if not (which bat | is-empty) {
15 - save-alias cat = bat
18 -if not (which bsdtar | is-empty) {
19 - save-alias tar = bsdtar
30 +aka edit nvim
'--clean' 31 +aka ed nvim
'--clean' 32 +aka vi nvim
'--clean' 37 +aka userctl systemctl
'--user' 40 +aka archive wget
"-mpck" "--html-extension" '--user-agent=""' "-e" "robots=off" "--wait" 1 "-P" .
43 +aka aes java (
$env.DOTFILES + /tools/ + aes.java)
44 +aka download java (
$env.DOTFILES + /tools/ + download.java)
45 +aka download_jar java (
$env.DOTFILES + /tools/ + download_jar.java)
new file mode 100644+12 / −0 text lines
8 +source (
$nu.default-config-dir | path join
'aliases.nu')
12 +source (
$nu.default-config-dir | path join
"zoxide.nu")
nushell/modules/aliases.nu
Deleteddeleted file mode 100644+0 / −41 text lines
2 -export alias show = bat
3 -export def list [] { ls --all --long --du --mime-type |
where type == dir | append (ls --all --long --du --mime-type |
where type != dir) }
4 -export alias walk = yazi
5 -export alias browse = firefox
6 -export alias vim = nvim
7 -export alias edit = nvim --clean
10 -export alias backup = bak
12 -export alias userctl = systemctl --user
15 -export alias archive = wget -mpck --html-extension --user-agent=
"" -e robots=off --wait
1 -P .
18 -export 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 )
25 -export 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 {
39 -export alias aes = java (
$env.DOTFILES + /tools/ + aes.java)
40 -export alias download = java (
$env.DOTFILES + /tools/ + download.java)
41 -export alias download_jar = java (
$env.DOTFILES + /tools/ + download_jar.java)
nushell/modules/md.nu
Deleteddeleted file mode 100644+0 / −5 text lines
2 -export def --env main [ p:path ] {
nushell/modules/openssl.nu
Deleteddeleted file mode 100644+0 / −6 text lines
2 -export def ssh-keygen-ed [
5 - ssh-keygen -t ed25519 -C
$email nushell/modules/os.nu
Deleteddeleted file mode 100644+0 / −11 text lines
7 - $rest |
each { |thing| ^start
$thing}
9 - $rest |
each { |thing| ^xdg-open
$thing }
nushell/modules/prompt.nu
Deleteddeleted file mode 100644+0 / −109 text lines
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) ]
26 -def set-window-title [] {
28 - if (
$env | get -i TERM_PROGRAM) == WezTerm {
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)
36 -def prompt-git-branch [] {
39 -def get_vcs_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)" }
55 -def create_left_prompt [] {
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)
77 -def create_right_prompt [] {
78 - let time_segment = ([
79 - (date now | format date
'%d.%m %R')
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 }
86 - (ansi dark_gray_dimmed)
87 - $command_duration_segment 90 - $command_status_segment 93 - (
if (sys host).hostname ==
"x230" { (akku) }
else {
$time_segment })
100 - $env.PROMPT_COMMAND = { || create_left_prompt }
101 - $env.PROMPT_COMMAND_RIGHT = { || create_right_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)" nushell/modules/syncthing.nu
Deleteddeleted file mode 100644+0 / −48 text lines
1 -export def "conflicts list" [] {
2 - fd --hidden --no-ignore sync-conflict
$env.HOME |
4 - filter { |path| not (
$path =~
"/Trash/") }
7 -export def "conflicts merge" [] {
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 21 -export def "conflicts diff" [] {
24 - diff ( to_original
$conflict )
$conflict 28 -def parse-sync-conflict [] {
29 - parse -r
'(?<filename>.*)\.sync-conflict-(?<date>.\d+)-(?<time>.\d+)-(?<id>\w+)\.?(?<extension>.*)?' 32 -def 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 42 -def diff [ a: path, b: path ] {
43 - print $
"diffing ($a) and ($b)" 46 -def merge [ a: path, b: path ] {
nushell/modules/table.nu
Deleteddeleted file mode 100644+0 / −10 text lines
2 -export def "has-column?" [
5 - transpose | values | get
0 | any { |column|
$column ==
$name }
9 -export def to-string [] { flatten | into string | str join
' ' }
nushell/modules/todo.nu
Deleteddeleted file mode 100644+0 / −11 text lines
2 -export def main [] { mdcat (
$env.NOTES | path join
"TODO.md") }
5 -export def edit [] { hx (
$env.NOTES | path join
"TODO.md") }
8 -export def commands [] { mdcat (
$env.NOTES | path join
"COMMANDS.md") }
11 -export def "commands edit" [] { vim (
$env.NOTES | path join
"COMMANDS.md") }
nushell/scripts/commands.nu
Addednew file mode 100644+18 / −0 text lines
1 +export def list [] { ls --all --long --du --mime-type |
where type == dir | append (ls --all --long --du --mime-type |
where type != dir) }
3 +export 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 )
10 +export 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 {
nushell/scripts/external_completer.nu
Addednew file mode 100644+36 / −0 text lines
3 + let carapace_completer = {|spans: list<string>|
4 + carapace
$spans.0 nushell ...
$spans 6 + |
if (
$in | default [] |
where value =~
'^-.*ERR$' | is-empty) {
$in }
else { null }
9 + let zoxide_completer = {|spans|
10 + $spans | skip
1 | zoxide query -l ...
$in | lines |
where {|x|
$x !=
$env.PWD}
14 + let external_completer = {|spans|
16 + let expanded_alias = scope aliases
17 + |
where name ==
$spans.0 18 + | get -i
0.expansion
20 + let spans =
if $expanded_alias != null {
23 + | prepend (
$expanded_alias | split row
' ' | take
1)
30 + __zoxide_z | __zoxide_zi =>
$zoxide_completer 31 + _ =>
$carapace_completer nushell/scripts/md.nu
Addednew file mode 100644+5 / −0 text lines
2 +export def --env main [ p:path ] {
nushell/scripts/prompt.nu
Addednew file mode 100644+109 / −0 text lines
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) ]
26 +def set-window-title [] {
28 + if (
$env | get -i TERM_PROGRAM) == WezTerm {
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)
36 +def prompt-git-branch [] {
39 +def get_vcs_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)" }
55 +def create_left_prompt [] {
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)
77 +def create_right_prompt [] {
78 + let time_segment = ([
79 + (date now | format date
'%d.%m %R')
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 }
86 + (ansi dark_gray_dimmed)
87 + $command_duration_segment 90 + $command_status_segment 93 + (
if (sys host).hostname ==
"x230" { (akku) }
else {
$time_segment })
100 + $env.PROMPT_COMMAND = { || create_left_prompt }
101 + $env.PROMPT_COMMAND_RIGHT = { || create_right_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)" nushell/scripts/ssh-keygen-ed.nu
Addednew file mode 100644+6 / −0 text lines
5 + ssh-keygen -t ed25519 -C
$email nushell/scripts/start.nu
Addednew file mode 100644+11 / −0 text lines
7 + $rest |
each { |thing| ^start
$thing}
9 + $rest |
each { |thing| ^xdg-open
$thing }
nushell/scripts/syncthing.nu
Addednew file mode 100644+48 / −0 text lines
1 +export def "conflicts list" [] {
2 + fd --hidden --no-ignore sync-conflict
$env.HOME |
4 + filter { |path| not (
$path =~
"/Trash/") }
7 +export def "conflicts merge" [] {
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 21 +export def "conflicts diff" [] {
24 + diff ( to_original
$conflict )
$conflict 28 +def parse-sync-conflict [] {
29 + parse -r
'(?<filename>.*)\.sync-conflict-(?<date>.\d+)-(?<time>.\d+)-(?<id>\w+)\.?(?<extension>.*)?' 32 +def 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 42 +def diff [ a: path, b: path ] {
43 + print $
"diffing ($a) and ($b)" 46 +def merge [ a: path, b: path ] {
nushell/scripts/todo.nu
Addednew file mode 100644+11 / −0 text lines
2 +export def main [] { mdcat (
$env.NOTES | path join
"TODO.md") }
5 +export def edit [] { hx (
$env.NOTES | path join
"TODO.md") }
8 +export def commands [] { mdcat (
$env.NOTES | path join
"COMMANDS.md") }
11 +export def "commands edit" [] { vim (
$env.NOTES | path join
"COMMANDS.md") }
nushell/scripts/vivid-themes.nu
Addednew file mode 100755+13 / −0 text lines
1 +export def --env main [] {
6 + print $
"theme: (ansi black_bold)($theme)(ansi reset)" 7 + with-env { LS_COLORS: (vivid generate
$theme) } {
tools/cargo-tools.nu
Deleteddeleted file mode 100644+0 / −53 text lines
8 - [ name bin crago_args];
10 - [
"bottom" "btm" [] ]
11 - [
"cargo-cache" "cargo-cache" [] ]
12 - [
"cargo-update" "cargo-install-update" [] ]
13 - [
"choose",
"choose", [] ]
16 - [
"fd-find" "fd" [] ]
17 - [
"git-delta" "delta" [] ]
18 - [
"gitu" "gitu" [
"--locked" ] ]
19 - [
"hexyl" "hexyl" [] ]
20 - [
"hyperfine" "hyperfine" [] ]
21 - [
"just" "just" [] ]
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" [] ]
31 - [
"selene" "selene" [
"--no-default-features" ] ]
32 - [
"stylua" "stylua" [
"--features" "lua52" ] ]
33 - [
"taplo-cli" "taplo" [] ]
34 - [
"tealdeer" "tldr" [] ]
35 - [
"tokei" "tokei" [] ]
37 - [
"vivid" "vivid" [] ]
38 - [
"yazi-cli" "ya" [
"--locked" ] ]
39 - [
"yazi-fm" "yazi" [
"--locked" ] ]
40 - [
"zoxide" "zoxide" [] ]
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 50 - echo $
"($crate.name) already installed" tools/download_jar.java
Modified+1 / −1 text lines
173 173 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"));
177 177 static void exit() {
new file mode 100644+141 / −0 text lines
1 +import static java.
lang.
System.
out;
2 +import static java.
lang.
System.
err;
4 +import java.
nio.
file.
Files;
5 +import java.
nio.
file.
Path;
6 +import java.
nio.
file.
Paths;
7 +import java.
util.
Arrays;
10 + static final String CARGO_PACKAGES_CSV_FILE = "tools.csv";
12 + public static void main(
String[] __)
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!");
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)) {
31 + static boolean which(
String program) {
32 + var pathEnv
= System.getenv(
"PATH");
34 + if (pathEnv
== null || pathEnv.isEmpty()) {
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)) {
53 + static void exec(
String... command)
55 + var proc
= new ProcessBuilder(command).inheritIO().start();
57 + var exit
= proc.exitValue();
59 + dbg(
"process failed to exec with code %d.%nproc: %s", exit, emphasize_local(
Arrays.toString(command)));
63 + static void install(
Spec spec)
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];
75 + System.arraycopy(spec.flags,
0, cmd,
3, spec.flags.length);
80 + record
Spec(
String name,
String bin,
String... flags) {
83 + static Spec parse(
String line)
85 + var by_comma
= line.split(
";");
86 + if (by_comma.length
== 0) {
87 + throw fail(
"empty line in CSV");
89 + if (by_comma.length
> 3) {
90 + throw fail(
"line in CSV should have 1-3 fields%nfound: %s", emphasize_local(line));
92 + var name
= by_comma[
0].strip();
94 + if (by_comma.length
> 1) {
95 + bin
= by_comma[
1].strip();
97 + var flags
= new String[] {};
98 + if (by_comma.length
== 3) {
99 + flags
= by_comma[
2].strip().split(
" ");
101 + return new Spec(name, bin, flags);
104 + static void out(
String fmt,
Object... args) {
105 + out.printf(fmt, args);
109 + static void dbg(
String fmt,
Object... args) {
110 + System.err.print(
"[DBG]: ");
111 + System.err.printf(fmt, args);
112 + System.err.println();
115 + static Throwable exit() {
118 + return new Throwable();
121 + static String emphasize_global(
String message) {
122 + return "\033[4m" + message
+ "\033[0m";
125 + static String emphasize_local(
String message) {
126 + return "\033[3m" + message
+ "\033[0m";
129 + static Throwable fail(
String message,
Object... arguments) {
130 + err.printf(message, arguments);
133 + return new Throwable();
136 + static Throwable fail() {
139 + return new Throwable();
tools/install_wezterm_terminfo.sh
Deleteddeleted file mode 100755+0 / −4 text lines
2 - && curl -o
"$tempfile" https://raw.githubusercontent.com/wez/wezterm/main/termwiz/data/wezterm.terminfo \
3 - && tic -x -o ~/.terminfo
"$tempfile" \
tools/nerd-font.sh
Deleteddeleted file mode 100644+0 / −29 text lines
12 -fonts_dir
="${HOME}/.local/share/fonts" 14 -if [[ ! -d
"$fonts_dir" ]]; then 15 - mkdir -p
"$fonts_dir" 18 -for 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" 27 -find
"$fonts_dir" -name
'*Windows Compatible*' -delete
tools/parsing-equals-test.nu
Deleteddeleted file mode 100644+0 / −45 text lines
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
9 - assert-is-a { [
""] } list<string>
10 - assert-is-a { [
"="] } list<string>
11 - assert-is-a { [
"-"] } list<string>
12 - 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>
29 - expected_type: string
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)" 37 - msg: $
"(char cloud)\t(ansi red_bold)FAIL(ansi reset)",
39 - text: $
"expected a `($expected_type)` but got a `($actual_type)`",
new file mode 100644+55 / −0 text lines
2 +asm-cli-rust;
asm-cli-rust;
--git https://github.com/cch123/asm-cli-rust 8 +cargo-update;
cargo-install-update 21 +jj-cli;
jj;
--locked --bin jj 27 +lychee;
lychee;
--locked --no-default-features --features rustls-tls,email-check 43 +selene;
selene;
--no-default-features 45 +stylua;
stylua;
--features lua52 53 +yazi-cli;
ya;
--locked 54 +yazi-fm;
yazi;
--locked tools/vivid_themes.nu
Deleteddeleted file mode 100755+0 / −14 text lines
8 - print $
"theme: (ansi black_bold)($theme)(ansi reset)" 9 - with-env { LS_COLORS: (vivid generate
$theme) } {
tools/wezterm_terminfo.sh
Addednew file mode 100755+4 / −0 text lines
2 + && curl -o
"$tempfile" https://raw.githubusercontent.com/wez/wezterm/main/termwiz/data/wezterm.terminfo \
3 + && tic -x -o ~/.terminfo
"$tempfile" \
+7 / −4 text lines
14 14 ~/.config/nushell/env.nu
17 -~/.config/nushell/modules
17 +~/.config/nushell/login.nu
20 -~/.config/nushell/plugin.nu
19 +nushell/gen-aliases.nu
20 +~/.config/nushell/gen-aliases.nu
23 +~/.config/nushell/scripts
22 25 icc/thinkpad_x230.icc
23 26 ~/.config/icc/thinkpad_x230.icc