См :help user-commands
:
It is possible to define your own Ex commands. A user-defined command can act
just like a built-in command (it can have a range or arguments, arguments can
be completed as filenames or buffer names, etc), except that when the command
is executed, it is transformed into a normal Ex command and then executed.
For starters: See section |40.2| in the user manual.
*E183* *E841* *user-cmd-ambiguous*
All user defined commands must start with an uppercase letter, to avoid
confusion with builtin commands.
Вы хотите :command
:com[mand][!] [{attr}...] {cmd} {rep}
Define a user command. The name of the command is
{cmd} and its replacement text is {rep}. The command's
attributes (see below) are {attr}. If the command
already exists, an error is reported, unless a ! is
specified, in which case the command is redefined.
Вы можете сделать это в вашем ~/.vimrc
:
command -nargs=* Artisan !ssh -t vagrant "cd /var/www && php artisan <args>"
И затем использовать команду :Artisan make:migration create_blah_table --create=blah
в экс-режиме.
«make: migration create_blah_table --create = blah' не хочет быть жестко закодированным в команде. Я хочу иметь возможность запускать ': Artisan whatever' и запускать' ssh -t vagrant 'cd/var/www && php artisan что угодно "' –
Маленький адронный коллайдер: кричит, пропустил это. исправлено. – rampion
Я получаю ошибку 'E488: Trailing characters ', когда я пытаюсь запустить, например. 'Artisan cache: clear' –