Question

I found a little plugin to help me preview markdown files from Vim. It will let me see the HTML file in my default browser. You can read about the plugin here: http://blog.natesilva.com/post/5256838248/how-to-preview-a-markdown-document-in-vim

The installation instructions say:

To install: Place markdown.vim in ~/.vim/ftplugin or " %USERPROFILE%\vimfiles\ftplugin.

However, I am using Tim Pope's Pathogen plugin-loading system to load several other plugins that are stored in their own directories under the bundle directory. Can I do the same with this one? I tried creating a bundle/markdown-preview/ directory and placing markdown.vim in it, but I wasn't able to get it to work that way. What do I not understand? Is it even necessary to use Pathogen in this case? What problem will it solve for me?

Also, just to see if the plugin worked, I installed it in the ftplugin directory, as suggested. Now, when I press ,p Vim stops itself and the preview file is opened in my browser. I get the message:

[1]+  Stopped                 vim ./.dotfiles/vim/bundle/fugitive/README.markdown

How do I resume Vim and go back to editing the file once I've seen my preview?

Was it helpful?

Solution

I tried creating a bundle/markdown-preview/ directory and placing markdown.vim in it, but I wasn't able to get it to work that way.

You should have tried putting it into bundle/markdown-preview/ftplugin, not where you claim you have tried to put it. There may still be some things that prevent it from working from this location.

For second question: follow this comment and add :redraw! at the end of the function.

OTHER TIPS

To get Pathogen to find the plugin I put the markdown.vim file in bundle/markdown-preview/plugin/. This link helped me: http://news.ycombinator.com/item?id=1711760

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top