3 ms·
On a related note: Is there any easy way to tell Vim when in insert mode not to accept extra spaces at the end of a line, except a single one? I've got of cour
by datenwolf 10y ago
On a related note: Is there any easy way to tell Vim when in insert mode not to accept extra spaces at the end of a line, except a single one?
I've got of course checks in place that warn about trailing spaces and my Git hooks outright refuse a commit with trailing spaces. But it would be nice to catch that at the insert level.
You know, it may be cat who's typing.
- duijf 10y agoNot exactly at insert mode, but this may be helpful: autocmd BufWritePre * :%s/\s\+$//e Before you save a file, it removes all trailing whitespace (ironically using the same regex as in the article -- hasn't given me trouble yet though)
- deleted 10y ago[deleted]