I have this oneliner in my vimrc but it does not work :
if has("patch-7.4.710") | set listchars+=space:· else | set listchars+=trail:· | endif
VIM says :
E518: Unknown option: else
Can you help me ?
You need to put another | before else otherwise vim will think your command is set listchars+=space:· else instead of two separate commands. That's why you got the error message: else is an unknown option for the command set.
The correct syntax is the following:
if has("patch-7.4.710") | set listchars+=space:· | else | set listchars+=trail:· | endif
|, before or after theelse? Now, I now it's both :-D. Thanks a lot :) ! – SebMa Sep 11 '17 at 09:52if has("patch-7.4.710"), instruction 2set listchars+=space:·, instruction 3else, instruction 4set listchars+=trail:·and last instructionendif. As the|are used to separate instructions it is only logical to put one beforeelseand one after :) – statox Sep 11 '17 at 09:58;to separate instructions . In Celseis not an instruction, otherwise there would be a;after it :) – SebMa Sep 11 '17 at 10:02if else fistatement :if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else COMMANDS; ] fiAs you can see, there is no instruction separator right after theelsestatement like in VimL – SebMa Sep 11 '17 at 11:52