diff options
| author | Thomas Vanbesien <tvanbesi@proton.me> | 2026-05-19 19:46:22 +0200 |
|---|---|---|
| committer | Thomas Vanbesien <tvanbesi@proton.me> | 2026-05-19 19:46:22 +0200 |
| commit | 80f74b2f218ea622be2cdf791494b4d5f91bbd06 (patch) | |
| tree | b0758218bcc7d70cbdb51fbd8e9115f94f5693b6 /init.lua | |
| parent | 19e20f1e23c5ba926a76957a1d20efcc83ff3fd2 (diff) | |
| download | nvim-config-80f74b2f218ea622be2cdf791494b4d5f91bbd06.tar.gz nvim-config-80f74b2f218ea622be2cdf791494b4d5f91bbd06.zip | |
refactor(nvim): single source of truth for per-ft formatting width
- vim.g.dotfiles.textwidth = { sh=80, lua=120, markdown=120, gitcommit=72 }
defined once in init.lua.
- bash/lua/markdown/gitcommit ftplugins + render-markdown read from it;
mdformat --wrap already follows vim.bo.textwidth.
- gitcommit gets an explicit textwidth line (was implicit runtime 72).
- Behavior unchanged; one number now propagates everywhere.
Diffstat (limited to 'init.lua')
| -rw-r--r-- | init.lua | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -2,7 +2,12 @@ if vim.env.DOTFILES_DIR == nil then vim.notify("DOTFILES_DIR is not set!", vim.log.levels.WARN) end -vim.g.dotfiles = { augroup = vim.api.nvim_create_augroup("dotfiles", {}) } +vim.g.dotfiles = { + augroup = vim.api.nvim_create_augroup("dotfiles", {}), + -- Single source of truth for per-filetype formatting width + -- (textwidth → gw, mdformat --wrap, render-markdown block widths). + textwidth = { sh = 80, lua = 120, markdown = 120, gitcommit = 72 }, +} ------------------------------------------------------------------------------------------------------------------------ -- Local functions |
