ms-jpq / coq_nvim

Fast as FUCK nvim completion. SQLite, concurrent scheduler, hundreds of hours of optimization.
GNU General Public License v3.0
3.54k stars 101 forks source link

<C-h> is still mapped by coq even though 'keymap.recommended' is set to false #368

Closed jakubgros closed 2 years ago

jakubgros commented 2 years ago

Even though 'keymap.recommended' is set to false, some keys (<c-space>, <c-k>, <c-h>), which are defined in config/defaults.yml are is still mapped by the plugin.

As a workaround we can override these keys using additional settings, however in my opinion all the mappings should be disabled by setting 'keymap.recommended': v:false

let g:coq_settings = {
  \ 'keymap.recommended': v:false,
  \ 'keymap.jump_to_mark': '',
  \ 'keymap.bigger_preview': '',
  \ 'keymap.manual_complete: '',
\}
uttarayan21 commented 2 years ago

Workaround that works for me. Open

~/.local/share/nvim/site/pack/packer/start/coq_nvim/config/defaults.yml

and change the

keymap:
    jump_to_mark: <c-h>

to whatever

ms-jpq commented 2 years ago

eh, the docs are very clear on which setting does what.

https://github.com/ms-jpq/coq_nvim/blob/coq/docs/KEYBIND.md

maybe "recommended" is not the best word for it, but thats a breaking change with the reason being "i dont like the wording", which is honestly not worth it.

ms-jpq commented 2 years ago

the other reason to not unmap the keys is because there is no stable API for any of the keymaps, which is by design, since it allows me to remap the keys however the best way to do it is.

by stable API i mean like a fixed lua function name with fixed args.

so right now i can do whatever i want with the mapped function, and it will break none of my users configs.

sdondley commented 2 years ago

Sorry, but the docs aren't very clear to someone new to lua. Examples would be helpful:

vim.g.coq_settings = {
    keymap =  { jump_to_mark = "<c-\\" },
}
djensenius commented 2 years ago

I'm doing:

vim.g.coq_settings = {
  keymap = {
    recommended = false,
    jump_to_mark = '',
    pre_select = true,
  },
  auto_start = true,
  display = {
    pum = {
      fast_close = false
    }
  }
}

And the jump_to_mark is still not being overwritten...