aboutsummaryrefslogtreecommitdiff
path: root/config_cmd.h.in
diff options
context:
space:
mode:
Diffstat (limited to 'config_cmd.h.in')
-rw-r--r--config_cmd.h.in31
1 files changed, 31 insertions, 0 deletions
diff --git a/config_cmd.h.in b/config_cmd.h.in
index 1ff0509..7c4a9f4 100644
--- a/config_cmd.h.in
+++ b/config_cmd.h.in
@@ -185,3 +185,34 @@ FM_CMD(cmd_bulk_rename,
.config = CMD_MARK_DIR | CMD_MUT | CMD_EXEC,
)
+FM_CMD(cmd_editor,
+ .prompt = CUT_NULL,
+ .left = CUT("kak %m"),
+ .enter = fm_cmd_run,
+ .config = CMD_MUT | CMD_EXEC,
+)
+
+#define PBUFS 256
+/* If you have paths longer than 256 chars I can't help you */
+
+static void
+cmd_gd(struct fm *p)
+{
+ char pbuf[PBUFS];
+ FILE *fzf = popen("fd -t d -u | fzf --algo=v1", "r");
+ fgets(pbuf, PBUFS, fzf);
+ // Not sure why, but the -1 on strlen is required
+ if (pbuf[0] == '/')
+ fm_path_cd(p, pbuf, strlen(pbuf)-1);
+ else
+ fm_path_cd_relative(p, pbuf, strlen(pbuf)-1);
+ pclose(fzf);
+}
+
+//FM_CMD(cmd_gd,
+// .prompt = CUT_NULL,
+// .left = CUT("fd -t d -u | fzf --algo=v1"),
+// .enter = fm_cmd_cd,
+// .config = CMD_MUT | CMD_EXEC,
+//)
+