Is it possible to add a feature to fold table of contents. Thanks
Added folding of TOC (#117)
The TOC can be folded by setting g:LatexBox_fold_toc = 1.
I added folding of TOC. Set g:LatexBox_fold_toc = 1 in your vimrc file, and it should work.
g:LatexBox_fold_toc = 1
Note that I only added one level of folds. I think this should suffice, but let me know if you disagree. I also did not change the text of the folds, which could be of interest.
Brilliant, thanks! I think that showing the number of lines in the text of the fold doesn't look nice so I if you could change that it would be great :-) If you could add two more levels that would also be cool (so for instance one could fold chapter, sections and subsections but not subsubsections). One last improvement could also be to add variable that allows the user to control the foldlevel. Thanks for a great plugin!
Ahhh and one minor thing , maybe you could introduce variable that allows to hide (or show) the toc help (the close, jump, jump and close and hide numbering part). Thank you once again!
Added option to hide TOC help text
Feature requested in #117
The option name is g:LatexBox_toc_hidehelp, and if this is
nonzero, the help text will be hidden.
Some modifications of TOC folding
Added option g:LatexBox_fold_toc_levels to set number of levels to fold (max
3). Also added foldtext function.
Done. I think my latest updates addresses all of your ideas.
Wowww that was incredibly quick! Thanks! One last idea, the fold text could have a tree-like appearance similar to NerdTree/vimfiler/tagbar? This is probably hard to implement but maybe you could add the following icons depending whether the fold is open or closed (or some other icon showing the "fold level"):
let g:latex_box_toc_iconchars = ['▸', '▾']
and some indentation to each fold level? This would somehow mimic PDF bookmarks rendering of chapter,sections,etc.
Here is an image of vimfiler (similar to NerdTree):
It is an interesting idea, but I think I will have to disappoint you. This is for two reasons, the first being the main one:
However, I am very happy to contribute with updates, and if you have other good ideas and suggestions, please open new issues! :)
Thank you! I''ll open a new issue if I have any other idea. However, Latex-Box is excellent the way it already is :)
I'm sorry to disturb you again but I found a behavior that is probably a feature but I was wondering whether it could change. If I have a folded section (in the text) and I click the corresponding section in the TOC it will not open the fold containing it, and one has to manually open each fold. I think that if Line 98 in latexbox/ftplugin/latextoc.vim is changed from
my desired behavior is obtained.
I promise that this will be last comment. I think that the syntax highlighting pattern of SecLine doesn't take into account spaces. The following image shows the problem (the buffer on the right is my colorscheme with the corresponding changes done to the syntax highlight groups). If you want I can open a new issue but since all my comments are TOC-related I thought that I could comment in this thread.
I'd prefer if you opened a new issue, actually. I'll have a look at the fold comment later today, but I might not have time to look at the SecLine issue today. I'm on holidays from tomorrow and until the end of the week, and I will not be near a computer at that time.
I agree that normal zv makes more sense than normal zt, and I have committed the change. As I said, please open a new issue for the other thing. :)
Use normal zv instead of normal zt (#117)
SecLine should take spaces into account (#117)
Ah, what the heck: The bug was easy to fix, so no need to open a new issue. But please do open new issues when you have them - it makes it better for future reference and similar.
Thank you so much! I'm terribly sorry for not opening a new issue. I'll do it in the future. Thanks once again.