nu: add dirs integration

This commit is contained in:
Gabriel Arazas 2025-01-29 11:42:30 +08:00
parent 5f0248de65
commit 774fa3b7b1

44
nu/autoload/dirs.nu Normal file
View File

@ -0,0 +1,44 @@
use std/dirs
use std/dirs shells-aliases *
$env.config.keybindings = $env.config.keybindings | append [
{
name: dirs_quickadd
modifier: control
keycode: char_f
mode: [emacs vi_normal vi_insert]
event: {
send: ExecuteHostCommand
cmd: "dirs add .."
}
}
{
name: dirs_drop
modifier: alt
keycode: char_f
mode: [emacs vi_normal vi_insert]
event: {
send: ExecuteHostCommand
cmd: "dirs drop"
}
}
{
name: dirs_prev
modifier: control
keycode: char_h
mode: [emacs vi_normal vi_insert]
event: [
{
send: ExecuteHostCommand
cmd: "dirs prev"
}
{
send: ExecuteHostCommand
cmd: "cd -"
}
]
}
]