From 56e2cdbc0c71bd3777392a3ba94edd7b10f5e556 Mon Sep 17 00:00:00 2001 From: punkfairie Date: Sat, 30 Nov 2024 13:03:29 -0800 Subject: [PATCH] feat: indent-blankline.nvim --- nix/neovim-overlay.nix | 1 + nvim/lua/plugins/ui/indent-blankline-nvim.lua | 41 +++++++++++++++++++ nvim/lua/plugins/ui/init.lua | 1 + 3 files changed, 43 insertions(+) create mode 100644 nvim/lua/plugins/ui/indent-blankline-nvim.lua diff --git a/nix/neovim-overlay.nix b/nix/neovim-overlay.nix index 65ea407..d3927e3 100644 --- a/nix/neovim-overlay.nix +++ b/nix/neovim-overlay.nix @@ -44,6 +44,7 @@ with final.pkgs.lib; let alpha-nvim bufferline-nvim lualine-nvim + indent-blankline-nvim ]; extraPackages = with pkgs; [ diff --git a/nvim/lua/plugins/ui/indent-blankline-nvim.lua b/nvim/lua/plugins/ui/indent-blankline-nvim.lua new file mode 100644 index 0000000..039961a --- /dev/null +++ b/nvim/lua/plugins/ui/indent-blankline-nvim.lua @@ -0,0 +1,41 @@ +return { + 'indent-blankline.nvim', + event = { 'BufReadPost', 'BufWritePost', 'BufNewFile' }, + after = function() + require('ibl').setup({ + indent = { + char = '│', + tab_char = '│', + }, + scope = { show_start = false, show_end = false }, + exclude = { + filetypes = { + 'Trouble', + 'alpha', + 'dashboard', + 'help', + 'lazy', + 'mason', + 'neo-tree', + 'notify', + 'snacks_dashboard', + 'snacks_notif', + 'snacks_terminal', + 'snacks_win', + 'toggleterm', + 'trouble', + }, + }, + }) + + Snacks.toggle({ + name = 'Indent guides', + get = function() + return require('ibl.config').get_config(0).enabled + end, + set = function(state) + require('ibl').setup_buffer(0, { enabled = state }) + end, + }):map('ug') + end, +} diff --git a/nvim/lua/plugins/ui/init.lua b/nvim/lua/plugins/ui/init.lua index 15c8874..584d59c 100644 --- a/nvim/lua/plugins/ui/init.lua +++ b/nvim/lua/plugins/ui/init.lua @@ -3,6 +3,7 @@ local req = require('lib.marleyvim').localRequire('plugins.ui') return { req('alpha-nvim'), req('bufferline-nvim'), + req('indent-blankline-nvim'), req('lualine-nvim'), req('mini-icons'), }