Skip to content

Open multiple files with Telescope #562

Closed Answered by NotAShelf
100thFlow asked this question in Q&A
Discussion options

You must be logged in to vote

There are multiple ways you can approach this, but I'd use mkLuaInline and setupOpts.

{
  vim.telescope.setupOpts = {
    defaults.mappings.i."<CR>" = lib.mkLuaInline ''
        local select_one_or_multi = function(prompt_bufnr)
        local picker = require('telescope.actions.state').get_current_picker(prompt_bufnr)
        local multi = picker:get_multi_selection()
        if not vim.tbl_isempty(multi) then
          require('telescope.actions').close(prompt_bufnr)
          for _, j in pairs(multi) do
            if j.path ~= nil then
              vim.cmd(string.format('%s %s', 'edit', j.path))
            end
          end
        else
          require('telescope.actions').select_d…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by 100thFlow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants