From 7d1e8075b8f156f3f8c300326abf730a1a8f2875 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 31 May 2021 22:20:30 +0200 Subject: Copying of Luke's dots --- .config/nvim/lua/_telescope/init.lua | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) (limited to '.config/nvim/lua/_telescope/init.lua') 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 = { + [""] = actions.close, [""] = actions.move_selection_next, [""] = actions.move_selection_previous, + [""] = trouble.open_with_trouble, + [""] = actions.smart_send_to_qflist + actions.open_qflist, -- To disable a keymap, put [map] = false -- So, to not map "", just put -- [""] = false, - [""] = actions.close, + -- [""] = actions.close, -- Otherwise, just set the mapping to the function that you want it to be. -- [""] = actions.select_horizontal, @@ -54,23 +58,12 @@ require('telescope').setup { }, n = { [""] = actions.move_selection_next, - [""] = actions.move_selection_previous + [""] = actions.move_selection_previous, + [""] = trouble.open_with_trouble, + [""] = actions.smart_send_to_qflist + actions.open_qflist -- [""] = 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', 'ff', 'lua require("telescope.builtin").find_files()', { noremap = true, silent = true }) -vim.api.nvim_set_keymap('n', 'fg', 'lua require("telescope.builtin").live_grep()', { noremap = true, silent = true }) -vim.api.nvim_set_keymap('n', 'fb', 'lua require("telescope.builtin").buffers()', { noremap = true, silent = true }) -vim.api.nvim_set_keymap('n', 'fh', 'lua require("telescope.builtin").help_tags()', { noremap = true, silent = true }) -- cgit v1.2.3-70-g09d2