【问题标题】:Vim snipmate autocomplete conflictVim snipmate 自动完成冲突
【发布时间】:2011-07-02 09:34:34
【问题描述】:

我正在使用 Vim(Debian Squeeze 上的 7.2.445)和 vim-snipmate 插件(特别是它的这个分支 - https://github.com/garbas/vim-snipmate

您应该能够执行的快捷方式之一是 Ctrl-RTab,在插入模式下,你列出了所有可用的 sn-ps。然而,虽然列表显示,第一项在我按下 Tab 的那一刻自动插入到文件中,不管我没有选择它,我也不能使用 J 或 K 或向上或向下滚动列表,或输入更多字符以缩小搜索范围。

这是我的.vimrc

syntax on
set shiftwidth=4
set tabstop=4
set autoindent
set smartindent
set cursorline
set ruler
if version >= 703
  set relativenumber
else
  set number
endif
inoremap jj <ESC>
set hlsearch
noremap  <Up> ""
noremap! <Up> <Esc>
noremap  <Down> ""
noremap! <Down> <Esc>
noremap  <Left> ""
noremap! <Left> <Esc>
noremap  <Right> ""
noremap! <Right> <Esc>
inoremap <M-o>       <Esc>o
inoremap <C-j>       <Down>
let g:ragtag_global_maps = 1
filetype plugin on

call pathogen#runtime_append_all_bundles()
call pathogen#helptags()

【问题讨论】:

    标签: vim snipmate


    【解决方案1】:

    我知道这可能不是您正在寻找的答案,但是您是否尝试过使用其他 sn-p 插件,例如 XPTemplate 或 UltiSnips?我会发布直接链接,但我还没有足够的声誉:(你可以在 www.vim.org/scripts 轻松找到它们

    我在使用 snipMate 时遇到过类似的问题,最终通过切换到 XPTemplate 解决了这些问题。恕我直言,XPTemplate 和 UltiSnips 都是对 snipMate 的改进,根据我的经验(使用 XPTemplate),可以更好地与其他设置和插件一起使用(更不用说额外的功能了)。

    这里有一个 video 的 XPTemplate 正在使用中,还有一些 general information 是关于 vim 的 sn-p 插件。

    【讨论】:

    • 谢谢你。我还在习惯它(XPTemplate),但它至少运行可靠。
    猜你喜欢
    • 1970-01-01
    • 2018-10-28
    • 1970-01-01
    • 2023-03-30
    • 2021-04-10
    • 1970-01-01
    • 2011-07-22
    • 2011-10-22
    • 2011-06-20
    相关资源
    最近更新 更多