开发者

Vim auto indent private keyword

开发者 https://www.devze.com 2023-04-10 15:03 出处:网络
I\'m learning Vim (I\'m using gVim) I need to do the following: Suppose I typed this: 开发者_高级运维class MyClass {

I'm learning Vim (I'm using gVim)

I need to do the following: Suppose I typed this:

开发者_高级运维
class MyClass {
    private
}

After typing the : after private, result should be:

class MyClass {
private:
}

How can I do automate that behaviour?

I tried with

:imap private: <Home><Delete>

But I feel it's not an elegant solution at all. I already installed c.vim by Fritz Mehner.


set cindent
set cinoptions=g-1

Reference: http://vimdoc.sourceforge.net/htmldoc/indent.html

0

精彩评论

暂无评论...
验证码 换一张
取 消