Vim Setting Error Under Bufread

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

e.g.

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

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

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

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

3

2 Answers

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

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

Read more :help :bar.

1

please use one set with space separated options:

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Elena Rostova

Elena Rostova

Lead Health, Wellness & Medical Journalist

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.

Share this article
Twitter Facebook Pinterest