-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(buftype): add possibility of saving files locally #39
base: master
Are you sure you want to change the base?
Conversation
Necessary for building pdfs locally. The feature is added as an opt-in setting. The added variable 'g:AirLatexBuftype' has default value 'NOFILE' which has the usual behaviour (sets 'buftype' to 'nofile'). The value 'NORMAL' creates a normal buffer (sets 'buftype' to '') which allows for local saving of the files. Any other value will not be accepted and will have the same effect as the default.
I like this one. Could you please adapt the Best |
Lately I have been using this feature and I have noticed that the buffer name includes the project name (e.g. 'Overleaf Project/main.tex' would be the buffer name for the 'main.tex' file). |
Hi & sorry for letting you wait for so long with this! I think it is an great idea to let the user mirror overleaf projects partially or fully locally. My long-term idea is to use this core to implement a git-plugin that mirrors what has been done on the server as a dedicated On the way to such a general solution, you are very welcome to finish your solution and update this MR, for example by setting Best, |
Add automatic detection of project folder in case of local saving enabled (`NORMAL` mode selected for `g:AirLatexBuftype`). If the current directory has the same name of the Overleaf project, save the buffer within it, otherwise create the project folder and then save the buffer.
I am only answering now because I have been quite busy the last couple of weeks. Regarding the last commit, this is what can be done as of now, if choosing the option with locally writable buffers:
What is not possible is instead:
This was not something I had planned, but since you mentioned it, I just wanted to address it. I have solved the conflict problems by renaming the buffers to their actual file name only at the latest possible time. First I guarantee to be inside of a folder named after the Overleaf project and only then I change the file name from 'OverleafProject/filename' to just 'filename'. I have done this by adding an autocommand for each DocumentBuffer that calls a function just before writing the buffer. This happens only the first time a buffer gets written in a session, since afterwards it will be linked to a local file and so it will have a full and valid path. Anyway, I think that the biggest hassle right now is the necessity to manually move around, but it only happens with editing and saving multiple projects locally at the same time. On the other hand, for one project you would just need to go to the directory you want to save the files in once, then for all the following files of the same project, you would just need to save them and that would be it. Best, |
Just leaving a comment here in case anyone continues work on this branch. In my fork, I built a FUSE system such that compiled files and artifacts look "local" to programs like vimtex (which seems to work). I could have extended this fuse system to mirror overleaf source contents, but I got lazy and added dropbox integration instead since I get pro though my institution (also makes image uploads easier too). FUSE is particular to Linux (no OSX), but works OK: relevant PR: dmadisetti#27 So nothing is actually on disk, and everything is still synced. I have git integration too, which is useful, but I find myself using it only for checkpointing / major changes since edits are live |
Necessary for building pdfs locally. The feature is added as an opt-in
setting. The added variable 'g:AirLatexBuftype' has default value 'NOFILE'
which has the usual behaviour (sets 'buftype' to 'nofile'). The value
'NORMAL' creates a normal buffer (sets 'buftype' to '') which allows for
local saving of the files. Any other value will not be accepted and will
have the same effect as the default.