From 1d38f538c6f29b623ef6fc7525fb9df1d703c99d Mon Sep 17 00:00:00 2001 From: "R. Steve McKown" Date: Wed, 9 Sep 2015 14:53:24 -0600 Subject: [PATCH] vim: set cinoptions and try text wrap for C code With the right C options, wrapping code automatically with formatoptions+=t looks like it might be reasonable. Test it out for a while anyway. --- vim/vimrc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index e039486..3308fe2 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -70,6 +70,9 @@ set list " Set default indent policy. smarttab, roundshift enabled by sensible set softtabstop=2 shiftwidth=2 expandtab +" cinoptions for code formatting +set cino=t0,(s,U1,k2s + " File type specific settings. if has("autocmd") autocmd filetype make setlocal sts=0 sw=8 noexpandtab tw=80 fo-=t fo+=j @@ -77,8 +80,8 @@ if has("autocmd") autocmd filetype python setlocal sts=4 sw=4 tw=79 fo-=t fo+=j autocmd filetype html,xml setlocal listchars-=tab:>. tw=80 fo-=t fo+=j autocmd filetype markdown,mkd,md setlocal tw=80 fo-=t fo+=j - autocmd filetype c,cpp,java setlocal tw=80 fo-=t fo+=j - autocmd filetype nesc setlocal syntax=c.doxygen tw=80 fo-=t fo+=j + autocmd filetype c,cpp,java setlocal tw=80 fo+=jt + autocmd filetype nesc setlocal syntax=c.doxygen tw=80 fo+=jt autocmd filetype text setlocal tw=80 fo+=jt autocmd filetype tex setlocal tw=80 fo+=jt -- 2.39.2