From 2159feee1e602cbf9a130b67ed875f8c5ebb7124 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Dudr?= Date: Wed, 20 Sep 2023 21:25:38 +0200 Subject: [PATCH] nvim status column --- dot_config/nvim/lua/configs/options.lua | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/dot_config/nvim/lua/configs/options.lua b/dot_config/nvim/lua/configs/options.lua index e991875..9273a29 100644 --- a/dot_config/nvim/lua/configs/options.lua +++ b/dot_config/nvim/lua/configs/options.lua @@ -56,21 +56,18 @@ function M.setup() vim.o.relativenumber = false vim.o.list = false vim.o.statusline = '' - .. ' %{fnamemodify(getcwd(),":t")}' -- basename of cwd - .. '%( │  %{get(b:,"gitsigns_head","")}%)' -- branch - .. ' │  %<%f%( [%M%R%W]%)' -- filename and modification flags - .. '%=' -- rest is right - .. '%( [%{get(b:,"attached_lsps","")}] | %)' -- branch - .. '%y ' -- filetype - .. '%-7.(%3.l:%-3.(%c%V%)%) %P' -- ruler + .. ' %{fnamemodify(getcwd(),":t")}' -- basename of cwd + .. '%( │  %{get(b:,"gitsigns_head","")}%)' -- branch + .. ' │  %<%f%( [%M%R%W]%)' -- filename and modification flags + .. '%=' -- rest is right + .. '%( [%{get(b:,"attached_lsps","")}] | %)' -- lsp + .. '%y ' -- filetype + .. '%-7.(%3.l:%-3.(%c%V%)%) %P' -- ruler - if vim.fn.has('nvim-0.9') then - vim.o.statuscolumn = '%=%l %C%s' - end + vim.o.statuscolumn = '%=%(%{(v:virtnum!=0||!&number)?\"\":(&relativenumber?v:relnum:v:lnum)} %C%s%)' end set_winopts() - -- vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWinEnter', 'FileType' }, { -- pattern = '*', -- callback = function(args) @@ -113,9 +110,7 @@ function M.setup() vim.opt_local.statusline = '%Y | %f%=%l:%v %P' end - if vim.fn.has('nvim-0.9') then - vim.o.statuscolumn = '' - end + vim.o.statuscolumn = '' end, })