Skip to content

Commit 7acd811

Browse files
yilisharcsibhagwan
authored andcommitted
feat(marks): Implement split actions for marks picker
1 parent 37a2452 commit 7acd811

3 files changed

Lines changed: 22 additions & 1 deletion

File tree

lua/fzf-lua/actions.lua

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,21 @@ M.goto_mark = function(selected)
584584
-- vim.fn.feedkeys(string.format("'%s", mark))
585585
end
586586

587+
M.goto_mark_tabedit = function(selected)
588+
vim.cmd("tab split")
589+
M.goto_mark(selected)
590+
end
591+
592+
M.goto_mark_split = function(selected)
593+
vim.cmd("split")
594+
M.goto_mark(selected)
595+
end
596+
597+
M.goto_mark_vsplit = function(selected)
598+
vim.cmd("vsplit")
599+
M.goto_mark(selected)
600+
end
601+
587602
M.mark_del = function(selected)
588603
local win = utils.CTX().winid
589604
local buf = utils.CTX().bufnr

lua/fzf-lua/config.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1037,8 +1037,11 @@ M._action_to_helpstr = {
10371037
[actions.exec_menu] = "exec-menu",
10381038
[actions.search] = "edit-search",
10391039
[actions.search_cr] = "exec-search",
1040-
[actions.goto_mark] = "goto-mark",
10411040
[actions.goto_jump] = "goto-jump",
1041+
[actions.goto_mark] = "goto-mark",
1042+
[actions.goto_mark_split] = "goto-mark-split",
1043+
[actions.goto_mark_vsplit] = "goto-mark-vsplit",
1044+
[actions.goto_mark_tabedit] = "goto-mark-tabedit",
10421045
[actions.keymap_apply] = "keymap-apply",
10431046
[actions.keymap_edit] = "keymap-edit",
10441047
[actions.keymap_split] = "keymap-split",

lua/fzf-lua/defaults.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,6 +1195,9 @@ M.defaults.marks = {
11951195
fzf_opts = { ["--no-multi"] = true },
11961196
actions = {
11971197
["enter"] = actions.goto_mark,
1198+
["ctrl-s"] = actions.goto_mark_split,
1199+
["ctrl-v"] = actions.goto_mark_vsplit,
1200+
["ctrl-t"] = actions.goto_mark_tabedit,
11981201
["ctrl-x"] = { fn = actions.mark_del, reload = true }
11991202
},
12001203
previewer = { _ctor = previewers.builtin.marks },

0 commit comments

Comments
 (0)