Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
477 views
in Technique[技术] by (71.8m points)

vim - How do I split long lines in a .vimrc file?

I've got a line in my .vimrc that is more than 80 chars long:

autocmd FileType python set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class,with

I find this rather annoying, so I want to break it into multiple lines, but I don't know how to do that. I tried since that does the trick in Python and the Bourne shell, but apparently that's not valid syntax in Vim:

autocmd FileType python set smartindent 
    cinwords=if,elif,else,for,while,try,except,finally,def,class,with

gives

E492: Not an editor command

Can anyone tell me how to split this line?

(Bonus points if someone can tell me how to add to cinwords instead of resetting it entirely; the only thing I wanted to achieve is add the with keyword to it.)

question from:https://stackoverflow.com/questions/10831565/how-do-i-split-long-lines-in-a-vimrc-file

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
autocmd FileType python set smartindent
     cinwords+=with

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...