From 774fa3b7b176ea2eaf9cbc873dcdb3b512a22aae Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Wed, 29 Jan 2025 11:42:30 +0800 Subject: [PATCH] nu: add dirs integration --- nu/autoload/dirs.nu | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 nu/autoload/dirs.nu diff --git a/nu/autoload/dirs.nu b/nu/autoload/dirs.nu new file mode 100644 index 0000000..60b2d2d --- /dev/null +++ b/nu/autoload/dirs.nu @@ -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 -" + } + ] + } +]