können Sie verwenden, um die -c
Option, wenn vim Start-Befehle auszuführen, nachdem die erste Datei gelesen wurde.
Für Ihre Situation, können Sie einfach den Standard set filetype
Befehl -
vim -c 'set filetype=javascript'
Sie auch --cmd
verwenden könnten den Befehl nach die ersten Datei geladen wird, auszuführen.
von den vim Mann Seiten Lifted:
-c {command}
{command} will be executed after the first file has been read. {command} is interpreted as an Ex command. If the {command} contains spaces it must be enclosed in double quotes (this depends on the shell that is used).
Example: Vim "+set si" main.c
Note: You can use up to 10 "+" or "-c" commands.
--cmd {command}
Like using "-c", but the command is executed just before processing any vimrc file. You can use up to 10 of these commands, independently from "-c" commands.
set ft = CPP Ihre ~/.vimrc aber auf diese Weise alle Ihre Datei als CPP-Datei behandelt wird geöffnet. –
@LeeHoYo es ist nicht der einzige Dateityp mit dem ich arbeite –
@LeeHoYo - das würde, wenn für jede Datei. OP möchte es beim Öffnen bestimmter Dateien einstellen. – Lix