gvim command-line mode :!start [windows command] returns Command not found error message
I'm trying to run a vimscript (that's in my vimrc) that copies certain files over to a new directory, were I could then compile my tex file and return a pdf. My code works, except it always pops up command-prompts on every command. I'm using a lot of bash commands to do this (not too proficient in vimscript yet).
To try to avoid the pop-ups, I found that if you're in a command prompt, typing
start /MIN copy foo.tex bar.tex
runs a command prompt in "minimized mode", i.e. no pop up. However, when in vim, typing in command-line mode:
!start /MIN copy foo.tex bar.tex
returns a "Command not found" error message. In fact, any command I put after !start doesn't work
!start echo hi -> Command not found
However, it works perfectly well if I type it in a command prompt.
I looked into :help command-line, but couldn't find anything. Also, I tried:
exe 'sav! bar.tex
but that moves the current file and the vim buffer. I tried :copy and :move, but they only manipulate text in the buffer.
I'm running GUI vim 8.0 on Windows 10. the code I ran is(not whole program):
" move appropriate files
silent! exe '!start /MIN copy ' fnameescape(fileName) . ' ' . fnameescape(compileDir) . 'cur' . fnameescape(fileName)
silent! exe '!start /MIN echo ' . curDir . ' >'. compileDir .'curDir.txt'
silent! exe '!start /MIN echo ' . fileName . ' >' . compileDir.'fileName.txt'
silent! exe 'cd' fnameescape(compileDir)
"compile and move the pdf
silent! exe '!compile.bat'
silent! exe '!mv ' . l:Name . '.pdf ' . l:curDir
Which I know if inefficient, but I just needed something quick to work. I tried using vim built-in functions when I find them. Note that this code works fine without "start /MIN"
windows vim cmd
add a comment |
I'm trying to run a vimscript (that's in my vimrc) that copies certain files over to a new directory, were I could then compile my tex file and return a pdf. My code works, except it always pops up command-prompts on every command. I'm using a lot of bash commands to do this (not too proficient in vimscript yet).
To try to avoid the pop-ups, I found that if you're in a command prompt, typing
start /MIN copy foo.tex bar.tex
runs a command prompt in "minimized mode", i.e. no pop up. However, when in vim, typing in command-line mode:
!start /MIN copy foo.tex bar.tex
returns a "Command not found" error message. In fact, any command I put after !start doesn't work
!start echo hi -> Command not found
However, it works perfectly well if I type it in a command prompt.
I looked into :help command-line, but couldn't find anything. Also, I tried:
exe 'sav! bar.tex
but that moves the current file and the vim buffer. I tried :copy and :move, but they only manipulate text in the buffer.
I'm running GUI vim 8.0 on Windows 10. the code I ran is(not whole program):
" move appropriate files
silent! exe '!start /MIN copy ' fnameescape(fileName) . ' ' . fnameescape(compileDir) . 'cur' . fnameescape(fileName)
silent! exe '!start /MIN echo ' . curDir . ' >'. compileDir .'curDir.txt'
silent! exe '!start /MIN echo ' . fileName . ' >' . compileDir.'fileName.txt'
silent! exe 'cd' fnameescape(compileDir)
"compile and move the pdf
silent! exe '!compile.bat'
silent! exe '!mv ' . l:Name . '.pdf ' . l:curDir
Which I know if inefficient, but I just needed something quick to work. I tried using vim built-in functions when I find them. Note that this code works fine without "start /MIN"
windows vim cmd
Have a look at the "Vim Tips Wiki": Execute external programs asynchronously under Windows. BTW: Why is the question tagged with "bash"? You are obviously using cmd.exe stuff.
– Ralf
Dec 29 '18 at 21:57
Thanks! I'm sort of new to this all. I've fixed it. Also, your solution almost worked. The command prompt pop up and go much faster, but they still pop up, and it only works with small tex files. Sometimes, files don't get copied on time, so when I run the compiling program, it gives an error . However, it does work if I don't make the compiler asynchronous.
– Chiarandini
Dec 30 '18 at 0:49
This sounds as if you should use a make and a Makefile to control your tex build. Or maybe craft all this into a batch file and just start the batch file from Vim. You might also want to read:help tex
and:help compiler-tex
.
– Ralf
Dec 30 '18 at 7:06
Thanks for the suggestion! This improves my setup, but I can't seem to get the windows stop popping up
– Chiarandini
Jan 4 at 4:10
add a comment |
I'm trying to run a vimscript (that's in my vimrc) that copies certain files over to a new directory, were I could then compile my tex file and return a pdf. My code works, except it always pops up command-prompts on every command. I'm using a lot of bash commands to do this (not too proficient in vimscript yet).
To try to avoid the pop-ups, I found that if you're in a command prompt, typing
start /MIN copy foo.tex bar.tex
runs a command prompt in "minimized mode", i.e. no pop up. However, when in vim, typing in command-line mode:
!start /MIN copy foo.tex bar.tex
returns a "Command not found" error message. In fact, any command I put after !start doesn't work
!start echo hi -> Command not found
However, it works perfectly well if I type it in a command prompt.
I looked into :help command-line, but couldn't find anything. Also, I tried:
exe 'sav! bar.tex
but that moves the current file and the vim buffer. I tried :copy and :move, but they only manipulate text in the buffer.
I'm running GUI vim 8.0 on Windows 10. the code I ran is(not whole program):
" move appropriate files
silent! exe '!start /MIN copy ' fnameescape(fileName) . ' ' . fnameescape(compileDir) . 'cur' . fnameescape(fileName)
silent! exe '!start /MIN echo ' . curDir . ' >'. compileDir .'curDir.txt'
silent! exe '!start /MIN echo ' . fileName . ' >' . compileDir.'fileName.txt'
silent! exe 'cd' fnameescape(compileDir)
"compile and move the pdf
silent! exe '!compile.bat'
silent! exe '!mv ' . l:Name . '.pdf ' . l:curDir
Which I know if inefficient, but I just needed something quick to work. I tried using vim built-in functions when I find them. Note that this code works fine without "start /MIN"
windows vim cmd
I'm trying to run a vimscript (that's in my vimrc) that copies certain files over to a new directory, were I could then compile my tex file and return a pdf. My code works, except it always pops up command-prompts on every command. I'm using a lot of bash commands to do this (not too proficient in vimscript yet).
To try to avoid the pop-ups, I found that if you're in a command prompt, typing
start /MIN copy foo.tex bar.tex
runs a command prompt in "minimized mode", i.e. no pop up. However, when in vim, typing in command-line mode:
!start /MIN copy foo.tex bar.tex
returns a "Command not found" error message. In fact, any command I put after !start doesn't work
!start echo hi -> Command not found
However, it works perfectly well if I type it in a command prompt.
I looked into :help command-line, but couldn't find anything. Also, I tried:
exe 'sav! bar.tex
but that moves the current file and the vim buffer. I tried :copy and :move, but they only manipulate text in the buffer.
I'm running GUI vim 8.0 on Windows 10. the code I ran is(not whole program):
" move appropriate files
silent! exe '!start /MIN copy ' fnameescape(fileName) . ' ' . fnameescape(compileDir) . 'cur' . fnameescape(fileName)
silent! exe '!start /MIN echo ' . curDir . ' >'. compileDir .'curDir.txt'
silent! exe '!start /MIN echo ' . fileName . ' >' . compileDir.'fileName.txt'
silent! exe 'cd' fnameescape(compileDir)
"compile and move the pdf
silent! exe '!compile.bat'
silent! exe '!mv ' . l:Name . '.pdf ' . l:curDir
Which I know if inefficient, but I just needed something quick to work. I tried using vim built-in functions when I find them. Note that this code works fine without "start /MIN"
windows vim cmd
windows vim cmd
edited Dec 30 '18 at 0:51
Chiarandini
asked Dec 29 '18 at 18:53
ChiarandiniChiarandini
63
63
Have a look at the "Vim Tips Wiki": Execute external programs asynchronously under Windows. BTW: Why is the question tagged with "bash"? You are obviously using cmd.exe stuff.
– Ralf
Dec 29 '18 at 21:57
Thanks! I'm sort of new to this all. I've fixed it. Also, your solution almost worked. The command prompt pop up and go much faster, but they still pop up, and it only works with small tex files. Sometimes, files don't get copied on time, so when I run the compiling program, it gives an error . However, it does work if I don't make the compiler asynchronous.
– Chiarandini
Dec 30 '18 at 0:49
This sounds as if you should use a make and a Makefile to control your tex build. Or maybe craft all this into a batch file and just start the batch file from Vim. You might also want to read:help tex
and:help compiler-tex
.
– Ralf
Dec 30 '18 at 7:06
Thanks for the suggestion! This improves my setup, but I can't seem to get the windows stop popping up
– Chiarandini
Jan 4 at 4:10
add a comment |
Have a look at the "Vim Tips Wiki": Execute external programs asynchronously under Windows. BTW: Why is the question tagged with "bash"? You are obviously using cmd.exe stuff.
– Ralf
Dec 29 '18 at 21:57
Thanks! I'm sort of new to this all. I've fixed it. Also, your solution almost worked. The command prompt pop up and go much faster, but they still pop up, and it only works with small tex files. Sometimes, files don't get copied on time, so when I run the compiling program, it gives an error . However, it does work if I don't make the compiler asynchronous.
– Chiarandini
Dec 30 '18 at 0:49
This sounds as if you should use a make and a Makefile to control your tex build. Or maybe craft all this into a batch file and just start the batch file from Vim. You might also want to read:help tex
and:help compiler-tex
.
– Ralf
Dec 30 '18 at 7:06
Thanks for the suggestion! This improves my setup, but I can't seem to get the windows stop popping up
– Chiarandini
Jan 4 at 4:10
Have a look at the "Vim Tips Wiki": Execute external programs asynchronously under Windows. BTW: Why is the question tagged with "bash"? You are obviously using cmd.exe stuff.
– Ralf
Dec 29 '18 at 21:57
Have a look at the "Vim Tips Wiki": Execute external programs asynchronously under Windows. BTW: Why is the question tagged with "bash"? You are obviously using cmd.exe stuff.
– Ralf
Dec 29 '18 at 21:57
Thanks! I'm sort of new to this all. I've fixed it. Also, your solution almost worked. The command prompt pop up and go much faster, but they still pop up, and it only works with small tex files. Sometimes, files don't get copied on time, so when I run the compiling program, it gives an error . However, it does work if I don't make the compiler asynchronous.
– Chiarandini
Dec 30 '18 at 0:49
Thanks! I'm sort of new to this all. I've fixed it. Also, your solution almost worked. The command prompt pop up and go much faster, but they still pop up, and it only works with small tex files. Sometimes, files don't get copied on time, so when I run the compiling program, it gives an error . However, it does work if I don't make the compiler asynchronous.
– Chiarandini
Dec 30 '18 at 0:49
This sounds as if you should use a make and a Makefile to control your tex build. Or maybe craft all this into a batch file and just start the batch file from Vim. You might also want to read
:help tex
and :help compiler-tex
.– Ralf
Dec 30 '18 at 7:06
This sounds as if you should use a make and a Makefile to control your tex build. Or maybe craft all this into a batch file and just start the batch file from Vim. You might also want to read
:help tex
and :help compiler-tex
.– Ralf
Dec 30 '18 at 7:06
Thanks for the suggestion! This improves my setup, but I can't seem to get the windows stop popping up
– Chiarandini
Jan 4 at 4:10
Thanks for the suggestion! This improves my setup, but I can't seem to get the windows stop popping up
– Chiarandini
Jan 4 at 4:10
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53972462%2fgvim-command-line-mode-start-windows-command-returns-command-not-found-error%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53972462%2fgvim-command-line-mode-start-windows-command-returns-command-not-found-error%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Have a look at the "Vim Tips Wiki": Execute external programs asynchronously under Windows. BTW: Why is the question tagged with "bash"? You are obviously using cmd.exe stuff.
– Ralf
Dec 29 '18 at 21:57
Thanks! I'm sort of new to this all. I've fixed it. Also, your solution almost worked. The command prompt pop up and go much faster, but they still pop up, and it only works with small tex files. Sometimes, files don't get copied on time, so when I run the compiling program, it gives an error . However, it does work if I don't make the compiler asynchronous.
– Chiarandini
Dec 30 '18 at 0:49
This sounds as if you should use a make and a Makefile to control your tex build. Or maybe craft all this into a batch file and just start the batch file from Vim. You might also want to read
:help tex
and:help compiler-tex
.– Ralf
Dec 30 '18 at 7:06
Thanks for the suggestion! This improves my setup, but I can't seem to get the windows stop popping up
– Chiarandini
Jan 4 at 4:10