Closed danielepiccone closed 8 years ago
I don't know how to achieve this, besides customizing the indenter to intentionally halve the shiftwidth
when in XML contexts. Have you ever achieved anything similar for another language? For instance, tried to make it so that C indented half the shiftwidth
for function calls, but the normal amount for blocks, or something?
Never tried, but I see this to be simpler because the different settings is belonging to different language context.
I imagine it would be something like this just for XML syntax when called inside jsx.vim
setlocal sw=2
the value could also be set as a parameter.
setlocal sets a value that's local to a buffer, not local to a vim source file.
yes, it doesn't have to be it. right now I am using it as an autocommand for .jsx files
Feel free to hack this up for your own use, but it's not clear to me that support is necessary in the package for different shiftwidths in JS vs. JSX.
Hi, I appreciate this plugin a lot in my everyday work. I am writing quite a lot of JSX markup in my js files, with intentation 4, which makes the file unreadable on small viewports due to line breaks.
I understand that on JSX syntax the plugin enables the same rules as XML, I was wondering how difficult it should be to enable
set sw=2
only for the JSX syntax. Thanks