- 1 year ago
How to close cmd window from vim command after using latexmk?
Comment
1 / 1
To close the CMD window automatically after running a command from Vim, you can use the :!start
command in combination with the cmd /c
command prefix. Here's an example:
bash:!start cmd /c latexmk -pdf %<CR>
In this example, latexmk -pdf
is the command you want to run. %
is the current file name, and <
removes the file extension. The start
command opens a new CMD window to execute the command, and cmd /c
ensures that the CMD window closes after the command is executed.
By using this command in Vim, the CMD window will open, execute the command, and close automatically, allowing you to continue working in Vim without the CMD window staying open.