From 0c66846e4eb8c8e56e4d516062a660a0d8c475b1 Mon Sep 17 00:00:00 2001 From: Oliver Hartmann Date: Sun, 26 Jun 2022 14:32:29 +0200 Subject: [PATCH] setup aerial --- lua/my_plugins.lua | 4 ++++ lua/setup/aerial.lua | 6 ++++++ lua/setup/lspinstall.lua | 5 ++--- lua/setup/my_command_center.lua | 3 ++- lua/setup/telescope.lua | 2 +- 5 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 lua/setup/aerial.lua diff --git a/lua/my_plugins.lua b/lua/my_plugins.lua index 5f8efbf..8a537f4 100644 --- a/lua/my_plugins.lua +++ b/lua/my_plugins.lua @@ -179,6 +179,10 @@ return require('packer').startup(function() }, config = get_setup('my_litee') } + use { + 'stevearc/aerial.nvim', + config = get_setup('aerial') + } if packer_bootstrap then require('packer').sync() end diff --git a/lua/setup/aerial.lua b/lua/setup/aerial.lua new file mode 100644 index 0000000..2ddd243 --- /dev/null +++ b/lua/setup/aerial.lua @@ -0,0 +1,6 @@ +require('aerial').setup({ + backends = { 'lsp', 'treesitter','markdown' }, + default_direction = "prefer_left", + filter_kind = false, + show_guides = true, +}) diff --git a/lua/setup/lspinstall.lua b/lua/setup/lspinstall.lua index 2d0e98e..f3878ff 100644 --- a/lua/setup/lspinstall.lua +++ b/lua/setup/lspinstall.lua @@ -48,13 +48,11 @@ local on_attach = function(client, bufnr) buf_set_keymap('n', 'C', 'lua vim.lsp.buf.incoming_calls()', opts) buf_set_keymap('n', 'm', 'lua vim.lsp.buf.rename()', opts) -- buf_set_keymap('n', 'r', 'lua vim.lsp.buf.references()') - buf_set_keymap('n', 's', 'lua vim.lsp.buf.document_symbol()', opts) buf_set_keymap('n', '', 'Telescope lsp_dynamic_workspace_symbols', opts) buf_set_keymap('n', 'D', 'lua vim.lsp.buf.type_definition()', opts) buf_set_keymap('n', '', 'lua vim.lsp.buf.signature_help()', opts) buf_set_keymap('n', 'r', 'Telescope lsp_references', opts) - buf_set_keymap('n', '', 'Telescope lsp_document_symbols', opts) - buf_set_keymap('n', '', 'Telescope lsp_document_symbols', opts) + buf_set_keymap('n', '', 'Telescope aerial', opts) buf_set_keymap('n', 'v', 'Telescope diagnostics bufnr=0', opts) buf_set_keymap('n', '', ':ClangdSwitchSourceHeader', opts) @@ -91,6 +89,7 @@ local on_attach = function(client, bufnr) }, hi_parameter = 'IncSearch', }, bufnr) + require("aerial").on_attach(client, bufnr) end local lsp_installer = require('nvim-lsp-installer') diff --git a/lua/setup/my_command_center.lua b/lua/setup/my_command_center.lua index fc777c1..15ab99c 100644 --- a/lua/setup/my_command_center.lua +++ b/lua/setup/my_command_center.lua @@ -226,9 +226,10 @@ command_center.add({ }, { description = 'Symbols outline', - cmd = 'lua vim.lsp.buf.document_symbol()', + cmd = 'AerialToggle', keybindings = { { 'n', 's', silent_noremap }, + { 'n', 's', silent_noremap }, }, }, }) diff --git a/lua/setup/telescope.lua b/lua/setup/telescope.lua index 777a2e5..c452716 100644 --- a/lua/setup/telescope.lua +++ b/lua/setup/telescope.lua @@ -49,4 +49,4 @@ require('telescope').setup({ }) require('telescope').load_extension('fzf') - +require('telescope').load_extension('aerial')