summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-03-07 06:31:23 +0800
committerGitHub <noreply@github.com>2024-03-07 06:31:23 +0800
commitf82f577b6dd65c973d96faa2df7682538b517119 (patch)
tree5f0a39a8c9a811e67b790a943ca9f178daf8a17e /scripts
parentd6e12b1f56c7b3437f28e8bce5d1f2b999970f4c (diff)
downloadaichat-f82f577b6dd65c973d96faa2df7682538b517119.tar.gz
feat: add nushell integration (#344)
Diffstat (limited to 'scripts')
-rw-r--r--scripts/shell-integration/integration.nu21
1 files changed, 21 insertions, 0 deletions
diff --git a/scripts/shell-integration/integration.nu b/scripts/shell-integration/integration.nu
new file mode 100644
index 0000000..291f287
--- /dev/null
+++ b/scripts/shell-integration/integration.nu
@@ -0,0 +1,21 @@
+def _aichat_nushell [] {
+ let _prev = (commandline)
+ if ($_prev != "") {
+ print '⌛'
+ commandline edit -r (aichat -e $_prev)
+ }
+}
+
+$env.config.keybindings = ($env.config.keybindings | append {
+ name: aichat_integration
+ modifier: alt
+ keycode: char_e
+ mode: [emacs, vi_insert]
+ event:[
+ {
+ send: executehostcommand,
+ cmd: "_aichat_nushell"
+ }
+ ]
+ }
+) \ No newline at end of file