hadronized / hop.nvim

Neovim motions on speed!
Other
2.47k stars 137 forks source link

BUG: hop should not show on the quickfix #370

Closed Zeioth closed 1 year ago

Zeioth commented 1 year ago

I have hop binded to ENTER, chick makes the quickfix unusable for me.

It doesn't colide with anything else, just the quickfix. Maybe we could exclude that buftype?

Zeioth commented 1 year ago

related to #309

Zeioth commented 1 year ago

For my case the solution has been creating this autocmd

vim.api.nvim_create_autocmd("FileType", {
  desc = "Delete hop mappings for the desired filetypes",
  group = vim.api.nvim_create_augroup("hop", { clear = true }),
  callback = function()
    if vim.bo.filetype == 'qf' then -- quickfix
      vim.api.nvim_buf_set_keymap(0, 'n', '<C-m>', '<C-m>', { silent = true })
    end
  end,
})

It is important to create the autocmd AFTER where you are defining your hop mappings. As order of precedence might prevent it from working.