summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--home/xyz/.config/nvim/init.vim8
1 files changed, 6 insertions, 2 deletions
diff --git a/home/xyz/.config/nvim/init.vim b/home/xyz/.config/nvim/init.vim
index b5c7be08..cd1a4004 100644
--- a/home/xyz/.config/nvim/init.vim
+++ b/home/xyz/.config/nvim/init.vim
@@ -76,8 +76,12 @@ endfunction
" https://www.youtube.com/watch?v=dBBUOO1PRIU
augroup mycmd
autocmd!
- " disable auto line break (tc) and insert comment (cro)
- autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o formatoptions-=t
+ " Disable auto line break (tc) and insert comment (cro). Also add m and M
+ " to wrap Chinese sentences when using gq, more see :h fo-table. I learned
+ " it from: https://www.reddit.com/r/vim/comments/5k7fxg/comment/dbmngin/.
+ " The url use formatoptions+=mM but I choose to add one flag at a time
+ " because it is suggested in :h add-options-flags.
+ autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o formatoptions-=t formatoptions+=m formatoptions+=M
" auto rewrite as utf-8 if not when :w
" if use FileType *, nvim can't recognize some file extensions, ex: .csv
autocmd BufRead * let fenc_bef = Autocmd_set_fenc()