Skip to content

Option to set the target for compilation to a newly opened subfile automatically #1838

@p135246

Description

@p135246

Situation: My LaTeX documents use the subfiles package and have the following structure. There is a main file text.tex in the root folder . and a bunch of subfiles subfile1.tex, subfile2.tex, ... in the folder ./subfiles. I mostly edit one subfile at a time, e.g., subfile1.tex, and hence press <localleader>ls immediately after opening it to change the target for compilation to subfile1.tex. This is because vimtex automatically finds the main file text.tex after opening a subfile and sets the target for compilation to text.tex.

Request: Would it be possible to add a variable which would modify the default behavior and save me of pressing <localleader>ls every time I open a subfile in a session where no valid target for compilation is set yet?

Details: If the variable was set to 0, then everything would work as it does now. If it was set to 1, then, after opening a subfile, the target for compilation would be automatically set to that subfile. This should happen only if no valid target for compilation is set yet, e.g., when vim is freshly started or when the file which is the current target for compilation is closed. In other cases, i.e., opening additional tabs, the target for compilation should remain the same.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions