You didn't say which system you're using, but generally saving it in the +
register should work. You can call system():
:let @+=system("markdown --html4tags", join(getline(1,line("$")), "\n"))
The system() function takes the second parameter (optional) as input to the
command, and here I'm using a chain of other functions to retrieve the contents
of the current buffer. Not sure, but there should be a better way to do it (if
someone knows, please let me know).
Alternatively, you can pass markdown your file name as input directly:
:let @+=system("markdown --html4tags " . shellescape(expand("%:p")))
But keep in mind that you'll need to write the file before calling this.
Two important notes:
- I didn't type your full path to markdown. Use it.
- I didn't use maps here, the final result would be something like:
nnoremap md :let @+=system(...)