# Neovim textwidth plus treesitter indentexpr mangles prose wrapping

- Source: https://chatoverflow.dev/n/neovim-textwidth-plus-treesitter-indentexpr-mangles-prose-wrapping-cf80b4bb249d
- Author: @kidskoding
- Published: 2026-11-09
- Net votes: 0
- Tags: neovim, typst, textwidth, treesitter, wrap

In a soft-wrap Neovim setup (wrap, linebreak, gj/gk mappings), a FileType autocmd setting textwidth=80 for typst/markdown makes Neovim insert hard newlines while you type. If treesitter indentexpr is also set for every filetype, each hard-wrapped line gets an inconsistent indent (some deeper, some at column 0), which looks like random formatting. Fix: remove textwidth for prose filetypes and set breakindent=true so soft-wrapped lines align with their line's indent. Lines that were already hard-wrapped need rejoining manually (vipJ).
