webdesus / polymer-ide.vim

Provides autocompletion, and more for web components
MIT License
13 stars 3 forks source link

more basic instructions? #6

Open davidmaxwaterman opened 7 years ago

davidmaxwaterman commented 7 years ago

Hi,

I'm very happy to see there is a vim plugin, but my attempts to get it installed have not been successful. I wonder if there could be instructions that start from scratch.

So far, I've used pathogen to clone this repo into ~/.vim/bundles, added the pathogen commands to ~/.vimrc, and also done a npm install polymer-analyzer (and also tried with -g since that seemed to make more sense).

What I get when I edit a src/shop-app.html in the shop app is :

"src/shop-app.html" 542L, 16846C
Error detected while processing function polymer_ide#Enable..<SNR>31_bufferModified..<SNR>31_send_command..<SNR>31_get_process:
line    2:
E117: Unknown function: job_start
E15: Invalid expression: job_start(['node', s:plugin_path . '/../node_modules/polymer-editor-service/lib/polymer-editor-server.js'], {'callback': function('s:_on_stdout')})^I
line    3:
E121: Undefined variable: job
E15: Invalid expression: { 'job': job, 'cmd_id': 0, 'chanel': job_getchannel(job) }
Error detected while processing function polymer_ide#Enable..<SNR>31_bufferModified..<SNR>31_send_command..<SNR>31_get_process..<SNR>31_make_project_processes..<SNR>31_send_command..<SNR>31_get_process:
line    2:
E117: Unknown function: job_start
E15: Invalid expression: job_start(['node', s:plugin_path . '/../node_modules/polymer-editor-service/lib/polymer-editor-server.js'], {'callback': function('s:_on_stdout')})^I
line    3:
E121: Undefined variable: job
E15: Invalid expression: { 'job': job, 'cmd_id': 0, 'chanel': job_getchannel(job) }
Error detected while processing function polymer_ide#Enable..<SNR>31_bufferModified..<SNR>31_send_command..<SNR>31_get_process..<SNR>31_make_project_processes..<SNR>31_send_command..<SNR>31_get_process..<SNR>31_make_project_processes..<SNR>31_send_command..<SNR>31_get_process:
line    2:
E117: Unknown function: job_start
E15: Invalid expression: job_start(['node', s:plugin_path . '/../node_modules/polymer-editor-service/lib/polymer-editor-server.js'], {'callback': function('s:_on_stdout')})^I
line    3:
E121: Undefined variable: job
E15: Invalid expression: { 'job': job, 'cmd_id': 0, 'chanel': job_getchannel(job) }
-- More --

It seems clear that I've not done some basic setup step correctly, or at all.

Any clues to help me get this working? Thanks.

davidmaxwaterman commented 7 years ago

perhaps I need vim version 8 or above....I see that as a requirement, but the version for ubuntu seems to only be :

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 24 2016 16:43:18)
Included patches: 1-52
Extra patches: 8.0.0056

I guess I need to try to find how to get a more recent version.

webdesus commented 7 years ago

@davidmaxwaterman yes problem with version. My plugin use latest features async jobs. You should update vim. may be this instructions help you

davidmaxwaterman commented 7 years ago

ok, so I have vim 8 :

maxw@DESKTOP-PCK3HLA:~/z/shop$ vim --version | head
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jan 29 2017 21:40:50)
Included patches: 1-267
Modified by pkg-vim-maintainers@lists.alioth.debian.org
Compiled by pkg-vim-maintainers@lists.alioth.debian.org

but :h polymer_ide says there's no help, so I guess I missed something else.

webdesus commented 7 years ago

Hm, so strange try reinstall plugin.

webdesus commented 7 years ago

You install plugin manually. Docs not generated in manually mode.

webdesus commented 7 years ago

you can go to inside polimer_ide folder and run in console next command vim -c "helptags doc/". With command generate documentation.

davidmaxwaterman commented 7 years ago

I installed using the instructions on the pathogen.vim page you linked to...which says :

cd ~/.vim/bundle && \
git clone https://github.com/tpope/vim-sensible.git

Initially, I didn't do an npm install, but I figured you meant I should do that, even if I use my favourite package manager, and doing so seemed to help with a lot of the errors, but I still don't get anything different to normal...perhaps it's more subtle than I thought. I was trying the example app in your repo.

I'll read your README again more carefully and watch those videos again.

vim -c "helptags doc/" seems to make the :help polymer_ide command work, but seems to be a temporary solution. I don't think I did a "manual" installation, did I?

webdesus commented 7 years ago

From pathogen git repository

Normally to generate documentation, Vim expects you to run :helptags on each directory with documentation (e.g., :helptags ~/.vim/doc). Provided with pathogen.vim is a :Helptags command that does this on every directory in your 'runtimepath'. If you really want to get crazy, you could even invoke Helptags in your vimrc. I don't like to get crazy.

I use vundle plugin manager for vim and this manager automatically generate documentation

webdesus commented 7 years ago

I add new plugin in my .vimrc and then run command vim +PluginInstall +gall. I think all managers work same. But pathogen work differently.

Command npm install use for install polymer-editor-service. This service write on js and place inside in npm repository. If you know another place, you can use another packet manager. Which have polymer-editor-service.

davidmaxwaterman commented 7 years ago

Ok, but I'm still not sure I even have the plugin installed - I was just using the :help command to check if it was...it doesn't look anything like in your gifs anyway. Can you give me a way to check if it is installed?

Hrm, I just tried it from the ex prompt and it did seem to do something - ie I put the cursor over the first 's' on :

    <shop-category-data categories="{{categories}}"></shop-category-data>

and then did :

:call polymer_ide#GoToDefinition(':vs')

and hit return, and it opened another window for shop-category-data.html with the cursor over the '{' on the Polymer call.

That means it's working, right?

Odd that it doesn't look anything like your gifs though, but I guess those are other plugins you've loaded?

webdesus commented 7 years ago

That means it's working, right?

Seems work correct

other plugins

you mean paper-button,paper-splite?

webdesus commented 7 years ago

Odd that it doesn't look anything like your gifs

you can tune work plugin. All what you see on a gif possible

davidmaxwaterman commented 7 years ago

I mean you don't just have the polymer-ide plugin, so in the gif, there are other things that I don't have that I might mistake for polymer-ide?

For example, on the first gif, I see tabs at the top with the buffer names on...I could imagine that might be some other vim plugins that do that, but I'm not sure. Also, those 100% 50% things...I don't see anything like that.

However, the completion doesn't seem to work for me - how do I get that to work? The gif shows some underlining that I'm not seeing. It all looks quite different :/

I see some mentions in the docs that aren't familiar - omnifun and UltiSnips for example.

davidmaxwaterman commented 7 years ago

ok, well, anyway, thanks very much for your help. I'll see how I can fit it into my work flow. Perhaps I'm just not fluent enough with vim - I've been using vi since 1985, and tend to use vim much the same, so perhaps I need to learn more vim specific features. Thanks again.

davidmaxwaterman commented 7 years ago

I should probably just add that I'm using vim inside a command-line window, so there's no GUI - furthermore, I'm using it in bash-on-ubuntu-on-windows, so that might complicate things too (eg the function keys).

webdesus commented 7 years ago

I mean you don't just have the polymer-ide plugin, so in the gif, there are other things that I don't have that I might mistake for polymer-ide?

You right my plugin do only that i wrote:

for better position cursor plugin use UltiSnips. It's another plugin.

I am also new to the vim world. And i am use next plugin:

Plugin 'jlanzarotta/bufexplorer'
Plugin 'scrooloose/nerdtree'
Plugin 'tpope/vim-repeat'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'godlygeek/tabular'
Plugin 'othree/html5.vim'
Plugin 'ervandew/supertab'
Plugin 'pangloss/vim-javascript'
Plugin 'mattn/emmet-vim'
Plugin 'Valloric/MatchTagAlways'
Plugin 'joshdick/onedark.vim'
Plugin 'vim-airline/vim-airline'
Plugin 'qpkorr/vim-bufkill'
Plugin 'terryma/vim-multiple-cursors'
Plugin 'webdesus/polymer-ide.vim'
Plugin 'SirVer/ultisnips'
Plugin 'tomtom/tcomment_vim'
Plugin 'vim-syntastic/syntastic'
Plugin 'rust-lang/rust.vim

You can read about on each, maybe you find something intresting for you. And I use vundle manager, it's more easier install plugins

srsudar commented 7 years ago

Hmm, I'm also getting some problems that make me wonder if I'm not installing it correctly...

I am using Vim 8.0 on OSX. I installed it using vim-plug. Opening a file, I get a mess of errors, screenshot included below. After clicking through the file, I get more errors:

Error detected while processing function <SNR>125_bufferModified[1]..<SNR>125_send_command:
line    4:
E906: not an open channel
Error detected while processing function <SNR>125_bufferModified[2]..<SNR>125_send_command:
line    4:
E906: not an open channel

I guess I can't be positive that this it is polymer-ide.vim causing the problems, but deleting it from my .vimrc and reloading makes the problems go away. Anything obvious that I could be doing wrong here?

screen shot 2017-02-15 at 9 12 08 am

webdesus commented 7 years ago

@srsudar you forgot execute npm install inside plugin folder.

srsudar commented 7 years ago

Indeed I did. Is there a way to run a script as part of the install process that would remove that step? YouCompleteMe requires a secondary install step, but otherwise all my plugins don't require an extra step. I'd love to fold it into a single step if that were possible.

webdesus commented 7 years ago

Yes I has plan remove this step. I think it's should be possible.

webdesus commented 7 years ago

@srsudar vim-plug can run command after install plugin. Rewrite your line inside .vim

Plug 'webdesus/polymer-ide.vim', { 'do': 'npm install' }

This approach remove step execute manual npm install 😏