1

Is there a way that I can have the :make command output itself to a terminal window in vim? In the 8.1 release, they added the :term command, which allows you to run an external program in a vim window. I was wondering if there's some way to combine the two.

I want this because i use vim-latex for compiling my .tex files (which compiles using :make), and it would actually be helpful for me to be able to deal with errors and stuff while still in vim.

  • 2
    "it would actually be helpful for me to be able to deal with errors and stuff while still in vim." Do you know that that quickfix list is populated with the output of :make? You can bring up the quickfix window via :copen. See :h quickfix for more information. – Peter Rincker Jun 28 '18 at 13:14
  • @PeterRincker tex has you deal with errors interactively – A Gold Man Jun 28 '18 at 14:15
  • are you using -interaction=nonstopmode? does vim-latex not set this by default? – Mass Jun 28 '18 at 15:22
  • Even though this is old: the answer to the comment of @mass is: vim-latex sets -interaction=nonstopmode. This can be checked with :verbose set makeprg which returns makeprg=pdflatex -synctex=1 -interaction=nonstopmode -file-line-error-style $* Last set from ~/.vim/pack/manual/start/vim-latex/ftplugin/latex-suite/compiler.vim. So the comment of Peter Rincker is also helpful. – Hotschke Oct 1 '18 at 16:13
  • @AGoldMan: Have you noticed this paragraph in the help file of vim-latex? – Hotschke Oct 1 '18 at 16:15
0

On windows gvim only, you can use set guioptions+=! to run make in a terminal. This isn't yet supported on other platforms so you will have to find an alternative.

If you want to create a new terminal each time,

command -nargs=* Make execute 'terminal' &makeprg.(empty(<q-args>)?'':' '.<q-args>)
  • Does your second suggestion still populate the quickfix list? – A Gold Man Jun 28 '18 at 14:58
  • No, that would take some work. I'm a bit confused whether you want interactivity like in the terminal or non-interactivity like in the quickfix. – Mass Jun 28 '18 at 15:21
0

Not exactly what you asked for (using the terminal new vim 8.1 feature) but you should check asyncrun plugin which let you execute whatever you want asynchronously and get the output in quick fix (using errorformat to parse the output...). asyncrun.vim

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.