diff options
Diffstat (limited to 'nvim/lua')
| -rw-r--r-- | nvim/lua/config/man.lua | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/nvim/lua/config/man.lua b/nvim/lua/config/man.lua index 0c0357c..3b6e734 100644 --- a/nvim/lua/config/man.lua +++ b/nvim/lua/config/man.lua @@ -1,24 +1,7 @@ -vim.api.nvim_create_autocmd({ "FileType", "VimResized" }, { +vim.api.nvim_create_autocmd("FileType", { pattern = "man", callback = function() - -- Read MANWIDTH from environment or fallback to 80 if not set - local manwidth_env = os.getenv("MANWIDTH") - local target_width = tonumber(manwidth_env) or 80 - - -- Calculate padding to center the text - local win_width = vim.api.nvim_win_get_width(0) - local padding = math.max(0, math.floor((win_width - target_width) / 2)) - local nu_offset = vim.wo.numberwidth or 0 - local final_padding = math.max(0, padding - nu_offset) - - vim.opt_local.statuscolumn = string.rep(" ", final_padding) .. "%=%{v:lnum} " - - -- disable wrapping only for centered view - if final_padding > 0 then - vim.opt_local.wrap = false - else - vim.opt_local.wrap = true - end + vim.o.number = true end, }) |
