mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-02 23:27:45 +00:00
FEATURE: add some fuzzy keybindings (#512)
* add `history`, `directories` and `modules` fuzzy keybindings * add a little README for the bindings
This commit is contained in:
parent
394e625837
commit
c698547b3b
4 changed files with 61 additions and 0 deletions
24
custom-menus/fuzzy/modules.nu
Normal file
24
custom-menus/fuzzy/modules.nu
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
name: fuzzy_module
|
||||
modifier: control
|
||||
keycode: char_u
|
||||
mode: [emacs, vi_normal, vi_insert]
|
||||
event: {
|
||||
send: executehostcommand
|
||||
cmd: '
|
||||
commandline --replace "use "
|
||||
commandline --insert (
|
||||
$env.NU_LIB_DIRS
|
||||
| each {|dir|
|
||||
ls ($dir | path join "**" "*.nu")
|
||||
| get name
|
||||
| str replace $dir ""
|
||||
| str trim -c "/"
|
||||
}
|
||||
| flatten
|
||||
| input list --fuzzy
|
||||
$"Please choose a (ansi magenta)module(ansi reset) to (ansi cyan_underline)load(ansi reset):"
|
||||
)
|
||||
'
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue