summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/_telescope
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2021-05-31 22:20:30 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2021-05-31 22:20:30 +0200
commit7d1e8075b8f156f3f8c300326abf730a1a8f2875 (patch)
tree4fff845d6cd1b66e267ef76dfad122a174f2c7a4 /.config/nvim/lua/_telescope
parent0ce9de258802b9c3259083e6f1ab5739e8e51084 (diff)
Copying of Luke's dots
Diffstat (limited to '.config/nvim/lua/_telescope')
-rw-r--r--.config/nvim/lua/_telescope/init.lua25
1 files changed, 9 insertions, 16 deletions
diff --git a/.config/nvim/lua/_telescope/init.lua b/.config/nvim/lua/_telescope/init.lua
index 744fdbf..497f74d 100644
--- a/.config/nvim/lua/_telescope/init.lua
+++ b/.config/nvim/lua/_telescope/init.lua
@@ -1,4 +1,5 @@
local actions = require('telescope.actions')
+local trouble = require("trouble.providers.telescope")
-- Global remapping
------------------------------
-- '--color=never',
@@ -36,12 +37,15 @@ require('telescope').setup {
buffer_previewer_maker = require'telescope.previewers'.buffer_previewer_maker,
mappings = {
i = {
+ ["<C-c>"] = actions.close,
["<C-j>"] = actions.move_selection_next,
["<C-k>"] = actions.move_selection_previous,
+ ["<c-t>"] = trouble.open_with_trouble,
+ ["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist,
-- To disable a keymap, put [map] = false
-- So, to not map "<C-n>", just put
-- ["<c-x>"] = false,
- ["<esc>"] = actions.close,
+ -- ["<esc>"] = actions.close,
-- Otherwise, just set the mapping to the function that you want it to be.
-- ["<C-i>"] = actions.select_horizontal,
@@ -54,23 +58,12 @@ require('telescope').setup {
},
n = {
["<C-j>"] = actions.move_selection_next,
- ["<C-k>"] = actions.move_selection_previous
+ ["<C-k>"] = actions.move_selection_previous,
+ ["<c-t>"] = trouble.open_with_trouble,
+ ["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist
-- ["<C-i>"] = my_cool_custom_action,
}
}
},
- require'telescope'.setup {
- extensions = {
- media_files = {
- -- filetypes whitelist
- -- defaults to {"png", "jpg", "mp4", "webm", "pdf"}
- filetypes = {"png", "webp", "jpg", "jpeg"},
- find_cmd = "rg" -- find command (defaults to `fd`)
- }
- }
- }
+ extensions = {fzy_native = {override_generic_sorter = false, override_file_sorter = true}}
}
-vim.api.nvim_set_keymap('n', '<leader>ff', '<cmd>lua require("telescope.builtin").find_files()<cr>', { noremap = true, silent = true })
-vim.api.nvim_set_keymap('n', '<leader>fg', '<cmd>lua require("telescope.builtin").live_grep()<cr>', { noremap = true, silent = true })
-vim.api.nvim_set_keymap('n', '<leader>fb', '<cmd>lua require("telescope.builtin").buffers()<cr>', { noremap = true, silent = true })
-vim.api.nvim_set_keymap('n', '<leader>fh', '<cmd>lua require("telescope.builtin").help_tags()<cr>', { noremap = true, silent = true })