From 03db97c14ea2e75657b38fd736132f5ee3fe68a6 Mon Sep 17 00:00:00 2001 From: "user@node5.net" Date: Sat, 20 Jun 2026 19:43:30 +0200 Subject: indent use new faster lib, auto toggle based on mode --- flake.nix | 37 +++++++++++++++++++++++-------------- lua.lua | 22 ---------------------- lua/blink-indent.lua | 17 +++++++++++++++++ lua/neo-tree.lua | 22 ++++++++++++++++++++++ 4 files changed, 62 insertions(+), 36 deletions(-) delete mode 100644 lua.lua create mode 100644 lua/blink-indent.lua create mode 100644 lua/neo-tree.lua diff --git a/flake.nix b/flake.nix index 40a1db3..c3343b9 100644 --- a/flake.nix +++ b/flake.nix @@ -27,6 +27,7 @@ ColorColumn.bg="#0a0a0a"; Normal.bg=null; # Transparent nvim background IlluminatedWordRead.fg="#E06C75"; # Illuminate + BufferTabpageFill.bg=null; }; @@ -186,17 +187,19 @@ visuals = { rainbow-delimiters.enable = true; - indent-blankline = { - enable = true; # Lines that show code nesting indentation - setupOpts = { - # indent.tab_char = "⇥"; - exclude = { - filetypes = [ "dashboard" ]; # Don't show indent on dashboard - }; - }; - }; - nvim-scrollbar.enable = true; # File scrollbar on the right side + blink-indent.enable = true; + # indent-blankline = { + # enable = false; # Lines that show code nesting indentation + # setupOpts = { + # # indent.tab_char = "⇥"; + # exclude = { + # filetypes = [ "dashboard" ]; # Don't show indent on dashboard + # }; + # }; + # }; + nvim-scrollbar.enable = true; # File scrollbar on the right side nvim-web-devicons.enable = true; # Needed for barbar aswell + cinnamon-nvim.enable = true; # smooth scrolling for ANY command }; telescope = { @@ -210,7 +213,6 @@ git = { gitsigns = { # Show changes since last git commit + more shortcuts. enable = true; # Needed for barbar aswell - mappings.previewHunk = "g"; # Pop up, showing changes since last commit }; }; @@ -367,11 +369,18 @@ action = ":bprevious"; desc = "Switch to previous open file buffer"; } + { + key = ""; + mode = ["n"]; + action = ":BufferClose"; + desc = "Close tab"; + } ]; - extraLuaFiles = [ - ./lua.lua - ]; + extraLuaFiles = [ + ./lua/neo-tree.lua + ./lua/blink-indent.lua + ]; }; } diff --git a/lua.lua b/lua.lua deleted file mode 100644 index 0750d6c..0000000 --- a/lua.lua +++ /dev/null @@ -1,22 +0,0 @@ -require("neo-tree").setup({ - window = { - mappings = { - [""] = "refresh", - ["o"] = "open", - } - }, - filesystem = { - window = { - mappings = { - ["O"] = { - command = function(state) - local node = state.tree:get_node() - local cmd = "thunar '" .. node.path .. "'" .. " > /dev/null 2>&1" - print("Opening: " .. node.path) -- Debug statement - os.execute(cmd) - end, - }, - }, - }, - }, -}) diff --git a/lua/blink-indent.lua b/lua/blink-indent.lua new file mode 100644 index 0000000..56a58e6 --- /dev/null +++ b/lua/blink-indent.lua @@ -0,0 +1,17 @@ +local indent = require('blink.indent') + +local group = vim.api.nvim_create_augroup('IndentGuidesByMode', { clear = true }) + +vim.api.nvim_create_autocmd('InsertEnter', { + group = group, + callback = function() + indent.enable(true) + end, +}) + +vim.api.nvim_create_autocmd('InsertLeave', { + group = group, + callback = function() + indent.enable(false) + end, +}) diff --git a/lua/neo-tree.lua b/lua/neo-tree.lua new file mode 100644 index 0000000..0750d6c --- /dev/null +++ b/lua/neo-tree.lua @@ -0,0 +1,22 @@ +require("neo-tree").setup({ + window = { + mappings = { + [""] = "refresh", + ["o"] = "open", + } + }, + filesystem = { + window = { + mappings = { + ["O"] = { + command = function(state) + local node = state.tree:get_node() + local cmd = "thunar '" .. node.path .. "'" .. " > /dev/null 2>&1" + print("Opening: " .. node.path) -- Debug statement + os.execute(cmd) + end, + }, + }, + }, + }, +}) -- cgit v1.3.1