nu: Add fuzzy tab completion, remove nvim hardcoding

Removed the buffer editor hardcoding to 'nvim', should use the EDITOR
env var instead.

Added the (currently undocumented?) config option to enable fuzzy
completion matching - essentially enables exactly the behavior the
'fzf-tab-complete' plugin does for zsh, only natively in the nushell
program.

See: https://github.com/nushell/nushell/issues/1275#issuecomment-2964573062
This commit is contained in:
Marty Oehme 2025-10-18 12:58:43 +02:00
parent 07d36e3132
commit ae5470a5d8
Signed by: Marty
GPG key ID: 4E535BC19C61886E

View file

@ -9,10 +9,11 @@
# #
# This file is loaded after env.nu and before login.nu # This file is loaded after env.nu and before login.nu
# #
$env.config.show_banner = false # TODO: FOR TESTING PURPOSES $env.config.show_banner = false
$env.config.edit_mode = "vi" $env.config.edit_mode = "vi"
$env.config.buffer_editor = "nvim" # Enable same behavior as fzf-tab-complete for zsh
$env.config.completions.algorithm = "fuzzy"
$env.PROMPT_INDICATOR = "" $env.PROMPT_INDICATOR = ""
$env.PROMPT_MULTILINE_INDICATOR = "::: " $env.PROMPT_MULTILINE_INDICATOR = "::: "
@ -28,7 +29,7 @@ $env.PROMPT_INDICATOR_VI_NORMAL = ""
# Temporary workaround # Temporary workaround
$env.config.cursor_shape.vi_insert = "line" $env.config.cursor_shape.vi_insert = "line"
$env.config.cursor_shape.vi_normal = "block" $env.config.cursor_shape.vi_normal = "block"
# TODO: Currently recommended starship install. Change when it changes. # load starship prompt
mkdir ($nu.data-dir | path join "vendor/autoload") mkdir ($nu.data-dir | path join "vendor/autoload")
starship init nu | save -f ($nu.data-dir | path join "vendor/autoload/starship.nu") starship init nu | save -f ($nu.data-dir | path join "vendor/autoload/starship.nu")
# load atuin history # load atuin history