Is it possible to format C++ code with VIM?

后端 未结 9 1648
野的像风
野的像风 2020-12-07 14:58

I am rather new to VIM. I got some source code and this is a mess. At a first sight I would like at least to get a clear and organised view of the code, so I like to get it

9条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-07 15:21

    I don't write C++ code, but I write some Java code.

    Instead, Vim supports the formatting of some common languages. I have set up a short cut for me to format the whole code in the buffer. It will return to the line I just edited :)

    " format the file
    map fm gg=G'. 
    

提交回复
热议问题