From 2e521aa7d8347610f6151da96926b67cbf79eb6a Mon Sep 17 00:00:00 2001 From: xqtc Date: Thu, 19 Sep 2024 18:24:14 +0200 Subject: [PATCH] nixvim --- home/modules/nixvim.nix | 69 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/home/modules/nixvim.nix b/home/modules/nixvim.nix index 7d4446b..53980ac 100644 --- a/home/modules/nixvim.nix +++ b/home/modules/nixvim.nix @@ -29,6 +29,9 @@ colorschemes.catppuccin.enable = true; plugins = { + persistence = { + enable = true; + }; navic = { enable = true; settings = { @@ -89,7 +92,26 @@ winbar = { lualine_c = [ { - __unkeyed-1 = "navic"; + __unkeyed-1 = "aerial"; + colored = true; + cond = { + __raw = '' + function() + local buf_size_limit = 1024 * 1024 + if vim.api.nvim_buf_get_offset(0, vim.api.nvim_buf_line_count(0)) > buf_size_limit then + return false + end + + return true + end + ''; + }; + dense = false; + dense_sep = "."; + depth = { + __raw = "nil"; + }; + sep = " ∋ "; } ]; # lualine_x = [ @@ -186,6 +208,7 @@ nixvimInjections = true; settings = { ensure_installed = "all"; + highlight.enable = true; }; }; treesitter-refactor = { @@ -529,6 +552,50 @@ ''; lua = true; } + { + mode = ["n"]; + key = "qs"; + action = '' + function() + require("persistence").load() + end + ''; + lua = true; + options.desc = "Load the session for the current directory"; + } + { + mode = ["n"]; + key = "qS"; + action = '' + function() + require("persistence").select() + end + ''; + lua = true; + options.desc = "Select a session to load"; + } + { + mode = ["n"]; + key = "ql"; + action = '' + function() + require("persistence").load({ last = true }) + end + ''; + lua = true; + options.desc = "Load the last session"; + } + { + mode = ["n"]; + key = "qd"; + action = '' + function() + require("persistence").stop() + end + ''; + lua = true; + options.desc = "Stop persistence"; + } ]; }; }