From 3945397198a611347a89cb8635d0a9551a8e98a9 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sat, 8 Jun 2024 22:01:29 +0200 Subject: use Telescope instead of fzf.vim --- lua/maps/find.lua | 28 ++++++++++++++++++++++++---- lua/plugins.lua | 21 ++++++++++++++++----- lua/telescope_config.lua | 2 ++ 3 files changed, 42 insertions(+), 9 deletions(-) create mode 100644 lua/telescope_config.lua (limited to 'lua') diff --git a/lua/maps/find.lua b/lua/maps/find.lua index 5d4bfbe..aad0e46 100644 --- a/lua/maps/find.lua +++ b/lua/maps/find.lua @@ -1,8 +1,28 @@ -vim.api.nvim_set_keymap("n", "p", ":Files", { silent = true, noremap = true }) +vim.api.nvim_set_keymap( + "n", + "p", + ":Telescope find_files", + { silent = true, noremap = true } +) -vim.api.nvim_set_keymap("n", "b", ":Buffers", { silent = true, noremap = true }) +vim.api.nvim_set_keymap( + "n", + "b", + ":Telescope buffers", + { silent = true, noremap = true } +) -vim.api.nvim_set_keymap("n", "c", ":Commits", { silent = true, noremap = true }) +vim.api.nvim_set_keymap( + "n", + "c", + ":Telescope git_commits", + { silent = true, noremap = true } +) -vim.api.nvim_set_keymap("n", "f", ":Ag ", { noremap = true }) +vim.api.nvim_set_keymap( + "n", + "f", + ":Telescope live_grep", + { silent = true, noremap = true } +) diff --git a/lua/plugins.lua b/lua/plugins.lua index 3cbda43..82801e1 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -85,14 +85,25 @@ return require("packer").startup(function(use) } -- Navigation end - -- Fzf - use { "junegunn/fzf", tag = "0.52.1" } + -- Telescope + use { + "nvim-telescope/telescope.nvim", tag = "0.1.8", + requires = { + { + "nvim-lua/plenary.nvim", + commit = "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" + } + } + } use { - "junegunn/fzf.vim", - commit = "0a80e43f9027ec64213d602dbb0b22d65a072ca8" + "nvim-telescope/telescope-fzf-native.nvim", + commit = "9ef21b2e6bb6ebeaf349a0781745549bbb870d27", + run = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && \ + cmake --build build --config Release && \ + cmake --install build --prefix build" } - -- Fzf end + -- Telescope end -- Markdown use { diff --git a/lua/telescope_config.lua b/lua/telescope_config.lua new file mode 100644 index 0000000..391c38d --- /dev/null +++ b/lua/telescope_config.lua @@ -0,0 +1,2 @@ +require('telescope').setup({}) +require('telescope').load_extension('fzf') -- cgit v1.2.3-18-g5258