BufRead下的vim设置错误 [英] vim setting error under BufRead

查看:45
本文介绍了BufRead下的vim设置错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 vimrc 设置中遇到一个奇怪的问题,如果我使用 BufRead,我将隔离到这 2 行组合.

Running into a strange issue with my vimrc setting where I isolated to these 2 combination of lines if I use BufRead.

例如

au BufRead *.py
    \ set softtabstop=4
    \ set shiftwidth=4

现在如果我用 .py 打开一个文件,我会收到错误:

Now if I open a file with .py, I get error:

Error detected while processing BufRead Auto commands for "*.py":
E518: Unknown option: set

这只发生在 au BufRead 下,并且每个设置单独工作但不能组合使用?

This only happens under au BufRead and individually each setting works but not in combination?

推荐答案

如果要使用多个set,用|分隔:

If you want to use multiple set, separate with |:

au BufRead *.py
    \ set softtabstop=4 |
    \ set shiftwidth=4

阅读更多:help :bar.

这篇关于BufRead下的vim设置错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆