禁用VIM omnicomplete或文件类型插件或东西 [英] Disable omnicomplete or ftplugin or something in vim

查看:580
本文介绍了禁用VIM omnicomplete或文件类型插件或东西的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图禁用SQL(自动/全向/ whichever-)完成。这是一个问题,对我来说,因为我用< C-C> 逃生,当在.SQL文件结尾似乎开始与一个令人沮丧的2秒暂停一些搜索。特别是,键入 K 在暂停期间造成了不必要的插入SQL关键字冲突。

的.vimrc有

 文件类型插件关闭
  设置omnifunc =

:文件类型收益文件类型检测:ON插件:OFF缩进:ON

但在插入模式< C-c取代; k 仍然打印

   - 全能补全(^ o ^ N ^ P)
   80`的比赛1,而自动填入

:详细IMAP< C-c取代; k 返回

  I< C-C> K * @ c为C  -  \\>< C-O>:通话sqlcomplete#地图(sqlKeyword \\\\ W *)&LT ; CR> c为C-X>< C-O>
        最后一组来自〜/ projects.vim

详细设置omnifunc 可以被覆盖,甚至当我:设置omnifunc = (当我将它设置为没有)直接:

  omnifunc = sqlcomplete#完成
        最后一组从/opt/local/share/vim/vim74/autoload/sqlcomplete.vim

更多的尽职调查:


  1. :帮助omnifunc

  2. :帮助文件类型插件

  3. 这一点,这也许是相同的,但没有得到回答:的如何关闭Omni在Vim的完整?

  4. 其他SO的意见,这是所有关于
  5. 开启这些功能
  6. 更改文件名具有不同suffic解决了这个问题
    但是这是愚蠢的。


解决方案

这些映射来自 $ VIMRUNTIME / ftplugin中/ sql.vim 。你会发现它在记载:帮助FT-SQL 。如何自定义/关闭在描述的映射:帮助SQL-完成的定制(和以下段落)。摘要:

如果您不希望任何这些映射的:

 让G:omni_sql_no_default_maps = 1

要重新定​​义只是恼人键:

 让G:ftplugin_sql_omni_key ='<利德华GT; SQL

您也可以完全通过选择禁用键不存在的一种:

 让G:ftplugin_sql_omni_key ='<即插即用GT; DisableSqlOmni

把任何那些进入你的的〜/ .vimrc

I am trying to disable (auto-/omni-/whichever-) completion in sql. It is a problem for me because I used <C-c> for escape and when the file end in .sql it seems to initiate some search with a frustrating 2 second pause. In particular, typing k during the pause is causing a collision that inserts unwanted sql keywords.

.vimrc has

  filetype plugin off
  set omnifunc=

and :filetype returns filetype detection:ON plugin:OFF indent:ON

but in insert mode <C-c>k still prints

  -- Omni completion (^O^N^P)
   match 1 of 80` while autocompleting

and :verbose imap <C-c>k returns

i  <C-C>k      *@<C-\><C-O>:call sqlcomplete#Map("sqlKeyword\\w*")<CR><C-X><C-O>
        Last set from ~/projects.vim

and verbose set omnifunc can be overwritten, even when I :set omnifunc= (when I set it to nothing) directly:

  omnifunc=sqlcomplete#Complete
        Last set from /opt/local/share/vim/vim74/autoload/sqlcomplete.vim

More due diligence:

  1. :help omnifunc
  2. :help ftplugin
  3. This, which is maybe the same, but wasn't answered: How do I turn off Omni Complete in Vim?
  4. Other SO advice, which is all about turning these features on
  5. Changing the filename to have a different suffic solves the problem but that is dumb.

解决方案

Those mappings come from $VIMRUNTIME/ftplugin/sql.vim. You'll find it documented under :help ft-sql. How to customize / turn off the mappings is described under :help sql-completion-customization (and following paragraphs). Summary:

If you don't want any of those mappings:

let g:omni_sql_no_default_maps = 1

To just redefine the annoying key:

let g:ftplugin_sql_omni_key = '<Leader>sql'

You can also completely disable that key by choosing a nonexisting one:

let g:ftplugin_sql_omni_key = '<Plug>DisableSqlOmni'

Put any of those into your ~/.vimrc.

这篇关于禁用VIM omnicomplete或文件类型插件或东西的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆