vim-settings/neovim/lua/plugins/telescope.lua

39 lines
1.5 KiB
Lua
Raw Normal View History

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 = {
["<esc>"] = actions.close,
-- Disable scroll-up to allow clearing prompt
["<C-u>"] = false,
}
},
layout_strategy = "flex",
}
}
2021-09-16 01:13:17 +00:00
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", "<leader>ff", "<cmd>Telescope 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>b", "<cmd>Telescope buffers<CR>", opts)
vim.api.nvim_set_keymap("n", "<leader>fb", "<cmd>Telescope 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>ft", "<cmd>Telescope tags<CR>", opts)
vim.api.nvim_set_keymap("n", "<leader>fg", "<cmd>Telescope live_grep<CR>", opts)
2021-09-16 20:32:45 +00:00
vim.cmd "command Rg Telescope live_grep"
vim.cmd "command Grep Telescope live_grep"
end
config_telescope()