repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

Update to nushell 0.77

f5f43cb0139c2c850e0103c192b930635c63d6ea

Oliver Krylow <o.krylow@isp-insoft.de> ·

unsigned

Browse filesCompare with HEAD

Configuration format changes and some new syntax.

Changed files (8)

nushell/config.nu

Modified
3 3 # Nushell Config File
4 4 use table.nu *
5 5 use os.nu *
6 6 use prompt.nu *
7 7 use aliases.nu *
8 -use todo.nu *
8 +use todo.nu
9 9 use git.nu *
10 10 use svn.nu *
11 11 use openssl.nu *
12 -use pacnew.nu *
12 +use pacnew.nu
14 14 # CUSTOM COMPLETIONS
15 15 use svn-completions.nu *
68 68 # The default config record. This is where much of your global configuration is setup.
69 69 let-env config = {
70 70 show_banner: false
71 - filesize_metric: false
72 - table_mode: light # basic, compact, compact_double, light, thin, with_love, rounded, reinforced, heavy, none, other
73 - use_ls_colors: true
74 - rm_always_trash: true
71 + table: {
72 + mode: light # basic, compact, compact_double, light, thin, with_love, rounded, reinforced, heavy, none, other
73 + }
74 + ls: {
75 + use_ls_colors: true
76 + clickable_links: true
77 + }
78 + rm: {
79 + always_trash: true
80 + }
81 + cd: {
82 + abbreviations: true
83 + }
75 84 color_config: $default_theme
76 85 use_grid_icons: true
77 86 footer_mode: "auto" # always, never, number_of_rows, auto
78 - quick_completions: true # set this to false to prevent auto-selecting completions when only one remains
79 - partial_completions: true # set this to false to prevent partial filling of the prompt
87 + completions: {
89 + quick: true # set this to false to prevent auto-selecting completions when only one remains
90 + partial: true # set this to false to prevent partial filling of the prompt
91 + }
80 92 float_precision: 2
81 93 use_ansi_coloring: true
82 - filesize_format: "auto" # b, kb, kib, mb, mib, gb, gib, tb, tib, pb, pib, eb, eib, zb, zib, auto
94 + filesize: {
95 + metric: false
96 + format: "auto" # b, kb, kib, mb, mib, gb, gib, tb, tib, pb, pib, eb, eib, zb, zib, auto
97 + }
83 98 edit_mode: emacs # emacs, vi
84 - max_history_size: 10000
85 - sync_history_on_enter: true # Enable to share the history between multiple sessions, else you have to close the session to persist history to file
99 + history: {
100 + file_format: "plaintext"
101 + max_size: 10000
102 + sync_on_enter: true # Enable to share the history between multiple sessions, else you have to close the session to persist history to file
86 104 menus: [
87 105 # Configuration for default nushell menus
88 106 # Note the lack of source parameter

nushell/modules/aliases.nu

Modified
5 5 export alias look = xplr
6 6 export alias browse = firefox
7 7 export alias edit = hx
8 -export alias code = code
10 9 # TODO: HOST SPECIFIC ALIASES
11 10 # I do not see a way right now the have different aliases per host with nu.

nushell/modules/pacnew.nu

Modified
2 2 def to_original [] { str replace .pacnew '' }
4 4 # Looks for *.pacnew files that need merging.
5 5 # If found, start a merge in meld for each file.
6 -export def pacnew [] {
6 +export def main [] {
7 7 let pacnew_to_merge = ( fd '.*\.pacnew$' /etc | sk -0 -1 | str trim )
8 8 if ( $pacnew_to_merge | empty? ) {
9 9 echo "No pacnew file to merge"

nushell/modules/prompt.nu

Modified
20 20 def set-window-title [] {
21 21 # normalize path
22 22 let pwd = ( $env.PWD | path expand )
23 - let icon = if (icons | any path == $pwd) { ( icons | where path == $pwd | get icon.0 ) } else { $"(char nf_folder1)" }
23 + let icon = if (icons | any { |icon| $icon.path == $pwd } ) { ( icons | where path == $pwd | get icon.0 ) } else { $"(char nf_folder1)" }
24 24 # Some terminals freeze, if they do not support this OSC
25 - if (env | any name == TERM_PROGRAM) && $env.TERM_PROGRAM == WezTerm {
25 + if ($env | get -i TERM_PROGRAM) == WezTerm {
26 26 echo ([ (ansi title) $icon " " ( $pwd | path basename ) (ansi reset) ] | str collect)

nushell/modules/table.nu

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

nushell/modules/todo.nu

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

nushell/modules/zoxide.nu

Modified
24 24 export def-env __zoxide_z [...rest:string] {
25 25 # `z -` does not work yet, see https://github.com/nushell/nushell/issues/4769
26 26 let arg0 = ($rest | append '~').0
27 - let path = if (($rest | length) <= 1) && ($arg0 == '-' || ($arg0 | path expand | path type) == dir) {
27 + let path = if (($rest | length) <= 1) and ($arg0 == '-' or ($arg0 | path expand | path type) == dir) {
28 28 $arg0
29 29 } else {
30 30 (zoxide query --exclude $env.PWD -- $rest | str trim -r -c "\n")

tools/cargo-tools.nu

Modified
78 78 # topgrade has already updated the repo by this point, so that we never hit this case.
79 79 # needs alternative idea
80 80 git pull
81 - let toolchain = (if $nu.os-info.family == "windows" {"+stable-mvsc"} else {"+stable"})
81 + let toolchain = (if $nu.os-info.family == "windows" {"+stable-msvc"} else {"+stable"})
82 82 cargo $toolchain install --path helix-term --profile opt
83 83 hx --grammar fetch | ignore
84 84 hx --grammar build | ignore