mirror of
https://github.com/ViViDboarder/vim-settings.git
synced 2024-12-22 18:57:34 +00:00
Replace grepper <leader>* and instead use telescope
Also adding a bunch of new telescope bindings
This commit is contained in:
parent
e43a43500e
commit
c2f290bb97
@ -12,7 +12,6 @@ local map = vim.api.nvim_set_keymap
|
|||||||
local opt_silent = { silent = true }
|
local opt_silent = { silent = true }
|
||||||
map("n", "gs", "<plug>(GrepperOperator)", opt_silent)
|
map("n", "gs", "<plug>(GrepperOperator)", opt_silent)
|
||||||
map("x", "gs", "<plug>(GrepperOperator)", opt_silent)
|
map("x", "gs", "<plug>(GrepperOperator)", opt_silent)
|
||||||
map("n", "<leader>*", ":Grepper -cword -noprompt<cr>", opt_silent)
|
|
||||||
|
|
||||||
-- Override Todo command to use Grepper
|
-- Override Todo command to use Grepper
|
||||||
vim.cmd("command! Todo :Grepper -noprompt -query TODO")
|
vim.cmd("command! Todo :Grepper -noprompt -query TODO")
|
||||||
|
@ -2,15 +2,6 @@ local function config_telescope()
|
|||||||
local actions = require("telescope.actions")
|
local actions = require("telescope.actions")
|
||||||
require("telescope").setup({
|
require("telescope").setup({
|
||||||
defaults = {
|
defaults = {
|
||||||
vimgrep_arguments = {
|
|
||||||
"rg",
|
|
||||||
"--color=never",
|
|
||||||
"--no-heading",
|
|
||||||
"--with-filename",
|
|
||||||
"--line-number",
|
|
||||||
"--column",
|
|
||||||
"--smart-case",
|
|
||||||
},
|
|
||||||
mappings = {
|
mappings = {
|
||||||
i = {
|
i = {
|
||||||
["<esc>"] = actions.close,
|
["<esc>"] = actions.close,
|
||||||
@ -22,14 +13,24 @@ local function config_telescope()
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
local opts = { silent = true, noremap = true }
|
local opts = { silent = true, noremap = true }
|
||||||
vim.api.nvim_set_keymap("n", "<C-t>", "<cmd>Telescope find_files<CR>", opts)
|
vim.api.nvim_set_keymap("n", "<C-t>", "<cmd>lua require('telescope.builtin').find_files()<CR>", opts)
|
||||||
vim.api.nvim_set_keymap("n", "<leader>ff", "<cmd>Telescope find_files<CR>", opts)
|
vim.api.nvim_set_keymap("n", "<leader>ff", "<cmd>lua require('telescope.builtin').find_files()<CR>", opts)
|
||||||
vim.api.nvim_set_keymap("n", "<leader>fh", "<cmd>Telescope help_tags<CR>", opts)
|
vim.api.nvim_set_keymap("n", "<leader>fl", "<cmd>lua require('telescope.builtin').resume()<CR>", opts)
|
||||||
vim.api.nvim_set_keymap("n", "<leader>b", "<cmd>Telescope buffers<CR>", opts)
|
vim.api.nvim_set_keymap("n", "<leader>fh", "<cmd>lua require('telescope.builtin').help_tags()<CR>", opts)
|
||||||
vim.api.nvim_set_keymap("n", "<leader>fb", "<cmd>Telescope buffers<CR>", opts)
|
vim.api.nvim_set_keymap("n", "<leader>b", "<cmd>lua require('telescope.builtin').buffers()<CR>", opts)
|
||||||
vim.api.nvim_set_keymap("n", "<leader>t", "<cmd>Telescope current_buffer_tags<CR>", opts)
|
vim.api.nvim_set_keymap("n", "<leader>fb", "<cmd>lua require('telescope.builtin').buffers()<CR>", opts)
|
||||||
vim.api.nvim_set_keymap("n", "<leader>ft", "<cmd>Telescope tags<CR>", opts)
|
vim.api.nvim_set_keymap("n", "<leader>t", "<cmd>lua require('telescope.builtin').current_buffer_tags()<CR>", opts)
|
||||||
vim.api.nvim_set_keymap("n", "<leader>fg", "<cmd>Telescope live_grep<CR>", opts)
|
vim.api.nvim_set_keymap("n", "<leader>ft", "<cmd>lua require('telescope.builtin').tags()<CR>", opts)
|
||||||
|
vim.api.nvim_set_keymap("n", "<leader>fg", "<cmd>lua require('telescope.builtin').live_grep()<CR>", opts)
|
||||||
|
vim.api.nvim_set_keymap("n", "<leader>*", "<cmd>lua require('telescope.builtin').grep_string()<CR>", opts)
|
||||||
|
|
||||||
|
-- Better spelling replacement for word under cursor
|
||||||
|
vim.api.nvim_set_keymap(
|
||||||
|
"n",
|
||||||
|
"<leader>s",
|
||||||
|
"<cmd>lua require('telescope.builtin').spell_suggest(require('telescope.themes').get_cursor())<CR>",
|
||||||
|
opts
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
config_telescope()
|
config_telescope()
|
||||||
|
Loading…
Reference in New Issue
Block a user