0

I am trying to edit an sql file in neovim. However the ftplugin/sql.vim (which I cant even find) sets some keybindings that start with <C-c> which is my <ESC> key.

I want searched the internet and the help page and found a "solution": Setting vim.g.ftplugin_sql_omni_key to 1. This however does not work for me (and apparently also not for others: https://www.reddit.com/r/neovim/comments/x2nc8o/cant_disable_sql_omni_complete_in_neovim_072/)

I also found the option to change <C-c> to something like <leader>sql. This did also not work...

I tried to manually unmap them within an autocmd, this does not work because "no mapping <C-c>c found". Which is a mystery to me too.

Is there any way i can disable these keybindings or change them to something else? Is this a bug that I should report?

Thank you.

1
  • Do you still have something open in your question? How can we help you further? Otherwise maybe could you accept one of the answers using the v button next to the arrow voting buttons. It allow the question to rest :-) Commented Apr 24 at 3:51

1 Answer 1

0

Disable the mapping

I would define the g:omni_sql_no_default_maps variable:

let g:omni_sql_no_default_maps=1

More information with :help sql-completion-customization

The general help about the builtin sql filetype can be accessed with :help ft_sql.txt.

Use another key

If you want to keep the completion mapping but not using Ctrl c you could also define g:ftplugin_sql_omni_key to another valid key. e.g.:

let g:ftplugin_sql_omni_key = <C-s>

Unmap

These mapping are buffer mapping. If you want to selectively unmap them you have to put unmap code in a ./config/nvim/after/ftplugin/sql.vim file:

unmap <buffer> <C-c>a
unmap <buffer> <C-c>k
unmap <buffer> <C-c>f
unmap <buffer> <C-c>o
unmap <buffer> <C-c>T
...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.