-1

I recently came to use NeoVim and I was trying to configure my vim to run a single file using :make command (My g++ is from MinGW), I tried to use

:let &makeprg = 'g++ -Wall -Wextra -std=c++17 -o %< %'

and ran :make, but it gives something like this: error message

Why is there a weird folder Temp\nvimHOQLoX. How should I make my :make to compile my c++ file? I tried to use :verbose make and it gives this error message2 I am able to run make filename in my Powershell but not in Neovim. Neovim is also using the Windows Powershell. !make %< works find too but I'd like to know why the previous command doesn't work. Thanks in advance!
I figured out the reason thanks to @filbrandon. Thank you!

5
  • In fact, this is strange. Have you tried to look into the Temp\nvimHOQLoX (perhapse it's the place where the quickfix lists are created)? If the folder doesent exist you can try to create it. – Fabrice Hategekimana Jan 6 at 13:17
  • @Fabrice Yes, this folder is created but it is empty. – Learning Mathematics Jan 6 at 13:20
  • 3
  • 2
    What does :verbose set shellpipe? tell you? Please edit your question to include the result. And please post that as text, so we can actually read it. Thanks! – filbranden Jan 6 at 14:46
  • 1
    @filbranden I reset it to windows default and it works, thank you! – Learning Mathematics Jan 6 at 15:34
2

It looks like you had the 'shellpipe' option misconfigured to just a | instead of a | tee (which would work on Linux/Unix/WSL) or > (which would work on Windows.)

You can find the value this option is set to and the origin of this setting with:

:verbose set shellpipe?

As discussed in the comments, resetting this option to the Windows default worked to fix that for you.

3
  • Yes, it's indeed the case. That's what I saw from :help shell-powershell and it wrote that the command should be shellpipe = \| Any reason for it? – Learning Mathematics Jan 6 at 16:02
  • 1
    Yes it looks like the NeoVim docs do say that (neovim.io/doc/user/options.html#shell-powershell). This is a NeoVim addition, it's not in Vim. I can't tell why that's the advice... I don't rule out that being a mistake, with the author of the documentation change thinking that 'shellpipe' is what the shell does for just a "pipe", when in fact that's more of a redirect... – filbranden Jan 6 at 16:32
  • I filed an issue in NeoVim about this: github.com/neovim/neovim/issues/13713. Feel free to subscribe to it, to see how it gets resolved. – filbranden Jan 8 at 2:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.