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:
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With