all repos — nixfiles @ 3b0c32cc6c20f6a20cf5f7e48668743f71c69e44

System and user configuration, managed by nix and home-manager

neovim: enable fuzzy finding with telescope
Alan Pearce alan@alanpearce.eu
Sun, 23 Apr 2023 19:28:57 +0200
commit

3b0c32cc6c20f6a20cf5f7e48668743f71c69e44

parent

558c0d61af4eafc64c1df3ca56711530b90403c0

2 files changed, 28 insertions(+), 0 deletions(-)

jump to
M user/nvim/init.luauser/nvim/init.lua
@@ -183,3 +183,28 @@ -- Do default action for previous item keyset("n", "<space>k", ":<C-u>CocPrev<cr>", opts)
 -- Resume latest coc list
 keyset("n", "<space>p", ":<C-u>CocListResume<cr>", opts)
+
+local telescope = require("telescope")
+telescope.setup {
+	defaults = {
+		mappings = {
+			i ={
+				["<C-h>"] = "which_key"
+			}
+		}
+	},
+	extensions = {
+		fzf = {
+			fuzzy = true,
+			override_generic_sorter = true,
+			override_file_sorter = true,
+			case_mode = "smart_case",
+		}
+	}
+}
+telescope.load_extension("fzf")
+local ts_builtin = require('telescope.builtin')
+keyset("n", "<leader>ff", ts_builtin.find_files, {})
+keyset("n", "<leader>fg", ts_builtin.live_grep, {})
+keyset("n", "<leader>bb", ts_builtin.buffers, {})
+keyset("n", "<leader>fh", ts_builtin.help_tags, {})
M user/settings/neovim.nixuser/settings/neovim.nix
@@ -15,6 +15,9 @@ coc-git       coc-json
       coc-yaml
       direnv-vim
+      nvim-treesitter
+      telescope-nvim
+      telescope-fzf-native-nvim
       vim-tridactyl
       vim-surround
     ];