From 33724076b23aefea4a3af26847cb3659bd523452 Mon Sep 17 00:00:00 2001 From: triethyl Date: Fri, 8 Aug 2025 11:03:36 -0400 Subject: neovim: change some plugins and fix sessions --- pkgs/custom-neovim/config/lua/mappings.lua | 5 ++--- pkgs/custom-neovim/config/lua/options.lua | 2 +- pkgs/custom-neovim/config/lua/plugins/comment.lua | 1 + pkgs/custom-neovim/config/lua/plugins/mini/tabline.lua | 1 + pkgs/custom-neovim/config/lua/statusline.lua | 18 ++++++++++++++---- 5 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 pkgs/custom-neovim/config/lua/plugins/comment.lua create mode 100644 pkgs/custom-neovim/config/lua/plugins/mini/tabline.lua (limited to 'pkgs/custom-neovim/config/lua') diff --git a/pkgs/custom-neovim/config/lua/mappings.lua b/pkgs/custom-neovim/config/lua/mappings.lua index 0bcff87..1379973 100644 --- a/pkgs/custom-neovim/config/lua/mappings.lua +++ b/pkgs/custom-neovim/config/lua/mappings.lua @@ -24,8 +24,7 @@ mapkey("n", "t", "Manage tabs", "") mapkey("n", "to", "Open new tab", ":tabnew") mapkey("n", "tc", "Close tab", ":tabclose") mapkey("n", "tt", "Go to next tab", ":tabnext") -mapkey("n", "tn", "Go to next tab", ":tabnext") -mapkey("n", "tp", "Go to previous tab", ":tabprev") +mapkey("n", "tT", "Go to previous tab", ":tabprev") mapkey("n", "tr", "Rename current tab", function() vim.ui.input({ prompt = "Rename tab: "}, function(input) if input then @@ -56,7 +55,7 @@ mapkey("n", "co", "Open new terminal", ":lua Snacks.terminal.open()" -- Git mapkey("n", "g", "Manage git", "") mapkey("n", "gg", "Open lazygit", ":lua Snacks.lazygit()") -mapkey("n", "ga", "Add the current file", ":Git add") +mapkey("n", "ga", "Add the current file", ":Git add %") mapkey("n", "gs", "Open git status picker", ":lua Snacks.picker.git_status()") -- Other leader keys diff --git a/pkgs/custom-neovim/config/lua/options.lua b/pkgs/custom-neovim/config/lua/options.lua index 5698594..296aea3 100644 --- a/pkgs/custom-neovim/config/lua/options.lua +++ b/pkgs/custom-neovim/config/lua/options.lua @@ -13,7 +13,7 @@ vim.o.scrolloff = 4 -- minimal number of screen lines to keep above and below th vim.o.signcolumn = "yes" -- always show the sign column, otherwise it would shift the text each time vim.o.clipboard = "unnamedplus" -- use system clipboard vim.o.equalalways = true -- equalize splits -vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions,globals" +vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal" -- Split Behavior vim.o.splitright = true diff --git a/pkgs/custom-neovim/config/lua/plugins/comment.lua b/pkgs/custom-neovim/config/lua/plugins/comment.lua new file mode 100644 index 0000000..4ff0380 --- /dev/null +++ b/pkgs/custom-neovim/config/lua/plugins/comment.lua @@ -0,0 +1 @@ +require("comment").setup() diff --git a/pkgs/custom-neovim/config/lua/plugins/mini/tabline.lua b/pkgs/custom-neovim/config/lua/plugins/mini/tabline.lua new file mode 100644 index 0000000..9045285 --- /dev/null +++ b/pkgs/custom-neovim/config/lua/plugins/mini/tabline.lua @@ -0,0 +1 @@ +require("mini.tabline").setup() diff --git a/pkgs/custom-neovim/config/lua/statusline.lua b/pkgs/custom-neovim/config/lua/statusline.lua index 5476841..d83231a 100644 --- a/pkgs/custom-neovim/config/lua/statusline.lua +++ b/pkgs/custom-neovim/config/lua/statusline.lua @@ -59,6 +59,10 @@ statusline_components.micro_spacer = function() return " " end +statusline_components.small_spacer = function() + return " " +end + statusline_components.spacer = function() return '%=' end @@ -152,7 +156,7 @@ end statusline_components.git_branch = function() if vim.g.gitsigns_head then - return string.format(' %s ', vim.g.gitsigns_head) + return string.format(' %s', vim.g.gitsigns_head) else return '' -- Return an empty string or some default value if the branch name is not available end @@ -217,7 +221,7 @@ statusline_components.working_directory = function() text = ".../" .. parts[#parts] end end - return string.format(' %s ', text) + return string.format('%s', text) end Statusline_component = function(name) @@ -232,15 +236,21 @@ local statusline = { get_component("micro_spacer"), get_component("mode"), + get_component("micro_spacer"), get_component("working_directory"), + get_component("micro_spacer"), get_component("git_branch"), + get_component("micro_spacer"), get_component("git_status"), + get_component("micro_spacer"), get_component("diagnostic_status"), get_component("spacer"), - ' %{&filetype} ', -- filetype - '%2p%% ', -- progress % + '%{&filetype}', -- filetype + get_component("micro_spacer"), + '%2p%%', -- progress % + get_component("micro_spacer"), get_component("position"), } -- cgit v1.2.3