commit 42347966fd36a5bbf86c78330f6552b327bfb0fb
parent bd4f68479e8cca80575c957928e201661d0d4e90
Author: Thomas Vigouroux <thomas.vigouroux@protonmail.com>
Date: Wed, 14 Sep 2022 09:23:31 +0200
feat: use azy instead of telescope for some fuzzy searching operations
Diffstat:
3 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/lua/lsp_config.lua b/lua/lsp_config.lua
@@ -53,7 +53,7 @@ local function on_attach(client, bufnr)
break
end
end
- set_keymap('<Leader>e', function() require "telescope.builtin".fd { cwd = f } end)
+ set_keymap('<Leader>e', require"azy.builtins".files{ f })
-- LSP lines setup
set_keymap('<Leader>l', require("lsp_lines").toggle)
diff --git a/lua/plugins.lua b/lua/plugins.lua
@@ -32,7 +32,8 @@ return packer.startup(function(use)
-- Basic
localuse { 'vigoux/complementree.nvim',
requires = { 'L3MON4D3/LuaSnip', 'nvim-treesitter/nvim-treesitter',
- { 'romgrk/fzy-lua-native', run = 'make' } } }
+ { 'vigoux/fzy-lua-native', run = 'make' } } }
+ localuse { 'vigoux/azy.nvim', requires = { 'vigoux/fzy-lua-native', run = 'make' } }
-- UI and things
use {
diff --git a/lua/tele_config.lua b/lua/tele_config.lua
@@ -1,5 +1,6 @@
local M = {}
+local ab = require'azy.builtins'
if not pcall(require, 'telescope') then return end
local tele = require'telescope'
@@ -18,10 +19,10 @@ local function map(mode, lhs, rhs, opts)
vim.api.nvim_set_keymap(mode, lhs, rhs, opts or { silent = true, noremap = true})
end
-map('n', '<Leader>e', lua_call('telescope.builtin', 'fd'))
-map('n', '<Leader>h', lua_call('telescope.builtin', 'help_tags'))
-map('n', '<Leader>oc', lua_call('telescope.builtin', 'fd', { cwd = vim.fn.stdpath'config' }))
-map('n', '<Leader>b', lua_call('telescope.builtin', 'buffers'))
+vim.keymap.set("n", "<Leader>e", ab.files(), {})
+vim.keymap.set('n', '<Leader>oc', ab.files { vim.fn.stdpath'config' }, {})
+vim.keymap.set('n', '<Leader>h', ab.help(), {})
+vim.keymap.set('n', '<Leader>b', ab.buffers(), {})
map('n', '<Leader>q', lua_call('telescope.builtin', 'quickfix'))
map('n', '<Leader>r', lua_call('telescope.builtin', 'live_grep'))