skywind3000 / asyncrun.vim

:rocket: Run Async Shell Commands in Vim 8.0 / NeoVim and Output to the Quickfix Window !!
https://www.vim.org/scripts/script.php?script_id=5431
MIT License
1.84k stars 109 forks source link

Pandoc option not recognized in task.ini file #191

Closed tkolleh closed 4 years ago

tkolleh commented 4 years ago

The --metadata-file option is not recognized as part of the below command. The screenshot demonstrates that the command is valid from the terminal (zsh).

command:markdown,md,pandoc=pandoc --standalone --verbose -f markdown -t html --metadata-file="/Users/tkolleh/Documents/metadata.yaml" --output="$(VIM_FILENOEXT).html" "$(VIM_RELNAME)" 
pandoc --standalone --verbose -f markdown --output="project4-report.html" --metadata-file="/Users/tkolleh/Documents/metadata.yaml" "project4-report.md"
Screen Shot 2020-04-16 at 3 59 27 PM
skywind3000 commented 4 years ago

check if you have two pandoc executables in different path and if AsyncRun is calling the old one. If so, use the absolute path for it.

tkolleh commented 4 years ago

🤦🏾‍♂️...Yep that was the issue. Seems that neovim is not referencing the alias but rather the anaconda installed version.

 type pandoc
pandoc is an alias for /usr/local/opt/pandoc/bin/pandoc
skywind3000 commented 4 years ago

shells has four modes:

https://www.vanimpe.eu/2014/01/18/different-shell-types-interactive-non-interactive-login/

Your shell setup may be only defined for an login+interactive shell, but vim/neovim start process in an non-login+non-interactive shell.

But in practice, we only setup for an interactive shell:

bash -i -c "pandoc ... "

So in non-interactive shells:

bash -c "pandoc ..."

You may need absolute path:

bash -c "/path/to ..."

Non-interactive mode is usually used to start a child process rappidly, putting much setup code for it will reduce startup time for bash -c "xxx", which is used every where.