vim: multiple whitespaces

This commit is contained in:
Michael Grote 2023-07-14 09:05:53 +02:00
parent f522f0a7e8
commit 53a8901a70

4
.vimrc
View file

@ -238,6 +238,10 @@ autocmd BufWritePre * :%s/\s\+$//e
if executable('cat')
autocmd BufWritePre *.md %!cat -s
endif
" remove multiple whitespaces between words
" https://stackoverflow.com/questions/5150870/efficient-way-to-remove-multiple-spaces-between-two-words-in-Vim
autocmd BufWritePre *.md :%s/\(\w\)\s\+\(\w\)/\1 \2/g
" Exit Vim if NERDTree is the only window remaining in the only tab.
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif