krisajenkins / vim-pipe

Send a vim buffer through a command and instantly see the output.
MIT License
186 stars 15 forks source link

vim-pipe loads html command for markdown #11

Open jhessin opened 4 years ago

jhessin commented 4 years ago

Hello, Firstly vim-pipe is awesome! It is super useful for all of my development. The only issue I am having is in trying to use ftplugin directory to manage my b:vimpipe_command.

It tends to work well in everything but my markdown files. Here are the relevant files:

ftplugin/html.vim

set foldmethod=manual
nnoremap <buffer> <localleader>f zfit
onoremap T it

let b:vimpipe_command="lynx -dump -stdin"

ftplugin/markdown.vim

let b:vimpipe_command="multimarkdown | lynx -dump -stdin"

Now when I load my README.md file I would expect b:vimpipe_command to be "multimarkdown | lynx -dump -stdin" but it is actually just "lynx -dump -stdin" and that is what is run. I commented out the line in my html and it works fine then.

I have checked and ":set filetype" returns markdown as expected.

mperry2 commented 2 years ago

This is being caused by Vim's markdown plugin which is including the html plugin at the start. You can view it by opening $VIMRUNTIME/ftplugin/markdown.vim.

I was able to work around this by adding the following lines in ftplugin/html.vim just before setting the vimpipe_command variable.

if &filetype ==# 'markdown'
  finish
endif