Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vim setting error under BufRead

Tags:

vim

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?

like image 256
AnthonyC Avatar asked Apr 20 '16 10:04

AnthonyC


2 Answers

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

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

Read more :help :bar.

like image 105
svlasov Avatar answered Oct 23 '22 14:10

svlasov


please use one set with space separated options:

au BufRead *.py set softtabstop=4 shiftwidth=4
like image 17
Kent Avatar answered Oct 23 '22 14:10

Kent