I have been using this plugin for a while, and I just installed in a new machine.
When I open a markdown file, a new browser window pops up and renders the file correctly, but it never gets updated anymore. If I close the vim session, it leaves node process a new intents to edit a markdown file doesn't even render the first time they're opened.
These are the software I'm using:
Thanks a lot!
@dpecos Did you get this error when installing? LearnBoost/socket.io#1126
I've tried out a fresh installation on Debian 6, Ruby 1.9.3, Node 0.8.20 and it seems to work alright. Are you sure you installed the latest version of the vim plugin into ~/.vim/after/ftplugin/markdown/?
I have almost the same environment, with almost the same problem. I open a markdown file and nothing happens. I can confirm it's actually markdown because set ft? shows markdown.
Linux Mint 14
vim-instant-markdown: latest version
Typing echo lala | instant-markdown-d works just fine... It opens a tab in my browser and I can see "lala".
echo lala | instant-markdown-d
I do have the "LearnBoost/socket.io#1126" problem and can't seem resolve it. However, everything else works.
I also see...
Error detected while processing function <SNR>91_popMarkdown..<SNR>91_popBuffer:
E716: Key not present in Dictionary: 1
...but I think that's a symptom and not the root cause.
Guys I've just pushed a fix to the backend which might solve your issues. Do [sudo] npm -g update instant-markdown-d to get it.
[sudo] npm -g update instant-markdown-d
Thanks for looking into this. I've updated instant-markdown-d to the latest version but it doesn't seem to make a difference. I believe the problem is not with the backend; after I load a markdown file in vim, I don't see a node or instant-markdown-d process running.
If I manually start instant-markdown-d and reload my buffer with :e then everything starts working (until I quit that buffer). It just won't seem to launch the backend for some reason.
Sorry for not answering before. I just updated instant-markdown-d and tried echo lala | instant-markdown-d but I just got an empty browser window, no content at all :(
When editing a markdown file I'm still getting the same behaviour. But I do actually see an instant-markdown-d process, but reloading the buffer does not show anything in the browser.
If you want me to do some tests, no problem, just tell.
@dpecos, @ffjia, could you guys please try this?
With a non-empty markdown file open, execute the following in the vim commandline:
:call system("curl -X PUT -T - http://localhost:8090/ &>/dev/null &", join(getbufline("%", 1, "$"), "\n"))
and tell me what happens. This will show us whether you can update the backend from the plugin in the first place. If this is successful, then I think the appropriate autocmds are not firing for some reason (maybe due to conflicting plugins)
@kgust Could you try this from a non-empty markdown file and see what happens? The process should start up and show the current content in a new browser window.
:call system("instant-markdown-d &>/dev/null &", join(getbufline("%", 1, "$"), "\n"))
@suan - I tried like you said, nothing happened, I only saw a blank webpage just like before.
@ffjia: Completely blank? You don't even see the github-style border? How bout if you do:
:call system("curl -X PUT -T - http://localhost:8090/ &>/dev/null &", "lala")
@suan - nothing showed up. I should see lala, but no.
@ffjia Do you have Google Talk/Skype/Facebook/some form of instant messaging? Might be easier than going back and forth here. You can email me your username info so I can add you...
@suan I tried the system call. It worked great. After several seconds, the browser tab opened and the content was loaded. As expected instant-markdown-d is listed in the process list.
@kgust what vim version are you running? could you provide the output of vim --version? Also could you try disabling all other plugins and seeing if it works then?
@suan This plugin was working for me earlier.
VIM - Vi IMproved
Here are additional steps I've taken.
$ vim -u /dev/null
But nothing happened. instant-markdown-d wasn't launched.
BTW, when attempting this, manually launching instant-markdown-d no longer works. I get a new blank tab and :e doesn't load anything in the browser. Your plugin isn't dependent on other plugins, right?
I just tried both system calls: the first one opens an empty window (well, If I display the source, I see an HTML content with some scripts in its head) and the second one ('lala' one) doesn't show anything.
I just purged all my bundles and use just yours in order to see if some of them was causing the problem, but I didn't work either, same behaviour.
If you want to check my vim settings and plugins, I have the .vim directory in a github repo. Just do a git clone https://github.com/dpecos/vim_settings.git .vim in your home directory (backup your .vim directory first!) and then add your plugin in .vim/bundle. I'm using pathogen so it should work as is.
git clone https://github.com/dpecos/vim_settings.git .vim
I'm having similar problems under Ubuntu 12.04. The instant-markdown-d server is rocking away, I can load it up, but the <body> remains empty via the echo lala pipe and when using the system call to curl within Vim. It does not appear that the issue lies in Vim land, but rather with instant-markdown-d.
This seems like two problems to me.
Mine is with the server not starting (it is in vim). @randallagordon @ffjia and @dpecos seem to have a problem AFTER the server starts (with the server).
Stepped through the code with node-inspector and tracked down the source of the problem on my end. Being in the habit of using sudo npm to install global packages I just went right ahead and used sudo gem... No go. Installed the gems without sudo and all is well!
Thanks much for the great work @suan!
Fine catch @randallagordon! I've added this scenario to the FAQ.
Just to confirm, doing as @randallagordon said, gem install redcarpet pygments.rb without sudo make get everything working smoothly!
gem install redcarpet pygments.rb
Thanks all you guys, set set shell=bash\ -i in vimrc can also solve this problem, please refer to http://stackoverflow.com/questions/10553875/alter-path-in-vim-macvim-so-as-to-find-the-right-ruby-binary
set shell=bash\ -i