bigfish / vim-js-context-coloring

JavaScript Context Coloring in Vim
MIT License
151 stars 8 forks source link

Installation with Vundle #14

Open agarrharr opened 10 years ago

agarrharr commented 10 years ago

Is it possible to install it with Vundle? I tried by adding:

Bundle "bigfish/vim-js-context-coloring"

to my .vimrc and running:

:BundleInstall

When I restarted vim, I tried the command:

:JSContextColor

And it said:

E492: Not an editor command: JSContextColor
bigfish commented 10 years ago

I tried out using Vundle with the plugin and it worked.. but you still need to do 'npm install' in the repo... did you do that? I don't see way to do a post-install command in Vundle, unless I'm missing something.

agarrharr commented 10 years ago

Yes, I did go and run npm install. It installed esprima and eslevels in node_modules.

bigfish commented 10 years ago

Apologies for the lengthy delay. I decided to try out using Vundle, instead of pathogen. While my plugin worked no problem when it was the only one I loaded, I did see an issue where another plugin precedes it in the runtime path (which determines the order plugins are loaded in)... this may be causing my plugin not to load in your case. Can you try it, by itself, with no other plugins loaded ? You may need to temporarily relocate other plugins in you 'bundle' directory. I'm about to push a new version of the plugin, so this may also resolve the issue.

agarrharr commented 10 years ago

I moved all of my plugins out of the bundle directory, except for vundle and vim-js-context-coloring and I still have the same issue...

bigfish commented 10 years ago

hmm, what OS, version of Vim, and node are you using? Did you try reinstalling the plugin? The dependencies have changed - now using uglifyjs.

Also, what version of Vundle.. I used :PluginInstall, not BundleInstall, though not sure if it makes any difference.

To see if backend is working, try enabling debug mode, ie. in .vimrc:

let g:js_context_colors_debug = 1

and try opening a .js file (it will only work for .js files), preferably not a huge one. You should see some json show up in the command line area. Let me know what happens..

agarrharr commented 10 years ago

I'm using a late 2013 macbook pro running OS X 10.9.4, iTerm 2 Build 1.0.0.20140629, tmux, vim 7.4 compiled by Homebrew, node version 1.4.15.

Yes I made sure that I reinstalled it and ran npm install. I used the :BundleInstall command. I've never heard of :PluginInstall, but I just tried it as well.

I also just added this line to me .vimrc and opened up a js fil and I didn't see anything in the command line area:

let g:js_context_colors_debug = 1
bigfish commented 10 years ago

I'm having some trouble to reproduce this, I only have an older mac, so unable to install more recent vim using homebrew. However it works for me using iterm 2, tmux, and MacVim 7.2. node 0.8.14.

The only way I can get the 'not an editor command' error to show up is if I didn't run 'npm install' in the bundle/vim-js-context-coloring dir. Do you still see that error after running npm install ... ?

odyssey ~/.vim/bundle/vim-js-context-coloring master

: npm install npm http GET https://registry.npmjs.org/uglify-js npm http 304 https://registry.npmjs.org/uglify-js npm http GET https://registry.npmjs.org/source-map npm http GET https://registry.npmjs.org/async npm http GET https://registry.npmjs.org/optimist npm http 304 https://registry.npmjs.org/source-map npm http 304 https://registry.npmjs.org/async npm http 304 https://registry.npmjs.org/optimist npm http GET https://registry.npmjs.org/wordwrap npm http GET https://registry.npmjs.org/amdefine npm http 304 https://registry.npmjs.org/wordwrap npm http 304 https://registry.npmjs.org/amdefine uglify-js@2.3.6 node_modules/uglify-js ├── async@0.2.10 ├── optimist@0.3.7 (wordwrap@0.0.2) └── source-map@0.1.37 (amdefine@0.1.0)

what does 'node -v' say .. and in vim, what is the output of ':version' ? This is most puzzling :-/

agarrharr commented 10 years ago

Yes, I ran npm install in the vim-js-context-coloring directory. node -v says v0.10.28 and :version in vim says:

:version VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jun 19 2014 14:16:02) MacOS X (unix) version Included patches: 1-258 Compiled by Homebrew Huge version with MacVim GUI. Features included (+) or not (-): +acl +cmdline_info +emacs_tags -gettext -lua +mouse_urxvt +profile +statusline +transparency -X11 +arabic +comments +eval -hangul_input +menu +mouse_xterm +python -sun_workshop +user_commands -xfontset +autocmd +conceal +ex_extra +iconv +mksession +multi_byte -python3 +syntax +vertsplit +xim +balloon_eval +cryptv +extra_search +insert_expand +modify_fname +multi_lang +quickfix +tag_binary +virtualedit -xsmp +browse +cscope +farsi +jumplist +mouse -mzscheme +reltime +tag_old_static +visual -xterm_clipboard ++builtin_terms +cursorbind +file_in_path +keymap +mouseshape +netbeans_intg +rightleft -tag_any_white +visualextra -xterm_save +byte_offset +cursorshape +find_in_path +langmap +mouse_dec +odbeditor +ruby +tcl +viminfo -xpm +cindent +dialog_con_gui +float +libcall -mouse_gpm +path_extra +scrollbind +terminfo +vreplace +clientserver +diff +folding +linebreak -mouse_jsbterm +perl +signs +termresponse +wildignore +clipboard +digraphs -footer +lispindent +mouse_netterm +persistent_undo +smartindent +textobjects +wildmenu +cmdline_compl +dnd +fork() +listcmds +mouse_sgr +postscript -sniff +title +windows +cmdline_hist -ebcdic +fullscreen +localmap -mouse_sysmouse +printer +startuptime +toolbar +writebackup system vimrc file: "$VIM/vimrc" user vimrc file: "$HOME/.vimrc" 2nd user vimrc file: "~/.vim/vimrc" user exrc file: "$HOME/.exrc" system gvimrc file: "$VIM/gvimrc" user gvimrc file: "$HOME/.gvimrc" 2nd user gvimrc file: "~/.vim/gvimrc" system menu file: "$VIMRUNTIME/menu.vim" fall-back for $VIM: "/Applications/MacVim.app/Contents/Resources/vim" Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe -DMACOS_X_UNIX -F/usr/local/Cellar/python/2.7.7_1/Frameworks -UFORTIFY SOURCE -D_FORTIFY_SOURCE=1 -I/System/Library/Frameworks/Tcl.framework/Headers -D_REENTRANT=1 -D_THREAD_SAFE=1 -D_DARWIN_C_SOURCE=1 Linking: clang -L. -L/usr/local/lib -L. -L/usr/local/lib -L/usr/local/Cellar/python/2.7.7_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config -F/usr/local/Cellar /python/2.7.7_1/Frameworks -L/usr/local/lib -o Vim -framework Cocoa -framework Carbon -lm -lncurses -liconv -framework Cocoa -fstack-protector -L/usr/local/lib -L/Sy stem/Library/Perl/5.16/darwin-thread-multi-2level/CORE -lperl -framework Python -F/System/Library/Frameworks -framework Tcl -framework CoreFoundation -framework Ruby

bigfish commented 9 years ago

Sorry, I have no idea why it didn't work for you. Perhaps try again? It has been changed quite a bit lately, using different backend CLI. Also try loading it before other plugins. I'm using Vundle on Ubuntu , in Gnome Terminal, and it works fine.. must be something in your environment, I suspect, but darned if I know what :/