add quickfixing to telescope

This commit is contained in:
Barak Michener 2022-12-07 14:02:32 -08:00
parent 06a0ac7cc4
commit 5ebe434fbf
2 changed files with 32 additions and 11 deletions

View file

@ -275,16 +275,25 @@ require('trouble').setup {
}
local trouble_telescope = require("trouble.providers.telescope")
local builtin = require 'telescope.builtin'
local sendtoqf = function(loc)
local actions = require('telescope.actions')
actions.send_to_qflist(loc)
builtin.quickfix({ initial_mode = "normal" })
end
require('telescope').setup {
defaults = {
mappings = {
n = {
["q"] = require('telescope.actions').close,
["ff"] = sendtoqf,
["<c-t>"] = trouble_telescope.open_with_trouble,
},
i = {
["<c-t>"] = trouble_telescope.open_with_trouble,
["ff"] = require('telescope.actions').send_to_qflist,
},
},
},
@ -307,10 +316,15 @@ require('telescope').setup {
height = 15,
},
},
quickfix = {
theme = "ivy",
layout_config = {
height = 15,
},
},
},
}
local builtin = require 'telescope.builtin'
local dropdown = require 'telescope.themes'.get_dropdown({
--previewer = false,
@ -376,8 +390,8 @@ require 'nvim-treesitter.configs'.setup {
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
--custom_captures = {
--["generic_type_param"] = "TSCGenericTypeParam",
--["type_identifier"] = "TSCGenericTypeParam",
--["generic_type_param"] = "TSCGenericTypeParam",
--["type_identifier"] = "TSCGenericTypeParam",
--},
},
@ -448,6 +462,12 @@ file_list = function(conf)
builtin.git_files(opt)
end
--quickfix_telescope = function(conf)
--local opt = telescope_ivy
--for k, v in pairs(conf) do opt[k] = v end
--builtin.quickfix(opt)
--end
---
--- My own "where" clause generator for Rust