From fd6161e9026df572eb5f42a92c1145e8a78b1a53 Mon Sep 17 00:00:00 2001 From: punkfairie Date: Wed, 1 Jan 2025 17:30:15 -0800 Subject: [PATCH] feat: aerial.nvim --- nix/neovim-overlay.nix | 1 + nvim/lua/plugins/editor/aerial-nvim.lua | 32 +++++++++++++++++++++++++ nvim/lua/plugins/editor/init.lua | 1 + nvim/lua/plugins/ui/lualine-nvim.lua | 11 ++++++++- 4 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 nvim/lua/plugins/editor/aerial-nvim.lua diff --git a/nix/neovim-overlay.nix b/nix/neovim-overlay.nix index 692a4a0..4484d1c 100644 --- a/nix/neovim-overlay.nix +++ b/nix/neovim-overlay.nix @@ -52,6 +52,7 @@ with final.pkgs.lib; let flash-nvim which-key-nvim gitsigns-nvim + aerial-nvim # Treesitter nvim-treesitter-textobjects diff --git a/nvim/lua/plugins/editor/aerial-nvim.lua b/nvim/lua/plugins/editor/aerial-nvim.lua new file mode 100644 index 0000000..913c574 --- /dev/null +++ b/nvim/lua/plugins/editor/aerial-nvim.lua @@ -0,0 +1,32 @@ +return { + 'aerial.nvim', + event = { 'BufReadPost', 'BufWritePost', 'BufNewFile' }, + keys = { + { 'cs', 'AerialToggle', desc = 'toggle aerial' }, + }, + before = function() + require('lz.n').trigger_load({ 'mini.icons' }) + end, + after = function() + require('aerial').setup({ + attach_mode = 'global', + backends = { 'lsp', 'treesitter', 'markdown', 'man' }, + show_guides = true, + layout = { + resize_to_content = false, + placement = 'edge', + win_opts = { + winhl = 'Normal:NormalFloat,FloatBorder:NormalFloat,SignColumn:SignColumnSB', + signcolumn = 'yes', + statuscolumn = ' ', + }, + }, + guides = { + mid_item = '├╴', + last_item = '└╴', + nested_top = '│ ', + whitespace = ' ', + }, + }) + end, +} diff --git a/nvim/lua/plugins/editor/init.lua b/nvim/lua/plugins/editor/init.lua index ca0cd8f..779d5b9 100644 --- a/nvim/lua/plugins/editor/init.lua +++ b/nvim/lua/plugins/editor/init.lua @@ -1,6 +1,7 @@ local req = MarleyVim.local_require('plugins.editor') return { + req('aerial-nvim'), req('flash-nvim'), req('gitsigns-nvim'), req('grug-far-nvim'), diff --git a/nvim/lua/plugins/ui/lualine-nvim.lua b/nvim/lua/plugins/ui/lualine-nvim.lua index 243d4eb..99a67c8 100644 --- a/nvim/lua/plugins/ui/lualine-nvim.lua +++ b/nvim/lua/plugins/ui/lualine-nvim.lua @@ -13,7 +13,7 @@ return { end end, before = function() - require('lz.n').trigger_load('mini.icons') + require('lz.n').trigger_load({ 'mini.icons', 'aerial.nvim' }) if vim.g.colors_name == 'rose-pine' then require('lz.n').trigger_load('rose-pine') @@ -61,6 +61,15 @@ return { path = 4, symbols = { readonly = ' 󰌾 ', modified = '' }, }, + { + 'aerial', + sep = ' ', + sep_icon = '', + depth = 5, + dense = false, + dense_sep = '.', + colored = true, + }, }, lualine_x = {