From c2f290bb9738b01e765c62fa68d11c87cc60415a Mon Sep 17 00:00:00 2001 From: ViViDboarder Date: Mon, 3 Jan 2022 21:27:53 -0800 Subject: [PATCH] Replace grepper * and instead use telescope Also adding a bunch of new telescope bindings --- neovim/lua/plugins/grepper.lua | 1 - neovim/lua/plugins/telescope.lua | 35 ++++++++++++++++---------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/neovim/lua/plugins/grepper.lua b/neovim/lua/plugins/grepper.lua index 727a87e..e8a28aa 100644 --- a/neovim/lua/plugins/grepper.lua +++ b/neovim/lua/plugins/grepper.lua @@ -12,7 +12,6 @@ local map = vim.api.nvim_set_keymap local opt_silent = { silent = true } map("n", "gs", "(GrepperOperator)", opt_silent) map("x", "gs", "(GrepperOperator)", opt_silent) -map("n", "*", ":Grepper -cword -noprompt", opt_silent) -- Override Todo command to use Grepper vim.cmd("command! Todo :Grepper -noprompt -query TODO") diff --git a/neovim/lua/plugins/telescope.lua b/neovim/lua/plugins/telescope.lua index ee552eb..34b6fad 100644 --- a/neovim/lua/plugins/telescope.lua +++ b/neovim/lua/plugins/telescope.lua @@ -2,15 +2,6 @@ local function config_telescope() local actions = require("telescope.actions") require("telescope").setup({ defaults = { - vimgrep_arguments = { - "rg", - "--color=never", - "--no-heading", - "--with-filename", - "--line-number", - "--column", - "--smart-case", - }, mappings = { i = { [""] = actions.close, @@ -22,14 +13,24 @@ local function config_telescope() }, }) local opts = { silent = true, noremap = true } - vim.api.nvim_set_keymap("n", "", "Telescope find_files", opts) - vim.api.nvim_set_keymap("n", "ff", "Telescope find_files", opts) - vim.api.nvim_set_keymap("n", "fh", "Telescope help_tags", opts) - vim.api.nvim_set_keymap("n", "b", "Telescope buffers", opts) - vim.api.nvim_set_keymap("n", "fb", "Telescope buffers", opts) - vim.api.nvim_set_keymap("n", "t", "Telescope current_buffer_tags", opts) - vim.api.nvim_set_keymap("n", "ft", "Telescope tags", opts) - vim.api.nvim_set_keymap("n", "fg", "Telescope live_grep", opts) + vim.api.nvim_set_keymap("n", "", "lua require('telescope.builtin').find_files()", opts) + vim.api.nvim_set_keymap("n", "ff", "lua require('telescope.builtin').find_files()", opts) + vim.api.nvim_set_keymap("n", "fl", "lua require('telescope.builtin').resume()", opts) + vim.api.nvim_set_keymap("n", "fh", "lua require('telescope.builtin').help_tags()", opts) + vim.api.nvim_set_keymap("n", "b", "lua require('telescope.builtin').buffers()", opts) + vim.api.nvim_set_keymap("n", "fb", "lua require('telescope.builtin').buffers()", opts) + vim.api.nvim_set_keymap("n", "t", "lua require('telescope.builtin').current_buffer_tags()", opts) + vim.api.nvim_set_keymap("n", "ft", "lua require('telescope.builtin').tags()", opts) + vim.api.nvim_set_keymap("n", "fg", "lua require('telescope.builtin').live_grep()", opts) + vim.api.nvim_set_keymap("n", "*", "lua require('telescope.builtin').grep_string()", opts) + + -- Better spelling replacement for word under cursor + vim.api.nvim_set_keymap( + "n", + "s", + "lua require('telescope.builtin').spell_suggest(require('telescope.themes').get_cursor())", + opts + ) end config_telescope()