lines|blines: added selection/multi-select to quickfix

main
bhagwan 2 years ago
parent 0e775b075b
commit fa69ad7b13

@ -646,7 +646,11 @@ require'fzf-lua'.setup {
["--nth"] = '2..',
["--tiebreak"] = 'index',
},
-- actions inherit from 'actions.buffers'
-- actions inherit from 'actions.buffers' and merge
actions = {
["default"] = { actions.buf_edit_or_qf },
["alt-q"] = { actions.buf_sel_to_qf }
},
},
blines = {
previewer = "builtin", -- set to 'false' to disable
@ -658,10 +662,12 @@ require'fzf-lua'.setup {
['--delimiter'] = "'[\\]:]'",
["--with-nth"] = '2..',
["--tiebreak"] = 'index',
-- disable multi-select, set to false to disable
["--no-multi"] = '',
},
-- actions inherit from 'actions.buffers'
-- actions inherit from 'actions.buffers' and merge
actions = {
["default"] = { actions.buf_edit_or_qf },
["alt-q"] = { actions.buf_sel_to_qf }
},
},
tags = {
prompt = 'Tags ',

@ -691,7 +691,11 @@ Consult the list below for available settings:
["--nth"] = '2..',
["--tiebreak"] = 'index',
},
-- actions inherit from 'actions.buffers'
-- actions inherit from 'actions.buffers' and merge
actions = {
["default"] = { actions.buf_edit_or_qf },
["alt-q"] = { actions.buf_sel_to_qf }
},
},
blines = {
previewer = "builtin", -- set to 'false' to disable
@ -703,10 +707,12 @@ Consult the list below for available settings:
['--delimiter'] = "'[\\]:]'",
["--with-nth"] = '2..',
["--tiebreak"] = 'index',
-- disable multi-select, set to false to disable
["--no-multi"] = '',
},
-- actions inherit from 'actions.buffers'
-- actions inherit from 'actions.buffers' and merge
actions = {
["default"] = { actions.buf_edit_or_qf },
["alt-q"] = { actions.buf_sel_to_qf }
},
},
tags = {
prompt = 'Tags ',

@ -281,6 +281,18 @@ M.buf_switch_or_edit = function(...)
M.buf_edit(...)
end
M.buf_sel_to_qf = function(selected, opts)
return M.file_sel_to_qf(selected, opts)
end
M.buf_edit_or_qf = function(selected, opts)
if #selected>1 then
return M.buf_sel_to_qf(selected, opts)
else
return M.buf_edit(selected, opts)
end
end
M.colorscheme = function(selected)
local colorscheme = selected[1]
vim.cmd("colorscheme " .. colorscheme)

@ -363,6 +363,10 @@ M.globals.lines = {
["--tiebreak"] = 'index',
},
_actions = function() return M.globals.actions.buffers end,
actions = {
["default"] = actions.buf_edit_or_qf,
["alt-q"] = actions.buf_sel_to_qf
},
}
M.globals.blines = {
previewer = M._default_previewer_fn,
@ -375,9 +379,12 @@ M.globals.blines = {
['--delimiter'] = "'[:]'",
["--with-nth"] = '2..',
["--tiebreak"] = 'index',
["--no-multi"] = '',
},
_actions = function() return M.globals.actions.buffers end,
actions = {
["default"] = actions.buf_edit_or_qf,
["alt-q"] = actions.buf_sel_to_qf
},
}
M.globals.tags = {
previewer = { _ctor = previewers.builtin.tags },
@ -828,6 +835,8 @@ M._action_to_helpstr = {
[actions.file_switch] = "file-switch",
[actions.file_switch_or_edit] = "file-switch-or-edit",
[actions.buf_edit] = "buffer-edit",
[actions.buf_edit_or_qf] = "buffer-edit-or-qf",
[actions.buf_sel_to_qf] = "buffer-selection-to-qf",
[actions.buf_split] = "buffer-split",
[actions.buf_vsplit] = "buffer-vsplit",
[actions.buf_tabedit] = "buffer-tabedit",

Loading…
Cancel
Save