LaTeXTools icon indicating copy to clipboard operation
LaTeXTools copied to clipboard

Is it possible to use Reindent in this?

Open SimonRyang opened this issue 9 years ago • 3 comments

I did use the method in https://gist.github.com/albertxing/5298255#file-indentation-rules-tmpreferences, but it does not give a nice organized code. Maybe you can tell how to use that or a little bit improvement for indenting is feasible or not?

Thanks.

SimonRyang avatar Apr 11 '16 06:04 SimonRyang

You can save the file in that Gist anywhere that Sublime Text will see it. I'd recommend something like $packages_path\User\LaTeX - Indentation Rules.tmPreferences. You can find what I've called $packages_path by selecting the Preferences: Browse Packages option from the quick panel (c-shift-p) or via the Preferences|Browse Packages menu item. Note that indentation rules do not, by themselves, change already written text. They are designed to provide automatic indentation or de-dentation while you are typing.

If you want to organise an already written LaTeX file, you might try using latexindent. Somebody created a package that appears to run this in ST, but I can't really speak to how well it works. Perhaps this is yet another feature we should consider adding.

ig0774 avatar Apr 11 '16 12:04 ig0774

Thanks!

SimonRyang avatar Apr 13 '16 19:04 SimonRyang

FWIW. I find that I needed to add the text.tex.latex scope to the previous one to get it to work.

.... <string>Indentation Rules</string> <key>scope</key> <string>text.tex, sources.bib, text.tex.latex</string> ....

jaabell avatar Apr 15 '20 21:04 jaabell