]> oss.titaniummirror.com Git - smckown/dotfiles.git/commitdiff
vim: set cinoptions and try text wrap for C code
authorR. Steve McKown <rsmckown@gmail.com>
Wed, 9 Sep 2015 20:53:24 +0000 (14:53 -0600)
committerR. Steve McKown <rsmckown@gmail.com>
Wed, 9 Sep 2015 20:53:24 +0000 (14:53 -0600)
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

index e039486050e2e68813409097856a3c1021fdcd3a..3308fe281f8cd65adebccc9542af5834d205a3f0 100644 (file)
--- 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