summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2023-04-23 19:28:57 +0200
committerAlan Pearce2023-04-23 21:55:29 +0200
commit3b0c32cc6c20f6a20cf5f7e48668743f71c69e44 (patch)
treec183957fb6df7062734210c5c52962457bf3fa80
parent558c0d61af4eafc64c1df3ca56711530b90403c0 (diff)
downloadnixfiles-3b0c32cc6c20f6a20cf5f7e48668743f71c69e44.tar.lz
nixfiles-3b0c32cc6c20f6a20cf5f7e48668743f71c69e44.tar.zst
nixfiles-3b0c32cc6c20f6a20cf5f7e48668743f71c69e44.zip
neovim: enable fuzzy finding with telescope
-rw-r--r--user/nvim/init.lua25
-rw-r--r--user/settings/neovim.nix3
2 files changed, 28 insertions, 0 deletions
diff --git a/user/nvim/init.lua b/user/nvim/init.lua
index ddeb6940..d1dcb88b 100644
--- a/user/nvim/init.lua
+++ b/user/nvim/init.lua
@@ -183,3 +183,28 @@ keyset("n", "<space>j", ":<C-u>CocNext<cr>", opts)
 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, {})
diff --git a/user/settings/neovim.nix b/user/settings/neovim.nix
index f42387ee..e3ee1de0 100644
--- a/user/settings/neovim.nix
+++ b/user/settings/neovim.nix
@@ -15,6 +15,9 @@
       coc-json
       coc-yaml
       direnv-vim
+      nvim-treesitter
+      telescope-nvim
+      telescope-fzf-native-nvim
       vim-tridactyl
       vim-surround
     ];