repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

nushell: removed unused config code

301c6146c13ef7f4c77e0deef611494b754d96e1

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (9)

+10 / −281 text lines

Diff layout

neovim/lazy-lock.json

Modified

+8 / −7 text lines

22 "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
33 "LuaSnip": { "branch": "master", "commit": "8ae1dedd988eb56441b7858bd1e8554dfadaa46d" },
44 "actions-preview.nvim": { "branch": "master", "commit": "5c240e6356156b72cfbf7c05feefadae61d7a06f" },
5 "auto-dark-mode.nvim": { "branch": "master", "commit": "76e8d40d1e1544bae430f739d827391cbcb42fcc" },
56 "better-escape.nvim": { "branch": "master", "commit": "7e86edafb8c7e73699e0320f225464a298b96d12" },
67 "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
78 "cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" },
3132 "mini.colors": { "branch": "main", "commit": "f64963332f7fcb45c8dfcc243f682a9a0fb9935d" },
3233 "mini.starter": { "branch": "main", "commit": "ce222a5b6de50a9963c1eb62aa16ec6d5efca7ee" },
3334 "mkdir.nvim": { "branch": "main", "commit": "c55d1dee4f099528a1853b28bb28caa802eba217" },
34 "neodev.nvim": { "branch": "main", "commit": "3157f2e876fd6223d36cfa76bee4709247d62fa5" },
35 "neodev.nvim": { "branch": "main", "commit": "84e0290f5600e8b89c0dfcafc864f45496a53400" },
3536 "neogen": { "branch": "main", "commit": "70127baaff25611deaf1a29d801fc054ad9d2dc1" },
3637 "nrpattern.nvim": { "branch": "master", "commit": "f862ce687761078ef3155688151c55f69d28453e" },
3738 "nui.nvim": { "branch": "main", "commit": "c3c7fd618dcb5a89e443a2e1033e7d11fdb0596b" },
3839 "nvim-autopairs": { "branch": "master", "commit": "c6139ca0d5ad7af129ea6c89cb4c56093f2c034a" },
3940 "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" },
4041 "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" },
41 "nvim-genghis": { "branch": "main", "commit": "d04dbfe57b0ae908ba8e397962a1fcef98ca9fd9" },
42 "nvim-genghis": { "branch": "main", "commit": "8613fc1b43db6cc761733b3630eabff9e86296f7" },
4243 "nvim-gomove": { "branch": "main", "commit": "2b44ae7ac0804f4e3959228122f7c85bef1964e3" },
4344 "nvim-jdtls": { "branch": "master", "commit": "a4746791876166dc146eae573a1b49d24a6652e7" },
4445 "nvim-lastplace": { "branch": "main", "commit": "0bb6103c506315044872e0f84b1f736c4172bb20" },
4546 "nvim-neoclip.lua": { "branch": "main", "commit": "798cd0592a81c185465db3a091a0ff8a21af60fd" },
4647 "nvim-spectre": { "branch": "master", "commit": "e7db8ebca7fd0a604027ebf85acee52f6642c91c" },
47 "nvim-surround": { "branch": "main", "commit": "8f2af76134f37058dc4c27a24bc5f86c9cae76dc" },
48 "nvim-surround": { "branch": "main", "commit": "84a26afce16cffa7e3322cfa80a42cddf60616eb" },
4849 "nvim-tree.lua": { "branch": "master", "commit": "d52fdeb0a300ac42b9cfa65ae0600a299f8e8677" },
49 "nvim-treesitter": { "branch": "master", "commit": "db12bd416e2764420047e4a5d6b96fe44e4377d5" },
50 "nvim-treesitter-textobjects": { "branch": "master", "commit": "7f00d94543f1fd37cab2afa2e9a6cd54e1c6b9ef" },
50 "nvim-treesitter": { "branch": "master", "commit": "84daea50b1e53bce085b27fe44204708fc8b1d96" },
51 "nvim-treesitter-textobjects": { "branch": "master", "commit": "95933e762e28f9d38b572d65e7e4da9d2f4d90cb" },
5152 "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" },
5253 "nvim-ts-context-commentstring": { "branch": "main", "commit": "7ab799a9792f7cf3883cf28c6a00ad431f3d382a" },
5354 "nvim-web-devicons": { "branch": "master", "commit": "0bb67ef952ea3eb7b1bac9c011281471d99a27bc" },
5657 "persistence.nvim": { "branch": "main", "commit": "4982499c1636eac254b72923ab826ee7827b3084" },
5758 "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
5859 "plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" },
59 "schemastore.nvim": { "branch": "main", "commit": "a93078f016d3216f4ab4e4c65306b65212314d8d" },
60 "schemastore.nvim": { "branch": "main", "commit": "9bc9a3a19dc6047d79d6073082f3b0deb7002c99" },
6061 "specs.nvim": { "branch": "main", "commit": "2743e412bbe21c9d73954c403d01e8de7377890d" },
6162 "speedtyper.nvim": { "branch": "main", "commit": "2d158eed4c753995b0501a3a7a72464fbb213e3d" },
6263 "ssr.nvim": { "branch": "main", "commit": "bb323ba621ac647b4ac5638b47666e3ef3c279e1" },
7374 "virt-column.nvim": { "branch": "master", "commit": "b62b4ef0774d19452d4ed18e473e824c7a756f2f" },
7475 "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" },
7576 "zen-mode.nvim": { "branch": "main", "commit": "78557d972b4bfbb7488e17b5703d25164ae64e6a" }
76}
77}No final newline

nushell/config.nu

Modified

+1 / −5 text lines

55use aliases.nu *
66use todo.nu
77use openssl.nu *
8use git.nu *
9use pacnew.nu
108use syncthing.nu
1210# for more information on themes see
7977 use_grid_icons: true
8078 footer_mode: "auto" # always, never, number_of_rows, auto
8179 completions: {
82
8381 quick: true # set this to false to prevent auto-selecting completions when only one remains
8482 partial: true # set this to false to prevent partial filling of the prompt
8583 }
285283# must be done, after defining config, since zoxide mutates it
286284use zoxide.nu *
288overlay use coreutils.nu

nushell/modules/aliases.nu

Modified

+0 / −3 text lines

4444export alias aes = java ($env.DOTFILES + /tools/ + aes.java)
4545export alias download = java ($env.DOTFILES + /tools/ + download.java)
4646export alias download_jar = java ($env.DOTFILES + /tools/ + download_jar.java)
47
48# systemd
49export alias userctl = systemctl --user

nushell/modules/coreutils.nu

Deleted
deleted file mode 100644

+0 / −93 text lines

1export def coreutils-check [] {
2 # assert rust coreutils exist
3 use std assert
4 assert (not (which coreutils | is-empty))
5}
6
7# nu builtins are commented out but not forgotten about
8export alias b2sum = coreutils b2sum
9export alias b3sum = coreutils b3sum
10export alias base32 = coreutils base32
11export alias base64 = coreutils base64
12export alias basename = coreutils basename
13export alias basenc = coreutils basenc
14export alias cat = coreutils cat
15export alias cksum = coreutils cksum
16export alias comm = coreutils comm
17# export alias cp = coreutils cp
18export alias csplit = coreutils csplit
19export alias cut = coreutils cut
20# export alias date = coreutils date
21export alias dd = coreutils dd
22export alias df = coreutils df
23export alias dir = coreutils dir
24export alias dircolors = coreutils dircolors
25export alias dirname = coreutils dirname
26# export alias du = coreutils du
27# export alias echo = coreutils echo
28# export alias env = coreutils env
29export alias expand = coreutils expand
30export alias expr = coreutils expr
31export alias factor = coreutils factor
32# export alias false = coreutils false
33# export alias fmt = coreutils fmt
34export alias fold = coreutils fold
35export alias hashsum = coreutils hashsum
36export alias head = coreutils head
37# export alias join = coreutils join
38export alias link = coreutils link
39export alias ln = coreutils ln
40# export alias ls = coreutils ls
41export alias md5sum = coreutils md5sum
42export alias mkdir = coreutils mkdir
43export alias mktemp = coreutils mktemp
44export alias more = coreutils more
45# export alias mv = coreutils mv
46export alias nl = coreutils nl
47export alias numfmt = coreutils numfmt
48export alias od = coreutils od
49export alias paste = coreutils paste
50export alias pr = coreutils pr
51export alias printenv = coreutils printenv
52export alias printf = coreutils printf
53export alias ptx = coreutils ptx
54export alias pwd = coreutils pwd
55export alias readlink = coreutils readlink
56export alias realpath = coreutils realpath
57export alias relpath = coreutils relpath
58# export alias rm = coreutils rm
59export alias rmdir = coreutils rmdir
60# export alias seq = coreutils seq
61export alias sha1sum = coreutils sha1sum
62export alias sha224sum = coreutils sha224sum
63export alias sha256sum = coreutils sha256sum
64export alias sha3 = coreutils sha3-224sum
65export alias sha3 = coreutils sha3-256sum
66export alias sha3 = coreutils sha3-384sum
67export alias sha3 = coreutils sha3-512sum
68export alias sha384sum = coreutils sha384sum
69export alias sha3sum = coreutils sha3sum
70export alias sha512sum = coreutils sha512sum
71export alias shake128sum = coreutils shake128sum
72export alias shake256sum = coreutils shake256sum
73export alias shred = coreutils shred
74export alias shuf = coreutils shuf
75# export alias sleep = coreutils sleep
76# export alias sort = coreutils sort
77# export alias split = coreutils split
78export alias sum = coreutils sum
79export alias tac = coreutils tac
80export alias tail = coreutils tail
81export alias tee = coreutils tee
82export alias test = coreutils test
83# export alias touch = coreutils touch
84export alias tr = coreutils tr
85# export alias true = coreutils true
86export alias truncate = coreutils truncate
87export alias tsort = coreutils tsort
88export alias unexpand = coreutils unexpand
89# export alias uniq = coreutils uniq
90export alias unlink = coreutils unlink
91export alias vdir = coreutils vdir
92export alias wc = coreutils wc
93export alias yes = coreutils yes

nushell/modules/git.nu

Deleted
deleted file mode 100644

+0 / −59 text lines

1export def github-upload-key [
2 title: string # Name the key, so you will remember what it is used for
3 key: path # Path to the PUBLIC key
4] {
5 if ($key | path exists) {
6 echo (build-string "uploading ssh public key " (ansi gi) $key (ansi reset) " with title " (ansi gb) $title (ansi reset) " to GitHub.")
7 echo (char newline)
8 let encrypted_token_path = (build-string $env.DOTFILES / tresor / 4cef0ce3-da3a-4f16-9412-2d094b4f7445)
9 let decrypted_token_path = (build-string $env.DOTFILES / tresor / gh_token)
10 aes decrypt $encrypted_token_path $decrypted_token_path
11 let token = (open --raw $decrypted_token_path)
12 let key_content = (open --raw $key)
13 rm -f $decrypted_token_path
14 let result = (do -i { xh --bearer $token https://api.github.com/user/keys (build-string title = $title) (build-string key = $key_content) | from json})
15 if ($result | has-column? errors) {
16 let message = ($result | get message)
17 let url = ($result | get documentation_url)
18 let errors = ($result | get errors)
19 echo (build-string (ansi rb) $message (ansi reset) (char newline))
20 echo (char newline)
21 $errors | each {
22 | it |
23 let resource = ($it | get resource)
24 let code = ($it | get code)
25 let field = ($it | get field)
26 let message = ($it | get message)
27 echo (build-string (ansi ui) $resource : $code : $field ": " (ansi rb) $message (ansi reset) (char newline))
28 }
29 echo (build-string "Further information: " (ansi yi) $url (ansi reset) (char newline))
30 } else {
31 let id = ($result | get id)
32 let key = ($result | get key)
33 let title = ($result | get title)
34 let created_at = ($result | get created_at)
35 echo (build-string "[" ID : $id "]" " key with title " (ansi gb) $title (ansi reset) " was created at " (ansi yi) $created_at (ansi reset) "." (char newline) )
36 echo (build-string (ansi wu) "PUBLIC SSH KEY:" (ansi reset))
37 echo (char newline)
38 echo ($key | ansi gradient --fgstart "0xaefe9f" --fgend "0xfefefe")
39 echo (char newline)
40 }
41 } else {
42 echo (build-string "key " (ansi rb) $key (ansi reset) " not found!")
43 echo (char newline)
44 }
45}
47# Shows git log in a pretty table
48export def glog [
49 ...rest: string # Extra arguments to git log
50] {
51 git log --pretty=%h»¦«%s»¦«%aN»¦«%aE»¦«%aD -n 25 $rest | lines | split column "»¦«" commit subject name email date | update date { || get date | into datetime } | sort-by date
52}
54# Show the effective configuration of git
55export def git-effective-config [] {
56 git config --list --show-origin
57}
59export alias ghead = git rev-parse HEAD

nushell/modules/openssl.nu

Modified

+1 / −1 text lines

33 email: string # Identifier for the COMMENT section of the key
44] {
55 ssh-keygen -t ed25519 -C $email
6}No final newline
6}

nushell/modules/pacnew.nu

Deleted
deleted file mode 100644

+0 / −27 text lines

1def to_original [] { str replace .pacnew '' }
2
3# Looks for *.pacnew files that need merging.
4# If found, start a merge in meld for each file.
5export def main [] {
6 let pacnew_to_merge = ( fd '.*\.pacnew$' /etc | sk -0 -1 | str trim )
7 if ( $pacnew_to_merge | empty? ) {
8 echo "No pacnew file to merge"
9 } else {
10 let original = ( $pacnew_to_merge | to_original )
11 let pacnew_tmp = "/tmp/" + ( $pacnew_to_merge | path basename )
12 let original_tmp = "/tmp/" + ( $original | path basename )
13 cp $pacnew_to_merge $pacnew_tmp
14 cp $original $original_tmp
15 meld --label $original $original_tmp --label $pacnew_to_merge $pacnew_tmp
16 let success = ( input "Merged? [yN] " )
17 if ( $success | str downcase | str contains 'y' ) {
18 echo $"Merged ($original) with ($pacnew_to_merge)"
19 doas mv $original_tmp $original
20 doas rm $pacnew_to_merge
21 } else {
22 echo $"Merge of ($original) aborted."
23 rm $original_tmp
24 }
25 rm $pacnew_tmp
26 }
27}No final newline

nushell/modules/starship.nu

Deleted
deleted file mode 100644

+0 / −39 text lines

1# this file is both a valid
2# - overlay which can be loaded with `overlay use starship.nu`
3# - module which can be used with `use starship.nu`
4# - script which can be used with `source starship.nu`
5export-env { load-env {
6 STARSHIP_SHELL: "nu"
7 STARSHIP_SESSION_KEY: (random chars -l 16)
8 PROMPT_MULTILINE_INDICATOR: (
9 ^/home/oli/.cargo/bin/starship prompt --continuation
10 )
12 # Does not play well with default character module.
13 # TODO: Also Use starship vi mode indicators?
14 PROMPT_INDICATOR: ""
16 PROMPT_COMMAND: {||
17 # jobs are not supported
18 (
19 ^/home/oli/.cargo/bin/starship prompt
20 --cmd-duration $env.CMD_DURATION_MS
21 $"--status=($env.LAST_EXIT_CODE)"
22 --terminal-width (term size).columns
23 )
24 }
26 config: ($env.config? | default {} | merge {
27 render_right_prompt_on_last_line: true
28 })
30 PROMPT_COMMAND_RIGHT: {||
31 (
32 ^/home/oli/.cargo/bin/starship prompt
33 --right
34 --cmd-duration $env.CMD_DURATION_MS
35 $"--status=($env.LAST_EXIT_CODE)"
36 --terminal-width (term size).columns
37 )
38 }
39}}

nushell/modules/svn.nu

Deleted
deleted file mode 100644

+0 / −47 text lines

1def get-item-status-count [
2 svn_status: table # svn status table from xml
3 item_status_filter: string # the path item status to count
4] {
5 let target_status_count = ( $svn_status | get status.children.target.children.entry.children.wc-status.attributes | compact | flatten | flatten | where item == $item_status_filter | length )
6 # there will always be a "target" node, but "changelist" is optional
7 let changelist_status_count = ( $svn_status | get --ignore-errors status.children.changelist.children.entry.children.wc-status.attributes | compact | flatten | flatten | where item == $item_status_filter | length )
8 $target_status_count + $changelist_status_count
9}
11# Aggregates the output of `svn status` and `svn info` into a table.
12# This command operates in the current directory.
13# Analog to gstat for svn.
14export def --env svnstat [
15 ...path: string # optional paths to get svn status from. If empty, the current directory is assumed.
16] {
17 # the svn info and status commands can handle multiple input paths.
18 # TODO empty values, when not in svn directory
19 let svn_status = (^svn status --xml $path | from xml)
20 let svn_info = (^svn info --xml $path | from xml)
21 {
22 "path": ( $svn_info | get info.children.entry.attributes.path | path expand )
23 "working_copy_root_path": ( $svn_info | get info.children.entry.children.wc-info.children.wcroot-abspath.children | flatten | flatten | flatten | compact )
24 "url": ( $svn_info | get info.children.entry.children.url.children | flatten | flatten | compact )
25 "relative_url": ( $svn_info | get info.children.entry.children.relative-url.children | flatten | flatten | compact )
26 "repository_root": ( $svn_info | get info.children.entry.children.repository.children.root.children | flatten | flatten | flatten | compact )
27 "repository_uuid": ( $svn_info | get info.children.entry.children.repository.children.uuid.children | flatten | flatten | flatten | compact )
28 "revision": ( $svn_info | get info.children.entry.attributes.revision )
29 "node_kind": ( $svn_info | get info.children.entry.attributes.kind )
30 "schedule": ( $svn_info | get info.children.entry.children.wc-info.children.schedule.children | flatten | flatten | flatten | compact )
31 "last_changed_author": ( $svn_info | get info.children.entry.children.commit.children.author.children | flatten | flatten | flatten | compact )
32 "last_changed_rev": ( $svn_info | get info.children.entry.children.commit.attributes.revision | flatten | compact )
33 "last_changed_date": ( $svn_info | get info.children.entry.children.commit.children.date.children | flatten | flatten | flatten | compact| into datetime )
34 "added": ( get-item-status-count $svn_status "added" )
35 "conflicted": "TODO"
36 "deleted": ( get-item-status-count $svn_status "deleted" )
37 "ignored": ( get-item-status-count $svn_status "ignored" )
38 "modified": ( get-item-status-count $svn_status "modified" )
39 "replaced": "TODO"
40 "unversioned_external": "TODO"
41 "unversioned": ( get-item-status-count $svn_status "unversioned" )
42 "missing": ( get-item-status-count $svn_status "missing" )
43 "obstructed": "TODO"
44 "tree_conflicts": ( $svn_status | get --ignore-errors status.children.target.children.entry.children.wc-status.attributes.tree-conflicted | flatten | flatten | compact | length)
45 "changelists": ( $svn_status | get --ignore-errors status.children.changelist | compact | flatten | get --ignore-errors name )
46 }
47}