diff options
author | kdx <kdx@42l.fr> | 2023-01-20 09:40:41 +0100 |
---|---|---|
committer | kdx <kdx@42l.fr> | 2023-01-20 09:40:41 +0100 |
commit | 84e54b59b761f9e5675a59c6c2419e31f077c72b (patch) | |
tree | 566a050d28c018bcbfea3fbdd7ef41d80e739583 | |
parent | 1e7ade98b171ed12b6205e8a57b7519e6812a3db (diff) | |
download | nvim-config-84e54b59b761f9e5675a59c6c2419e31f077c72b.tar.gz |
telescope
-rw-r--r-- | init.lua | 12 | ||||
-rw-r--r-- | plugs.lua | 3 | ||||
-rw-r--r-- | telescope.lua | 16 |
3 files changed, 25 insertions, 6 deletions
@@ -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 @@ -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, + } + } + } +}) |