MaxMEllon / vim-jsx-pretty

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

Auto-indenting of properties? #110

Closed vjsingh closed 4 years ago

vjsingh commented 4 years ago

Given the following code block:

<Component a={1} b={2} c={3}
/>

or

<Component
  a={1} b={2} c={3}
/>

I can't get the plugin to auto-indent to the below. Is this supposed to work?

<Component
  a={1}
  b={2}
  c={3}
/>
yuezk commented 4 years ago

@vjsingh This scenario is not supported. Because the indentexpr in vim can only return the indent space of the current line, it can not modify the content.

See h:indentexpr for more info.

vjsingh commented 4 years ago

@yuezk OK my fault, thanks for the info.