nvim-config

Log | Files | Refs | Submodules | README

commit ff59616dcba75c440f911ec9e94930a58a94c1a6
parent cc91bfaa911bd3251dcdecd60588403c0d7f0fef
Author: Thomas Vigouroux <thomas.vigouroux@protonmail.com>
Date:   Fri, 16 Sep 2022 09:02:32 +0200

chore: ditch telescope and use azy

Diffstat:
Mlua/lsp_config.lua | 15+++++----------
Mlua/plugins.lua | 28++++++++++++++++------------
Mlua/tele_config.lua | 31++-----------------------------
3 files changed, 23 insertions(+), 51 deletions(-)

diff --git a/lua/lsp_config.lua b/lua/lsp_config.lua @@ -41,19 +41,14 @@ local function on_attach(client, bufnr) set_keymap(']d', vim.diagnostic.goto_next) set_keymap('<Leader>q', vim.diagnostic.setqflist) set_keymap('<Leader>=', vim.lsp.buf.format, { async = true }) - set_keymap('gR', require "telescope.builtin".lsp_references) - set_keymap('<Leader>s', require "telescope.builtin".lsp_dynamic_workspace_symbols) + set_keymap('gR', require "azy.builtins".lsp.references()) + set_keymap('<Leader>s', require "azy.builtins".lsp.workspace_symbols()) vim.opt_local.tagfunc = "v:lua.vim.lsp.tagfunc" - local f = nil - for _, path in pairs(vim.lsp.buf.list_workspace_folders()) do - if #path > 0 and path ~= vim.fn.expand("$HOME") then - f = path - break - end - end - set_keymap('<Leader>e', require"azy.builtins".files{ f }) + set_keymap('<Leader>e', require"azy.builtins".files(vim.tbl_filter(function(p) + return #p > 0 and p ~= vim.fn.expand("$HOME") + end, vim.lsp.buf.list_workspace_folders()))) -- LSP lines setup set_keymap('<Leader>l', require("lsp_lines").toggle) diff --git a/lua/plugins.lua b/lua/plugins.lua @@ -33,26 +33,22 @@ return packer.startup(function(use) localuse { 'vigoux/complementree.nvim', requires = { 'L3MON4D3/LuaSnip', 'nvim-treesitter/nvim-treesitter', { 'vigoux/fzy-lua-native', run = 'make' } } } - localuse { 'vigoux/azy.nvim', requires = { 'vigoux/fzy-lua-native', run = 'make' } } - - -- UI and things - use { - 'nvim-telescope/telescope.nvim', - requires = { - 'nvim-lua/popup.nvim', - 'nvim-lua/plenary.nvim', - 'nvim-telescope/telescope-fzy-native.nvim' - }, + localuse { + 'vigoux/azy.nvim', config = function() require 'tele_config' end, } + + -- UI and things localuse { "vigoux/notifier.nvim", config = function() require "notifier".setup { component_name_recall = true, - notify_clear_time = 5000 + notify = { + clear_time = 5000 + }, } end } @@ -104,11 +100,19 @@ return packer.startup(function(use) -- Misc localuse 'vim-conf-live/pres.vim' localuse { 'vigoux/ratatoskr.nvim', opt = true } - use 'bfredl/luarefvim' -- lua docs from nvim use 'lewis6991/impatient.nvim' -- Git because git use { 'lewis6991/gitsigns.nvim', requires = { 'nvim-lua/plenary.nvim' } } + use { + 'ldelossa/gh.nvim', + requires = { { 'ldelossa/litee.nvim' } }, + config = function() + require('litee.lib').setup() + require('litee.gh').setup { + } + end + } -- One true colorscheme localuse 'vigoux/oak' -- Not sure it is that binary diff --git a/lua/tele_config.lua b/lua/tele_config.lua @@ -1,39 +1,12 @@ local M = {} local ab = require'azy.builtins' -if not pcall(require, 'telescope') then return end - -local tele = require'telescope' - -local tele_builtin = require'telescope.builtin' - -local function lua_call(package, func_name, opts) - return string.format( - "<cmd>lua require'%s'.%s%s<CR>", - package, - func_name, - string.gsub(vim.inspect(opts or {}), '%s', '')) -end - -local function map(mode, lhs, rhs, opts) - vim.api.nvim_set_keymap(mode, lhs, rhs, opts or { silent = true, noremap = true}) -end vim.keymap.set("n", "<Leader>e", ab.files(), {}) +vim.keymap.set("n", "<Leader>r", ab.files_contents(), {}) 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')) - -tele.load_extension('fzy_native') -local sorters = require'telescope.sorters' - -tele.setup { - defaults = require 'telescope.themes'.get_ivy { - generic_sorter = sorters.get_fzy_sorter, - file_sorter = sorters.get_fzy_sorter, - } -} +vim.keymap.set('n', '<Leader>q', ab.quickfix(), {}) return M