aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkdx <kdx@42l.fr>2023-01-20 09:40:41 +0100
committerkdx <kdx@42l.fr>2023-01-20 09:40:41 +0100
commit84e54b59b761f9e5675a59c6c2419e31f077c72b (patch)
tree566a050d28c018bcbfea3fbdd7ef41d80e739583
parent1e7ade98b171ed12b6205e8a57b7519e6812a3db (diff)
downloadnvim-config-84e54b59b761f9e5675a59c6c2419e31f077c72b.tar.gz
telescope
-rw-r--r--init.lua12
-rw-r--r--plugs.lua3
-rw-r--r--telescope.lua16
3 files changed, 25 insertions, 6 deletions
diff --git a/init.lua b/init.lua
index 85163dc..6fd5ed4 100644
--- a/init.lua
+++ b/init.lua
@@ -3,6 +3,7 @@ dofile(cfg .. "map.lua")
dofile(cfg .. "plugs.lua")
dofile(cfg .. "treesitter.lua")
dofile(cfg .. "lsp.lua")
+dofile(cfg .. "telescope.lua")
local indent = 8
@@ -21,11 +22,12 @@ vim.opt.autoindent = true
vim.opt.ttyfast = true
map("n", "<space>", ":noh<cr>")
-map("n", ";F", ":Files<cr>")
-map("n", ";f", ":GFiles<cr>")
-map("n", ";b", ":Buffer<cr>")
-map("n", ";l", ":Lines<cr>")
-map("n", ";t", ":!ctags --exclude=Makefile -R<cr>:Tags<cr>")
+map("n", ";F", ":Telescope find_files<cr>")
+map("n", ";f", ":Telescope git_files<cr>")
+map("n", ";g", ":Telescope live_grep<cr>")
+map("n", ";b", ":Telescope buffers<cr>")
+map("n", ";l", ":Telescope current_buffer_fuzzy_find<cr>")
+map("n", ";t", ":!ctags -R --exclude=Makefile<cr>:Telescope tags<cr>")
vim.g.tokyonight_style = "night"
vim.g.tokyonight_enable_italic = true
diff --git a/plugs.lua b/plugs.lua
index 8352364..f629e71 100644
--- a/plugs.lua
+++ b/plugs.lua
@@ -9,9 +9,10 @@ require("paq")({
vim.cmd("TSUpdate")
end
};
- "junegunn/fzf.vim";
{
"neoclide/coc.nvim",
branch = "release"
};
+ "nvim-lua/plenary.nvim";
+ "nvim-telescope/telescope.nvim";
})
diff --git a/telescope.lua b/telescope.lua
new file mode 100644
index 0000000..92453da
--- /dev/null
+++ b/telescope.lua
@@ -0,0 +1,16 @@
+local telescope = require("telescope")
+local actions = require("telescope.actions")
+telescope.setup({
+ defaults = {
+ path_display = { "smart" },
+ file_ignore_patterns = { ".git/" },
+ mappings = {
+ i = {
+ ["<down>"] = actions.cycle_history_next,
+ ["<up>"] = actions.cycle_history_prev,
+ ["<C-j>"] = actions.move_selection_next,
+ ["<C-k>"] = actions.move_selection_previous,
+ }
+ }
+ }
+})