neovim: enable fuzzy finding with telescope
Alan Pearce alan@alanpearce.eu
Sun, 23 Apr 2023 19:28:57 +0200
2 files changed, 28 insertions(+), 0 deletions(-)
M user/nvim/init.lua → user/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.nix → user/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 ];