diff options
Diffstat (limited to 'pkgs/custom-neovim/config/lua')
| -rw-r--r-- | pkgs/custom-neovim/config/lua/options.lua | 3 | ||||
| -rw-r--r-- | pkgs/custom-neovim/config/lua/statusline.lua | 16 |
2 files changed, 18 insertions, 1 deletions
diff --git a/pkgs/custom-neovim/config/lua/options.lua b/pkgs/custom-neovim/config/lua/options.lua index 2fdb796..7b6bbe0 100644 --- a/pkgs/custom-neovim/config/lua/options.lua +++ b/pkgs/custom-neovim/config/lua/options.lua @@ -4,13 +4,14 @@ vim.o.mouse = "" -- Don't use mouse -- UI vim.o.winborder = 'rounded' -- rounded window borders where possible. -vim.o.showtabline = 1 -- whether to only show tabline if there is more than one tab. +vim.o.showtabline = 0 -- whether to only show tabline if there is more than one tab. vim.o.laststatus = 3 -- only have one statusline at the bottom of the window. vim.o.showmode = false -- don't show the mode in the commandline. vim.o.ruler = false -- don't show #,# in the commandline. vim.o.number = true -- set absolute numbered lines vim.o.scrolloff = 4 -- minimal number of screen lines to keep above and below the cursor vim.o.signcolumn = "yes" -- always show the sign column, otherwise it would shift the text each time +vim.o.winbar = " %f %m" -- Finding vim.o.gdefault = true -- Replace globally by default diff --git a/pkgs/custom-neovim/config/lua/statusline.lua b/pkgs/custom-neovim/config/lua/statusline.lua index fa16cd8..fd246ba 100644 --- a/pkgs/custom-neovim/config/lua/statusline.lua +++ b/pkgs/custom-neovim/config/lua/statusline.lua @@ -229,6 +229,21 @@ components.git_status = function (args) return before..table.concat(status, " ")..after end +components.tab_counter = function (args) + args = args or {} + local before = args.before or "" + local after = args.after or "" + + local num_tabs = #vim.api.nvim_list_tabpages() + local current_tab = vim.api.nvim_get_current_tabpage() + + if num_tabs == 1 then return "" end + + local icon = use_icons and " " or "tab: " + + return before..icon..current_tab.."/"..num_tabs..after +end + -- Define Statusline local statusline = function () return { @@ -240,6 +255,7 @@ local statusline = function () "%=", components.diagnostics(), + components.tab_counter(), components.location({after = vim.g.neovide and " " or ""}), components.progress({after = ""}), } |
