5

I am using Vim with Pathogen, vim-jsx, and vim-javascript.

I have trouble getting the correct indentation. When I am breaking one line that is too long into several pieces (without adding new blocks), the next line loses its correct indentation (and the next one after that, etc). This is really annoying and blocks me from using gg=G.

Let me illustrate:

enter image description here

In the gif, I am breaking the conversationPage line, and then reindenting the next two lines with ==.

I have no such problems with my other vim-js-indent plugin, thoguh, but it doesn't support JSX. Any help would be greatly appreciated.

3

Ok, I've figured out a way to do this in my environment. I had to shrink and cut pangloss vim-javascript a little bit. Here's my fork:

https://github.com/seavan/vim-javascript-plus

You should install it along with vim-jsx in your bundle directory. It will work.

I removed some of the latest pangloss updates to make it work. Hopefully I will merge them back after a while. enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.