Skip to content
This repository has been archived by the owner on Dec 16, 2020. It is now read-only.

Can't get this to work with vim-polyglot, or at all #1

Closed
statico opened this issue Sep 17, 2017 · 4 comments
Closed

Can't get this to work with vim-polyglot, or at all #1

statico opened this issue Sep 17, 2017 · 4 comments

Comments

@statico
Copy link

statico commented Sep 17, 2017

I'm using vim-polyglot, which includes vim-jsx and pangloss/vim-javascript, and I don't get any syntax highlighting in my inline styles in my CSS. I've also tried removing vim-polyglot and installing vim-jsx and vim-javascript manually. My .vimrc is hosted here, but I've tried starting Vim without a config using vim -u NONE foo.js. Any ideas?

image

Code in question

https://github.com/statico/aspen/blob/cb65123f1530b410ee3d941fd08399601678edba/pages/index.js#L182-L194

vim --version

MacOS X (unix) version
Included patches: 1-596
Compiled by Homebrew
Huge version without GUI.  Features included (+) or not (-):
+acl             +file_in_path    +mouse_sgr       +tag_old_static
+arabic          +find_in_path    -mouse_sysmouse  -tag_any_white
+autocmd         +float           +mouse_urxvt     -tcl
-balloon_eval    +folding         +mouse_xterm     +termguicolors
-browse          -footer          +multi_byte      +terminfo
++builtin_terms  +fork()          +multi_lang      +termresponse
+byte_offset     -gettext         -mzscheme        +textobjects
+channel         -hangul_input    +netbeans_intg   +timers
+cindent         +iconv           +num64           +title
-clientserver    +insert_expand   +packages        -toolbar
+clipboard       +job             +path_extra      +user_commands
+cmdline_compl   +jumplist        +perl            +vertsplit
+cmdline_hist    +keymap          +persistent_undo +virtualedit
+cmdline_info    +lambda          +postscript      +visual
+comments        +langmap         +printer         +visualextra
+conceal         +libcall         +profile         +viminfo
+cryptv          +linebreak       +python          +vreplace
+cscope          +lispindent      -python3         +wildignore
+cursorbind      +listcmds        +quickfix        +wildmenu
+cursorshape     +localmap        +reltime         +windows
+dialog_con      -lua             +rightleft       +writebackup
+diff            +menu            +ruby            -X11
+digraphs        +mksession       +scrollbind      -xfontset
-dnd             +modify_fname    +signs           -xim
-ebcdic          +mouse           +smartindent     -xpm
+emacs_tags      -mouseshape      +startuptime     -xsmp
+eval            +mouse_dec       +statusline      -xterm_clipboard
+ex_extra        -mouse_gpm       -sun_workshop    -xterm_save
+extra_search    -mouse_jsbterm   +syntax          
+farsi           +mouse_netterm   +tag_binary      
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X_UNIX  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       
Linking: clang   -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib  -L/usr/local/lib -o vim        -lncurses -liconv -framework Cocoa   -mmacosx-version-min=10.12 -fstack-protector-strong -L/usr/local/lib  -L/usr/local/Cellar/perl/5.24.1/lib/perl5/5.24.1/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc -F/usr/local/opt/python/Frameworks -framework Python   -lruby.2.4.1 -lobjc    
@statico
Copy link
Author

statico commented Sep 17, 2017

FWIW, in that sample I'm using the <style> tag without the jsx attribute. Using the tag like <style jsx> doesn't make a difference.

@fleischie
Copy link

fleischie commented Sep 24, 2017

Hey @statico. 👋

vim-styled-jsx is neither installed via vim-polyglot nor your .vimrc. Are you sure this package is installed in your setup?

Edited: Apart from that, this plugin only detects styled-jsx if you explicitly write <style jsx> or <style jsx global> or <style global jsx>. It at least needs style and jsx in an XML Tag. (The actual regexp is "<style.*jsx.*>".

@statico
Copy link
Author

statico commented Sep 24, 2017

Hey! 😄

So it's a load order issue. Normally my runtime path looks something like this:

runtimepath=~/.vim,~/.vim/bundle/molokai,~/.vim/bundle/vim-pathogen,~/.vim/bundle/vim-polyglot,~/.vim/bundle/vim-styled-jsx,/usr/local/share/vim/vimfiles, /usr/local/share/vim/vim80,/usr/local/share/vim/vimfiles/after,~/.vim/bundle/vim-styled-jsx/after,~/.vim/bundle/vim-polyglot/after,~/.vim/after,/usr/local/o pt/fzf,~/.fzf

And the colors don't show up. But if I mv ~/.vim/bundle/vim-styled-jsx ~/.vim/bundle/aaaaaaaaa so that vim-styled-jsx in the runtimepath before vim-polyglot, everything is fine.

image

Thanks for the suggestions. cc @sheerun (vim-polyglot) who might be interested.

@statico statico closed this as completed Sep 24, 2017
statico added a commit to statico/dotfiles that referenced this issue Sep 24, 2017
@sheerun
Copy link

sheerun commented Sep 26, 2017

You can also disable single syntax as described in the readme :) Then the load order doesn't matter probably

jadams pushed a commit to jadams/vimrc that referenced this issue Nov 22, 2017
trotzig added a commit to trotzig/dotfiles that referenced this issue Jun 3, 2020
These plugins make the colors look nicer when developing javascript and
react code.

I tried to enable vim-styled-jsx as well, but ran into an issue with
load order and couldn't get it to work.

alampros/vim-styled-jsx#1

I tried renaming the plugin folder A_vim-styled-jsx to fix loading order
(as suggested here:
https://stackoverflow.com/questions/20036921/vim-pathogen-and-load-order-of-ftplugin-files)
but that didn't work.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants