Skip to main content
added 362 characters in body
Source Link
Vivian De Smedt
  • 24.9k
  • 5
  • 29
  • 48

If I do:

let &makeprg = 'pandoc --from=markdown --output %:p:r:S.$* -- %:p:S' 

Then:

:make html 

generate the command:

pandoc --from=markdown --output "myfolder/myfile".html -- "myfolder/myfile" 

The problem is with the %:p:r:S.$* part. The the :S that escape the path for the shell is actually quoting the path moving the argument (i.e. html) outside the quote.

You get "myfolder/myfile".html where you probably like to have "myfolder/myfile.html"

I would not use the shell escape (i.e. :S) and quote the path explicitly: "%:p:r.$*".

Maybe you would like to do:

let &makeprg = 'pandoc --from=markdown --output "%:p:r.$*" -- %:p:S' 

that generates:

pandoc --from=markdown --output "myfolder/myfile.html" -- "myfolder/myfile" 

If I do:

let &makeprg = 'pandoc --from=markdown --output %:p:r:S.$* -- %:p:S' 

Then:

:make html 

generate the command:

pandoc --from=markdown --output "myfolder/myfile".html -- "myfolder/myfile" 

Maybe you would like to do:

let &makeprg = 'pandoc --from=markdown --output "%:p:r.$*" -- %:p:S' 

that generates:

pandoc --from=markdown --output "myfolder/myfile.html" -- "myfolder/myfile" 

If I do:

let &makeprg = 'pandoc --from=markdown --output %:p:r:S.$* -- %:p:S' 

Then:

:make html 

generate the command:

pandoc --from=markdown --output "myfolder/myfile".html -- "myfolder/myfile" 

The problem is with the %:p:r:S.$* part. The the :S that escape the path for the shell is actually quoting the path moving the argument (i.e. html) outside the quote.

You get "myfolder/myfile".html where you probably like to have "myfolder/myfile.html"

I would not use the shell escape (i.e. :S) and quote the path explicitly: "%:p:r.$*".

Maybe you would like to do:

let &makeprg = 'pandoc --from=markdown --output "%:p:r.$*" -- %:p:S' 

that generates:

pandoc --from=markdown --output "myfolder/myfile.html" -- "myfolder/myfile" 
Source Link
Vivian De Smedt
  • 24.9k
  • 5
  • 29
  • 48

If I do:

let &makeprg = 'pandoc --from=markdown --output %:p:r:S.$* -- %:p:S' 

Then:

:make html 

generate the command:

pandoc --from=markdown --output "myfolder/myfile".html -- "myfolder/myfile" 

Maybe you would like to do:

let &makeprg = 'pandoc --from=markdown --output "%:p:r.$*" -- %:p:S' 

that generates:

pandoc --from=markdown --output "myfolder/myfile.html" -- "myfolder/myfile"