cmhughes / latexindent.pl

Perl script to add indentation (leading horizontal space) to LaTeX files. It can modify line breaks before, during and after code blocks; it can perform text wrapping and paragraph line break removal. It can also perform string-based and regex-based substitutions/replacements. The script is customisable through its YAML interface.
GNU General Public License v3.0
867 stars 84 forks source link

Ignore Folder #478

Closed PapierFliegr closed 11 months ago

PapierFliegr commented 11 months ago

Is it possible to ignore all files in a subfolder?

I have the following folder structure:

├── main.tex
└── preamble
    ├── mathcommands.tex
    ├── packages.tex
    └── setup.tex

I'd like to run some replacements but if I run this on the whole document, the files in preamble are affected as well. There is the possibility to ignore verbatim blocks and/or indentation with the flags -rv or -rr, but both still admit replacements. I want these files to be completely ignored by latexindent.

Can I somehow specify in latexindent.yaml to ignore the folder preamble?

cmhughes commented 11 months ago

How are you calling latexindent?

On Fri, 22 Sep 2023, 15:26 PapierFliegr, @.***> wrote:

Is it possible to ignore all files in a subfolder?

I have the following folder structure:

├── main.tex └── preamble ├── mathcommands.tex ├── packages.tex └── setup.tex

I'd like to run some replacements but if I run this on the whole document, the files in preamble are affected as well. There is the possibility to ignore verbatim blocks and/or indentation with the flags -rv or -rr, but both still admit replacements. I want these files to be completely ignored by latexindent.

Can I somehow specify in latexindent.yaml to ignore the folder preamble?

— Reply to this email directly, view it on GitHub https://github.com/cmhughes/latexindent.pl/issues/478, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQ7CYAHZECRMUE6HPO2I2DX3WN2TANCNFSM6AAAAAA5DGGR2A . You are receiving this because you are subscribed to this thread.Message ID: @.***>

PapierFliegr commented 11 months ago

I am using VSCode with the extention Latex-Workshop and when saving latexindent gets called automatically with these settings image

cmhughes commented 11 months ago

Thanks for this.

It seems that your issue is actually to do with Vscode....

Latexindent operates on the files that it is told to operate on, so perhaps ask the vscode folks how to customise which files you want indented...?

PapierFliegr commented 11 months ago

Okay, thank you, I will try that :)