Vim: Use tabs for indentation, spaces for alignment with C source files

本小妞迷上赌 提交于 2019-12-05 04:16:20

In addition to your :set cino=(1, you may also be interested in the 'preserveindent' and 'copyindent' options if you've not encountered them already. They don't completely solve your problem, but they do go some way towards helping.

Okay, sorry for the question. I've finally found some good material for it.

http://vim.1045645.n5.nabble.com/Indent-with-tabs-align-with-spaces-td1183279.html

To sum up, currently vim is not flexible enough for this to be done comfortably.

My workaround currently is using :set cinoptions=(1 which adds only one alignment unit when starting a continuation line. This way, I can be sure that the added alignment is a space (as long as I did not :set ts=1, at least) and add the nice amount of spaces manually. This is still ok in terms of speed and seems to be the least distracting behaviour to me!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!