iamcco / markdown-preview.vim

⚠️ PLEASE USE https://github.com/iamcco/markdown-preview.nvim INSTEAD
792 stars 75 forks source link

Not working NeoVim #53

Closed mitchweaver closed 5 years ago

mitchweaver commented 6 years ago

Opens to a blank screen with a rectangle at the top. Same issue as with instant-markdown-d

Just wanted to let you know, maybe you can fix it.

wallforfry commented 6 years ago

Same issue in instant-markdown-d and markdown-preview.vim for me too

BUGLAN commented 6 years ago

set neovim python2 host and pip2 install neovim

sglavoie commented 5 years ago

As @BUGLAN pointed out, you need to define the Python provider. In your Neovim configuration file, you should have at least one of the following lines depending on which version of Python you wish to use:

let g:python_host_prog = '/usr/bin/python'
let g:python3_host_prog = '/usr/local/bin/python3.7'

In Neovim, you can run the command :checkhealth to make sure that your Python provider is set up correctly. If there is a problem, it will say something like this:

  • INFO: g:python_host_prog is not set. Searching for python2 in the environment. ... (more info)
  • WARNING: Latest python2-neovim is NOT installed: 0.3.1

If you have your provider set up correctly, it will say something like this:

  • INFO: Using: g:python3_host_prog = "/usr/local/bin/python3.7" ... (more info)
  • OK: Latest python3.7-neovim is installed: 0.3.1

In your terminal, you have to pip install neovim with the appropriate version of Python you will be using. To determine the values that go here:

let g:python_host_prog = 'VALUE_TO_PUT_HERE'
let g:python3_host_prog = 'OTHER_VALUE_TO_PUT_HERE'

You can use the command which like so:

$ which python # this prints the path to the Python 2 executable $ /usr/bin/python $ which python3 # this prints the path to the Python 3 executable $ /usr/bin/python3

Then, you have to use the pip command that corresponds to the Python version you want to use with Neovim. This could be pip, pip2, pip3, pip3.6, etc.

Once you have installed the package neovim with pip install neovim (replace pip for any other version like pip3 as necessary), you can verify that you have it installed with the command pip list.

If you really want to make sure that the desired version of Python has the package neovim installed, you can do something like this:

$ which python
$ /usr/bin/python  # this will be the path you will use in your configuration file (or equivalent)
$ python  # this will open an interactive Python prompt with '>>>' displayed at the beginning
>>> import neovim

When you type import neovim, you should have no feedback if it is installed. Otherwise, it will print something like this:

ImportError: No module named neovim

There you have it! I hope this makes sense and that you'll be able to resolve your issue.

sica07 commented 5 years ago

Tip: after running the :MarkdownPreview command, check the warnings/error messages in vim by doing: :messages This may help you with identifying the root of the issue. In my case it was an issue with the python host (as suggested above: while I have python3 support, this plugin needs also python2 support so I had to do a pip2 install pynvim

iamcco commented 5 years ago

i have make the markdown-preview.nvim plugin for neovim and it's more powerful