vim: Force specific syntax via command-line argument
You can use:
vim -c 'set syntax=sql' -
vim -R -c 'set ft=sql' -
-R
opens Vim in read-only mode. Your system may have the aliasview
forvim -R
, but Neovim does not support it.set ft
is short forset filetype
. As Martin Tournoij mentioned in his comment, setting the file type sets the syntax and more.