summary refs log tree commit diff stats
path: root/user
diff options
context:
space:
mode:
authorAlan Pearce2024-05-18 11:24:20 +0200
committerAlan Pearce2024-05-18 11:24:34 +0200
commit53212e519adee9a72810a63a041fc063b4fcc26c (patch)
tree780ccd5ec6465b3e0557a39c4280364ae09fe14b /user
parent4d649a35f2b26629705845a334dd11ce977eed98 (diff)
downloadnixfiles-53212e519adee9a72810a63a041fc063b4fcc26c.tar.lz
nixfiles-53212e519adee9a72810a63a041fc063b4fcc26c.tar.zst
nixfiles-53212e519adee9a72810a63a041fc063b4fcc26c.zip
fish: add functions to open magit/dired in emacs
Diffstat (limited to 'user')
-rw-r--r--user/settings/fish/functions/dired.fish8
-rw-r--r--user/settings/fish/functions/magit.fish8
2 files changed, 16 insertions, 0 deletions
diff --git a/user/settings/fish/functions/dired.fish b/user/settings/fish/functions/dired.fish
new file mode 100644
index 00000000..97174b35
--- /dev/null
+++ b/user/settings/fish/functions/dired.fish
@@ -0,0 +1,8 @@
+function dired
+    if set --query argv[1]
+        set --function repo $argv[1]
+    else
+        set --function repo $pwd
+    end
+    emacsclient -e "(magit-status \"$argv[1]\")"
+end
diff --git a/user/settings/fish/functions/magit.fish b/user/settings/fish/functions/magit.fish
new file mode 100644
index 00000000..048fd42f
--- /dev/null
+++ b/user/settings/fish/functions/magit.fish
@@ -0,0 +1,8 @@
+function magit
+    if set --query argv[1]
+        set --function repo $argv[1]
+    else
+        set --function repo $pwd
+    end
+    emacsclient -e "(magit-status \"$argv[1]\")"
+end