diff options
| author | Skladnayazebra <skladnayazebra@gmail.com> | 2026-04-14 12:27:46 +0200 |
|---|---|---|
| committer | Skladnayazebra <skladnayazebra@gmail.com> | 2026-04-14 12:27:46 +0200 |
| commit | 78df8e23dd3203ea69b0dff4592a625e2af570f0 (patch) | |
| tree | 6d4bc0a97ca3431fdd7433600c816fd5dc724859 /nvim/lua/config | |
| parent | ee701663d4e6f150317e4576344559f349135363 (diff) | |
| parent | b5dbd983cbf2a5b98f2d1eb6fb9850018186d462 (diff) | |
Merge branch 'master' of null-wizard.me:/srv/git/configs
Diffstat (limited to 'nvim/lua/config')
| -rw-r--r-- | nvim/lua/config/lsp.lua | 4 | ||||
| -rw-r--r-- | nvim/lua/config/man.lua | 24 | ||||
| -rw-r--r-- | nvim/lua/config/plugins/tree-sitter.lua | 2 |
3 files changed, 28 insertions, 2 deletions
diff --git a/nvim/lua/config/lsp.lua b/nvim/lua/config/lsp.lua index 6507c67..97cb27b 100644 --- a/nvim/lua/config/lsp.lua +++ b/nvim/lua/config/lsp.lua @@ -4,7 +4,7 @@ vim.diagnostic.config({ virtual_text = true, }) --- requires json language service - npm i -g vscode-langservers-extracted +-- requires vscode-json-languageserver vim.lsp.enable('jsonls') vim.lsp.config('jsonls', { settings = { @@ -51,5 +51,5 @@ vim.lsp.config('yamlls', { vim.lsp.enable('clangd') vim.lsp.enable('eslint') vim.lsp.enable('cssls') --- npm i -g typescript-language-server +-- requires typescript-language-server vim.lsp.enable('ts_ls') diff --git a/nvim/lua/config/man.lua b/nvim/lua/config/man.lua new file mode 100644 index 0000000..0c0357c --- /dev/null +++ b/nvim/lua/config/man.lua @@ -0,0 +1,24 @@ +vim.api.nvim_create_autocmd({ "FileType", "VimResized" }, { + 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 + end, +}) + diff --git a/nvim/lua/config/plugins/tree-sitter.lua b/nvim/lua/config/plugins/tree-sitter.lua index baa33db..a0f8a53 100644 --- a/nvim/lua/config/plugins/tree-sitter.lua +++ b/nvim/lua/config/plugins/tree-sitter.lua @@ -1,3 +1,5 @@ +-- requres tree-sitter-cli + return { { "nvim-treesitter/nvim-treesitter", |
