Created
March 30, 2011 11:56
-
-
Save danmichaelo/894275 to your computer and use it in GitHub Desktop.
VimLatex TagList patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Index: main.vim | |
| =================================================================== | |
| --- main.vim (revision 1075) | |
| +++ main.vim (working copy) | |
| @@ -886,7 +886,7 @@ | |
| " Sets Tlist_Ctags_Cmd for taglist.vim and regexps for ctags {{{ | |
| if exists("g:Tex_TaglistSupport") && g:Tex_TaglistSupport == 1 | |
| if !exists("g:tlist_tex_settings") | |
| - let g:tlist_tex_settings = 'tex;s:section;c:chapter;l:label;r:ref' | |
| + let g:tlist_tex_settings = 'tex;d:Sections;l:Labels;r:References' | |
| endif | |
| if exists("Tlist_Ctags_Cmd") | |
| @@ -897,20 +897,20 @@ | |
| if exists("g:Tex_InternalTagsDefinitions") && g:Tex_InternalTagsDefinitions == 1 | |
| let Tlist_Ctags_Cmd = s:tex_ctags ." --langdef=tex --langmap=tex:.tex.ltx.latex" | |
| - \.' --regex-tex="/\\\\begin{abstract}/Abstract/s,abstract/"' | |
| - \.' --regex-tex="/\\\\part[ \t]*\*?\{[ \t]*([^}]*)\}/\1/s,part/"' | |
| - \.' --regex-tex="/\\\\chapter[ \t]*\*?\{[ \t]*([^}]*)\}/\1/s,chapter/"' | |
| - \.' --regex-tex="/\\\\section[ \t]*\*?\{[ \t]*([^}]*)\}/\1/s,section/"' | |
| - \.' --regex-tex="/\\\\subsection[ \t]*\*?\{[ \t]*([^}]*)\}/+ \1/s,subsection/"' | |
| - \.' --regex-tex="/\\\\subsubsection[ \t]*\*?\{[ \t]*([^}]*)\}/+ \1/s,subsubsection/"' | |
| - \.' --regex-tex="/\\\\paragraph[ \t]*\*?\{[ \t]*([^}]*)\}/+ \1/s,paragraph/"' | |
| - \.' --regex-tex="/\\\\subparagraph[ \t]*\*?\{[ \t]*([^}]*)\}/+ \1/s,subparagraph/"' | |
| - \.' --regex-tex="/\\\\begin{thebibliography}/BIBLIOGRAPHY/s,thebibliography/"' | |
| - \.' --regex-tex="/\\\\tableofcontents/TABLE OF CONTENTS/s,tableofcontents/"' | |
| - \.' --regex-tex="/\\\\frontmatter/FRONTMATTER/s,frontmatter/"' | |
| - \.' --regex-tex="/\\\\mainmatter/MAINMATTER/s,mainmatter/"' | |
| - \.' --regex-tex="/\\\\backmatter/BACKMATTER/s,backmatter/"' | |
| - \.' --regex-tex="/\\\\appendix/APPENDIX/s,appendix/"' | |
| + \.' --regex-tex="/\\\\begin{abstract}/Abstract/d,abstract/"' | |
| + \.' --regex-tex="/\\\\part[ \t]*\*?\{[ \t]*([^}]*)\}/\1/d,part/"' | |
| + \.' --regex-tex="/\\\\chapter[ \t]*\*?\{[ \t]*([^}]*)\}/\1/d,chapter/"' | |
| + \.' --regex-tex="/\\\\section[ \t]*\*?\{[ \t]*([^}]*)\}/\1/d,section/"' | |
| + \.' --regex-tex="/\\\\subsection[ \t]*\*?\{[ \t]*([^}]*)\}/+ \1/d,subsection/"' | |
| + \.' --regex-tex="/\\\\subsubsection[ \t]*\*?\{[ \t]*([^}]*)\}/+ \1/d,subsubsection/"' | |
| + \.' --regex-tex="/\\\\paragraph[ \t]*\*?\{[ \t]*([^}]*)\}/+ \1/d,paragraph/"' | |
| + \.' --regex-tex="/\\\\subparagraph[ \t]*\*?\{[ \t]*([^}]*)\}/+ \1/d,subparagraph/"' | |
| + \.' --regex-tex="/\\\\begin{thebibliography}/BIBLIOGRAPHY/d,thebibliography/"' | |
| + \.' --regex-tex="/\\\\tableofcontents/TABLE OF CONTENTS/d,tableofcontents/"' | |
| + \.' --regex-tex="/\\\\frontmatter/FRONTMATTER/d,frontmatter/"' | |
| + \.' --regex-tex="/\\\\mainmatter/MAINMATTER/d,mainmatter/"' | |
| + \.' --regex-tex="/\\\\backmatter/BACKMATTER/d,backmatter/"' | |
| + \.' --regex-tex="/\\\\appendix/APPENDIX/d,appendix/"' | |
| \.' --regex-tex="/\\\\label[ \t]*\*?\{[ \t]*([^}]*)\}/\1/l,label/"' | |
| \.' --regex-tex="/\\\\ref[ \t]*\*?\{[ \t]*([^}]*)\}/\1/r,ref/"' | |
| endif |
Author
Author
Within Vim, this command may be useful:
TlistDebug ~/tlistdebug.txt
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I had issues with some TeX section headings showing up twice in Taglist. The cause of the problem was that Vim-LaTeX defines Tex-support for ctags, but my exuberant ctags 5.8 already had some native TeX-support:
When Vim-LaTeX tries to define it again on line 899 in main.vim, it results in the error
ctags: Warning: Language "tex" already defined.This error does not influence on TagList by itself, but Vim-LaTeX's definitions add to the native ones. Since the regexps of Vim-LaTeX appear to be more robust than the native ones, I simply modified main.vim to ignore the native definitions by using an unused character ("d") instead of "s" for the all the section-related regexps, and then modified the tlist_tex_settings. This workaround is not very elegant, but it works until someone comes up with something better. The best solution would certainly be a more robust native TeX-support in ctags.
Note that I kept the
--langdef=texargument, even though it results in an error when used with ctags with TeX support. The rationale is that the error does not seem to influence the way Taglist works, and leaving the argument out will break backwards compability.