【问题标题】:How to customize folding in vim-latex for my sections/commands?如何为我的部分/命令自定义 vim-latex 中的折叠?
【发布时间】:2013-01-10 16:31:49
【问题描述】:

我已经安装了vim-latex-suite,我想自定义折叠以与labbook 包一起使用。 labbook 包使用\labday\experiment\subexperiment 代替\chapter\section\subsection

我想在 Vim 中使用 vim-latex-suite 自定义折叠选项,以便 \labday\experiment\subexperiment 像传统的切片命令一样折叠。

我尝试将以下内容添加到我的~/.vim/after/ftplugin/tex.vim(但没有成功)

 " Folding sections
 let g:Tex_FoldedSections = ',labday,experiment,subexperiment'
 " Folding commands
 let g:Tex_FoldedCommands = ',labday,experiment,subexperiment'

谁能告诉我如何自定义 labbook 包的折叠方式?

【问题讨论】:

    标签: vim folding


    【解决方案1】:

    我觉得你应该放

    let g:Tex_FoldedSections = 'labday,experiment,subexperiment'`
    

    在您的.vimrc 本身中。如果您查看ftplugin/latex-suite/folding.vim,您会发现:

    if g:Tex_FoldedSections != '' 
        call Tex_FoldSections(g:Tex_FoldedSections,
            \ '^\s*\\frontmatter\|^\s*\\mainmatter\|^\s*\\backmatter\|'
            \. '^\s*\\begin{thebibliography\|>>>\|^\s*\\endinput\|'
            \. '^\s*\\begin{slide\|^\s*\\end{document')
    endif
    

    这意味着在插件加载后设置Tex_FoldedSections 将不起作用。还要确保您的乳胶文件本身中的部分正确嵌套。

    【讨论】:

    • 谢谢!看来我需要将命令放入~/.vim/ftplugin 而不是~/.vim/after/ftplugin。这样它将首先加载。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-11-02
    • 1970-01-01
    • 1970-01-01
    • 2011-03-20
    • 1970-01-01
    相关资源
    最近更新 更多