nushell: removed unused config code
301c6146c13ef7f4c77e0deef611494b754d96e1
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
- Parent 1: 31c5484699c5
bugabingas dorkfiles
301c6146c13ef7f4c77e0deef611494b754d96e1
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
+10 / −281 text lines
+8 / −7 text lines
"actions-preview.nvim": { "branch": "master", "commit": "5c240e6356156b72cfbf7c05feefadae61d7a06f" }, "auto-dark-mode.nvim": { "branch": "master", "commit": "76e8d40d1e1544bae430f739d827391cbcb42fcc" }, "better-escape.nvim": { "branch": "master", "commit": "7e86edafb8c7e73699e0320f225464a298b96d12" }, "neodev.nvim": { "branch": "main", "commit": "3157f2e876fd6223d36cfa76bee4709247d62fa5" }, "neodev.nvim": { "branch": "main", "commit": "84e0290f5600e8b89c0dfcafc864f45496a53400" }, "nrpattern.nvim": { "branch": "master", "commit": "f862ce687761078ef3155688151c55f69d28453e" }, "nvim-autopairs": { "branch": "master", "commit": "c6139ca0d5ad7af129ea6c89cb4c56093f2c034a" }, "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" }, "nvim-genghis": { "branch": "main", "commit": "d04dbfe57b0ae908ba8e397962a1fcef98ca9fd9" }, "nvim-genghis": { "branch": "main", "commit": "8613fc1b43db6cc761733b3630eabff9e86296f7" }, "nvim-neoclip.lua": { "branch": "main", "commit": "798cd0592a81c185465db3a091a0ff8a21af60fd" }, "nvim-surround": { "branch": "main", "commit": "8f2af76134f37058dc4c27a24bc5f86c9cae76dc" }, "nvim-surround": { "branch": "main", "commit": "84a26afce16cffa7e3322cfa80a42cddf60616eb" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "7ab799a9792f7cf3883cf28c6a00ad431f3d382a" }, "nvim-web-devicons": { "branch": "master", "commit": "0bb67ef952ea3eb7b1bac9c011281471d99a27bc" }, "persistence.nvim": { "branch": "main", "commit": "4982499c1636eac254b72923ab826ee7827b3084" }, "schemastore.nvim": { "branch": "main", "commit": "a93078f016d3216f4ab4e4c65306b65212314d8d" }, "schemastore.nvim": { "branch": "main", "commit": "9bc9a3a19dc6047d79d6073082f3b0deb7002c99" },+1 / −5 text lines
+0 / −3 text lines
deleted file mode 100644+0 / −93 text lines
export def coreutils-check [] { # assert rust coreutils exist use std assert assert (not (which coreutils | is-empty))}# nu builtins are commented out but not forgotten aboutexport alias b2sum = coreutils b2sumexport alias b3sum = coreutils b3sumexport alias base32 = coreutils base32export alias base64 = coreutils base64export alias basename = coreutils basenameexport alias basenc = coreutils basencexport alias cat = coreutils catexport alias cksum = coreutils cksumexport alias comm = coreutils comm# export alias cp = coreutils cpexport alias csplit = coreutils csplitexport alias cut = coreutils cut# export alias date = coreutils dateexport alias dd = coreutils ddexport alias df = coreutils dfexport alias dir = coreutils direxport alias dircolors = coreutils dircolorsexport alias dirname = coreutils dirname# export alias du = coreutils du# export alias echo = coreutils echo# export alias env = coreutils envexport alias expand = coreutils expandexport alias expr = coreutils exprexport alias factor = coreutils factor# export alias false = coreutils false# export alias fmt = coreutils fmtexport alias fold = coreutils foldexport alias hashsum = coreutils hashsumexport alias head = coreutils head# export alias join = coreutils joinexport alias link = coreutils linkexport alias ln = coreutils ln# export alias ls = coreutils lsexport alias md5sum = coreutils md5sumexport alias mkdir = coreutils mkdirexport alias mktemp = coreutils mktempexport alias more = coreutils more# export alias mv = coreutils mvexport alias nl = coreutils nlexport alias numfmt = coreutils numfmtexport alias od = coreutils odexport alias paste = coreutils pasteexport alias pr = coreutils prexport alias printenv = coreutils printenvexport alias printf = coreutils printfexport alias ptx = coreutils ptxexport alias pwd = coreutils pwdexport alias readlink = coreutils readlinkexport alias realpath = coreutils realpathexport alias relpath = coreutils relpath# export alias rm = coreutils rmexport alias rmdir = coreutils rmdir# export alias seq = coreutils seqexport alias sha1sum = coreutils sha1sumexport alias sha224sum = coreutils sha224sumexport alias sha256sum = coreutils sha256sumexport alias sha3 = coreutils sha3-224sumexport alias sha3 = coreutils sha3-256sumexport alias sha3 = coreutils sha3-384sumexport alias sha3 = coreutils sha3-512sumexport alias sha384sum = coreutils sha384sumexport alias sha3sum = coreutils sha3sumexport alias sha512sum = coreutils sha512sumexport alias shake128sum = coreutils shake128sumexport alias shake256sum = coreutils shake256sumexport alias shred = coreutils shredexport alias shuf = coreutils shuf# export alias sleep = coreutils sleep# export alias sort = coreutils sort# export alias split = coreutils splitexport alias sum = coreutils sumexport alias tac = coreutils tacexport alias tail = coreutils tailexport alias tee = coreutils teeexport alias test = coreutils test# export alias touch = coreutils touchexport alias tr = coreutils tr# export alias true = coreutils trueexport alias truncate = coreutils truncateexport alias tsort = coreutils tsortexport alias unexpand = coreutils unexpand# export alias uniq = coreutils uniqexport alias unlink = coreutils unlinkexport alias vdir = coreutils vdirexport alias wc = coreutils wcexport alias yes = coreutils yesdeleted file mode 100644+0 / −59 text lines
export def github-upload-key [ title: string # Name the key, so you will remember what it is used for key: path # Path to the PUBLIC key] { if ($key | path exists) { echo (build-string "uploading ssh public key " (ansi gi) $key (ansi reset) " with title " (ansi gb) $title (ansi reset) " to GitHub.") echo (char newline) let encrypted_token_path = (build-string $env.DOTFILES / tresor / 4cef0ce3-da3a-4f16-9412-2d094b4f7445) let decrypted_token_path = (build-string $env.DOTFILES / tresor / gh_token) aes decrypt $encrypted_token_path $decrypted_token_path let token = (open --raw $decrypted_token_path) let key_content = (open --raw $key) rm -f $decrypted_token_path let result = (do -i { xh --bearer $token https://api.github.com/user/keys (build-string title = $title) (build-string key = $key_content) | from json}) if ($result | has-column? errors) { let message = ($result | get message) let url = ($result | get documentation_url) let errors = ($result | get errors) echo (build-string (ansi rb) $message (ansi reset) (char newline)) echo (char newline) $errors | each { | it | let resource = ($it | get resource) let code = ($it | get code) let field = ($it | get field) let message = ($it | get message) echo (build-string (ansi ui) $resource : $code : $field ": " (ansi rb) $message (ansi reset) (char newline)) } echo (build-string "Further information: " (ansi yi) $url (ansi reset) (char newline)) } else { let id = ($result | get id) let key = ($result | get key) let title = ($result | get title) let created_at = ($result | get created_at) echo (build-string "[" ID : $id "]" " key with title " (ansi gb) $title (ansi reset) " was created at " (ansi yi) $created_at (ansi reset) "." (char newline) ) echo (build-string (ansi wu) "PUBLIC SSH KEY:" (ansi reset)) echo (char newline) echo ($key | ansi gradient --fgstart "0xaefe9f" --fgend "0xfefefe") echo (char newline) } } else { echo (build-string "key " (ansi rb) $key (ansi reset) " not found!") echo (char newline) }}# Shows git log in a pretty tableexport def glog [ ...rest: string # Extra arguments to git log] { 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}# Show the effective configuration of gitexport def git-effective-config [] { git config --list --show-origin}export alias ghead = git rev-parse HEAD+1 / −1 text lines
deleted file mode 100644+0 / −27 text lines
def to_original [] { str replace .pacnew '' }# Looks for *.pacnew files that need merging.# If found, start a merge in meld for each file.export def main [] { let pacnew_to_merge = ( fd '.*\.pacnew$' /etc | sk -0 -1 | str trim ) if ( $pacnew_to_merge | empty? ) { echo "No pacnew file to merge" } else { let original = ( $pacnew_to_merge | to_original ) let pacnew_tmp = "/tmp/" + ( $pacnew_to_merge | path basename ) let original_tmp = "/tmp/" + ( $original | path basename ) cp $pacnew_to_merge $pacnew_tmp cp $original $original_tmp meld --label $original $original_tmp --label $pacnew_to_merge $pacnew_tmp let success = ( input "Merged? [yN] " ) if ( $success | str downcase | str contains 'y' ) { echo $"Merged ($original) with ($pacnew_to_merge)" doas mv $original_tmp $original doas rm $pacnew_to_merge } else { echo $"Merge of ($original) aborted." rm $original_tmp } rm $pacnew_tmp }}No final newlinedeleted file mode 100644+0 / −39 text lines
# this file is both a valid# - overlay which can be loaded with `overlay use starship.nu`# - module which can be used with `use starship.nu`# - script which can be used with `source starship.nu`export-env { load-env { STARSHIP_SHELL: "nu" STARSHIP_SESSION_KEY: (random chars -l 16) PROMPT_MULTILINE_INDICATOR: ( ^/home/oli/.cargo/bin/starship prompt --continuation ) # Does not play well with default character module. # TODO: Also Use starship vi mode indicators? PROMPT_INDICATOR: "" PROMPT_COMMAND: {|| # jobs are not supported ( ^/home/oli/.cargo/bin/starship prompt --cmd-duration $env.CMD_DURATION_MS $"--status=($env.LAST_EXIT_CODE)" --terminal-width (term size).columns ) } config: ($env.config? | default {} | merge { render_right_prompt_on_last_line: true }) PROMPT_COMMAND_RIGHT: {|| ( ^/home/oli/.cargo/bin/starship prompt --right --cmd-duration $env.CMD_DURATION_MS $"--status=($env.LAST_EXIT_CODE)" --terminal-width (term size).columns ) }}}deleted file mode 100644+0 / −47 text lines
def get-item-status-count [ svn_status: table # svn status table from xml item_status_filter: string # the path item status to count] { 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 ) # there will always be a "target" node, but "changelist" is optional 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 ) $target_status_count + $changelist_status_count}# Aggregates the output of `svn status` and `svn info` into a table.# This command operates in the current directory.# Analog to gstat for svn.export def --env svnstat [ ...path: string # optional paths to get svn status from. If empty, the current directory is assumed.] { # the svn info and status commands can handle multiple input paths. # TODO empty values, when not in svn directory let svn_status = (^svn status --xml $path | from xml) let svn_info = (^svn info --xml $path | from xml) { "path": ( $svn_info | get info.children.entry.attributes.path | path expand ) "working_copy_root_path": ( $svn_info | get info.children.entry.children.wc-info.children.wcroot-abspath.children | flatten | flatten | flatten | compact ) "url": ( $svn_info | get info.children.entry.children.url.children | flatten | flatten | compact ) "relative_url": ( $svn_info | get info.children.entry.children.relative-url.children | flatten | flatten | compact ) "repository_root": ( $svn_info | get info.children.entry.children.repository.children.root.children | flatten | flatten | flatten | compact ) "repository_uuid": ( $svn_info | get info.children.entry.children.repository.children.uuid.children | flatten | flatten | flatten | compact ) "revision": ( $svn_info | get info.children.entry.attributes.revision ) "node_kind": ( $svn_info | get info.children.entry.attributes.kind ) "schedule": ( $svn_info | get info.children.entry.children.wc-info.children.schedule.children | flatten | flatten | flatten | compact ) "last_changed_author": ( $svn_info | get info.children.entry.children.commit.children.author.children | flatten | flatten | flatten | compact ) "last_changed_rev": ( $svn_info | get info.children.entry.children.commit.attributes.revision | flatten | compact ) "last_changed_date": ( $svn_info | get info.children.entry.children.commit.children.date.children | flatten | flatten | flatten | compact| into datetime ) "added": ( get-item-status-count $svn_status "added" ) "conflicted": "TODO" "deleted": ( get-item-status-count $svn_status "deleted" ) "ignored": ( get-item-status-count $svn_status "ignored" ) "modified": ( get-item-status-count $svn_status "modified" ) "replaced": "TODO" "unversioned_external": "TODO" "unversioned": ( get-item-status-count $svn_status "unversioned" ) "missing": ( get-item-status-count $svn_status "missing" ) "obstructed": "TODO" "tree_conflicts": ( $svn_status | get --ignore-errors status.children.target.children.entry.children.wc-status.attributes.tree-conflicted | flatten | flatten | compact | length) "changelists": ( $svn_status | get --ignore-errors status.children.changelist | compact | flatten | get --ignore-errors name ) }}