将 MacVim 与 Vim Latex 结合使用时菜单项混乱

发布于 2024-09-01 22:01:23 字数 1557 浏览 4 评论 0原文

我昨天刚刚安装了 macvim,并且一直在尝试安装 vim Latex 今天。

我感到困惑的一件事是顶部栏上的菜单项:

-------------------------------------------------------------------------------
<apple icon> File Edit Tools Syntax TeX-Suite TeX-Environments TeX-Elements
-------------------------------------------------------------------------------
                                    | Packages >  |_____
                                    | Templates > | 1: |
                                    | Macros >    | 2: |
                                    |-----------  | 3: |
                                    | Compile     | 4: |
                                    | View        |-----
                                    | ...         |
                                     -------------

所以用文字来说,如果你去 TeX-Suite ->模板有一个子菜单,其中包含菜单项:1:2:3:4:

现在我知道这些模板就在这里:

% pwd
/Users/me/.vim/ftplugin/latex-suite/templates
% ls
IEEEtran.tex            article.tex             report.tex              report_two_column.tex

并且它们的命名正确。

我还知道 :TTemplate vim 命令应该做同样的事情。当我输入时,我得到这个结果:

Choose a template file:
(1) IEEEtran    (2) article
(3) report      (4) report_two_column

Enter number or name of file :  

所以我认为这一定是 MacVim 中的一个错误。这是一个合理的假设吗?有修复吗?

I just installed macvim yesterday and I have been trying to install vim latex today.

The one thing I am confused about is the menu items on the top bar:

-------------------------------------------------------------------------------
<apple icon> File Edit Tools Syntax TeX-Suite TeX-Environments TeX-Elements
-------------------------------------------------------------------------------
                                    | Packages >  |_____
                                    | Templates > | 1: |
                                    | Macros >    | 2: |
                                    |-----------  | 3: |
                                    | Compile     | 4: |
                                    | View        |-----
                                    | ...         |
                                     -------------

So in words if you go TeX-Suite -> Templates there is a sub menu with menu items: 1: 2: 3: 4:.

Now I know that these templates live here:

% pwd
/Users/me/.vim/ftplugin/latex-suite/templates
% ls
IEEEtran.tex            article.tex             report.tex              report_two_column.tex

and they are named correctly.

Also I know that the :TTemplate vim command should do the same thing. When I type that I get this result:

Choose a template file:
(1) IEEEtran    (2) article
(3) report      (4) report_two_column

Enter number or name of file :  

So I am thinking that this must be a bug in MacVim. Is this a reasonable assumption? Any fixes?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

涙—继续流 2024-09-08 22:01:23

问题是 vim-latex 将模板名称放在之后。当他们设置菜单时(请参阅“:h菜单”)。该文本应该显示关于使用什么命令来访问该特定菜单项的提示(例如,文件->保存在之后有“:w”),并且在大多数平台上,它显示在菜单的右侧项目。但是,在 Mac OS X 上,只能在菜单项的右侧显示键盘快捷键,因此,如果将鼠标悬停在菜单项上一段时间,则文本会显示在弹出窗口中。

解决这个问题的唯一方法是编辑 vim-latex 菜单文件并删除。从每个菜单命令。

The problem is that vim-latex puts the template name after the <Tab> when they set up the menus (see ":h menu"). This text is supposed to show a hint as to what command to use to access that particular menu item (e.g. File->Save has ":w" after <Tab>) and on most platforms it is displayed flush right on the menu items. However, on Mac OS X it is only possible to show keyboard shortcuts to the right in a menu item, so the text is instead displayed in a popup window if you let the mouse hover over the menu item for a while.

The only way to get around this problem is to edit the vim-latex menu files and delete the <Tab> from each menu command.

享受孤独 2024-09-08 22:01:23

我刚刚在 OS X 上安装了 vim-latex。为了显示模板菜单项,我将

exe "amenu ".g:Tex_TemplatesMenuLocation."&".i.":<Tab>".fname." ".

行更改为

exe "amenu ".g:Tex_TemplatesMenuLocation."&".fname." ".

文件 ~/.vim/ftplugin/latex-suite/templates.vim 中的 。获取 TeX-Suite -> 下的项目要显示宏,我将行更改

exe "amenu ".g:Tex_MacrosMenuLocation."&Delete.&".i.":<tab>".fname." :call <SID>DeleteMacro('".fname."')<CR>"
exe "amenu ".g:Tex_MacrosMenuLocation."&Edit.&".i.":<tab>".fname."   :call <SID>EditMacro('".fname."')<CR>"
exe "imenu ".g:Tex_MacrosMenuLocation."&".i.":<tab>".fname." <C-r>=<SID>ReadMacro('".fname."')<CR>"
exe "nmenu ".g:Tex_MacrosMenuLocation."&".i.":<tab>".fname." i<C-r>=

<SID>ReadMacro('".fname."')<CR>"
        exe "amenu ".g:Tex_MacrosMenuLocation."&Delete.&".fname." :call <SID>DeleteMacro('".fname."')<CR>"
        exe "amenu ".g:Tex_MacrosMenuLocation."&Edit.&".fname."   :call <SID>EditMacro('".fname."')<CR>"
        exe "imenu ".g:Tex_MacrosMenuLocation."&".fname." <C-r>=<SID>ReadMacro('".fname."')<CR>"
        exe "nmenu ".g:Tex_MacrosMenuLocation."&".fname." i<C-r>=<SID>ReadMacro('".fname."')<CR>"

~/.vim/ftplugin/latex-suite/custommacros.vim 中。

I just installed vim-latex on OS X. To get the templates menu items to show up I changed the line

exe "amenu ".g:Tex_TemplatesMenuLocation."&".i.":<Tab>".fname." ".

to

exe "amenu ".g:Tex_TemplatesMenuLocation."&".fname." ".

in the file ~/.vim/ftplugin/latex-suite/templates.vim. To get the items under TeX-Suite -> Macros to show up I changed the lines

exe "amenu ".g:Tex_MacrosMenuLocation."&Delete.&".i.":<tab>".fname." :call <SID>DeleteMacro('".fname."')<CR>"
exe "amenu ".g:Tex_MacrosMenuLocation."&Edit.&".i.":<tab>".fname."   :call <SID>EditMacro('".fname."')<CR>"
exe "imenu ".g:Tex_MacrosMenuLocation."&".i.":<tab>".fname." <C-r>=<SID>ReadMacro('".fname."')<CR>"
exe "nmenu ".g:Tex_MacrosMenuLocation."&".i.":<tab>".fname." i<C-r>=

to

<SID>ReadMacro('".fname."')<CR>"
        exe "amenu ".g:Tex_MacrosMenuLocation."&Delete.&".fname." :call <SID>DeleteMacro('".fname."')<CR>"
        exe "amenu ".g:Tex_MacrosMenuLocation."&Edit.&".fname."   :call <SID>EditMacro('".fname."')<CR>"
        exe "imenu ".g:Tex_MacrosMenuLocation."&".fname." <C-r>=<SID>ReadMacro('".fname."')<CR>"
        exe "nmenu ".g:Tex_MacrosMenuLocation."&".fname." i<C-r>=<SID>ReadMacro('".fname."')<CR>"

in ~/.vim/ftplugin/latex-suite/custommacros.vim.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文