derekelkins / agda-vim

Agda interaction in vim
BSD 2-Clause "Simplified" License
130 stars 47 forks source link

Python being parsed as Vimscript #19

Closed ghost closed 8 years ago

ghost commented 8 years ago

When I open up an Agda file in Neovim with agda-vim, I immediately get this:

"AgdaBasics.agda" 5L, 76C
Error detected while processing /home/tom/.vim/plugged/agda-vim/ftplugin/agda.vim:
line  121:
E488: Trailing characters: # start Agda
line  133:
E133: :return not inside a function
line  137:
E133: :return not inside a function
line  151:
E133: :return not inside a function
line  193:
E133: :return not inside a function
line  194:
E133: :return not inside a function
line  202:
E133: :return not inside a function
line  241:
E10: \ should be followed by /, ? or &
line  285:
E133: :return not inside a function
line  293:
E133: :return not inside a function
line  295:
E133: :return not inside a function
line  302:
E133: :return not inside a function
line  306:
E133: :return not inside a function
line  309:
E133: :return not inside a function
line  507:
E170: Missing :endfor

This lines of code are in the Python bit of agda.vim, so it looks like Neovim is parsing the Python as Vimscript. Do you know why?

Thanks, Tom

derekelkins commented 8 years ago

It's quite possible that Neovim has a stronger separation between parsing and execution than vim. You can try replacing the line (line 116) exec s:python_until_eof with python << EOF and see if that helps.

ghost commented 8 years ago

Huh. That's stopped the error messages, but I only have syntax highlighting. None of the commands are even defined.

derekelkins commented 8 years ago

This sounds like you don't have Python (or at least Python 2) support. I would make sure that plugin is enabled and that you have Python 2 installed.

ghost commented 8 years ago

No, I do have the python 2 executable installed (which is what you mean, right?). I think Neovim is not loading the plugin for some reason, which is odd because I thought Neovim didn't change Vimscript at all.

I'm not sure I have the willpower to persist at trying to fix this.

derekelkins commented 8 years ago

It looks like Neovim requires some extra steps for Python support to work: http://stackoverflow.com/questions/31902197/support-doesnt-work I don't use Neovim, so I can't verify if these will help.

ghost commented 8 years ago

It works! Thanks so much. This page mentions Python modules in particular, so there must be something going on with them.

That also fixed the original error messages - I no longer need my modified versions of the source code, which is great.