MaxMEllon / vim-jsx-pretty

:flashlight: [Vim script] JSX and TSX syntax pretty highlighting for vim.
MIT License
969 stars 38 forks source link

[Question] Using Emmet with vim-jsx-pretty #131

Closed overbyte closed 4 years ago

overbyte commented 4 years ago

I had a dig through the source code but there's no obvious way i can see of doing this so I hope you guys know.

When i used mxw/vim-jsx (deprecated in favour of vim-jsx-pretty), emmet would know to use jsx-specific attribute names like className instead of class. Is there a way to fix this here please?

Thanks ;oB

yuezk commented 4 years ago

@overbyte Below are the emmet settings of myself. It works well for me, you can have a try.

" -----------------------------------------------------------------------------
" emmet-vim
" -----------------------------------------------------------------------------
let g:user_emmet_mode='a'    "enable all function in all mode.
let g:user_emmet_install_global = 0

let g:user_emmet_settings = {
      \  'javascript' : {
      \      'extends' : 'jsx',
      \  },
      \}

augroup emmet
  autocmd!
  autocmd FileType html,vue,css,less,jsx,javascript,javascriptreact,typescriptreact EmmetInstall
augroup END
overbyte commented 4 years ago

sweet dude - i'll try that and see what happens.

EDIT - that seems to have sorted it out - thanks so much for the input