2

When I open a file in vim with vim filename -c syn off I get messages mentioned below inside vim

javaScriptComment xxx start=+/\*+ end=+\*/+  contains=@Spell,javaScriptCommentTodo
                   links to Comment
javaScriptSpecial xxx match /\\\d\d\d\|\\./
                       links to Special
-- More --

What are these? I don't work in Javascript.

6

vim filename -c syn off is like:

vim -c syn filename off

You're opening two files named filename and off, and running the :syn command after opening Vim. The :syn command without arguments just dumps the current syntax highlighting configuration for the current buffer. For filename, whatever the actual filename is, that apparently includes some JavaScript syntax highlighting as well.

You want:

vim filename -c "syn off"
2
  • Better form to put -c after the filename? That's surprising, given the POSIX preference for options to precede positional arguments (see utility syntax guidelines, particularly guideline 9) Aug 3 at 16:48
  • @CharlesDuffy I was showing the minimal change needed to fix OP's original command. (But -c with Vim is a case where it does make sense to do so - the command specified by -c is run after the file is loaded, so it might be easier for some to visualise the sequence of actions.)
    – muru
    Aug 4 at 7:44

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.