0

I want to map to close quickfixlist, but when I do it will just send a message Type :qa and press <Enter> to exit vim.

I just do this nnoremap <silent><C-cc> :cclose<CR>

8
  • 1
    do you mean ctrl c then ctrl c? or ctrl c then c
    – Mass
    Apr 13, 2022 at 1:29
  • @Mass I mean I will hold the CTRL and press c twice
    – zer09
    Apr 13, 2022 at 6:24
  • 2
    @zer09 the notation for that is still <C-c><C-c>
    – D. Ben Knoble
    Apr 13, 2022 at 13:51
  • @D.BenKnoble Thanks it work
    – zer09
    Apr 14, 2022 at 5:53
  • @zer09 It's not possible to hold CTRL and press c twice quickly and certainly <C-cc> is not something Vim understands. There are however some plugins that allow something similar, like the tinymode or tinykeymap plugin Apr 14, 2022 at 6:15

1 Answer 1

1

First your expression <C-cc> is not right like this, but guessing from the comments you want to remap <C-c><C-c>.

The problem with this is, that you cannot map like this because this is the SIGINT signal (if I remember correctly).

It is possible though -> see :help map-CTRL-C.

So to remap <C-c> Vim has to be waiting for a key, so maybe try to use <leader><C-c><C-c> or something like this.

2
  • It works using <C-c><C-c> unless you press it slowly. Before I changed my config, <C-c><C-c> is a default mapping on one plugin I use, If I remember correctly it was Coc. Temporarly I use <Leader>cc but I want C-cc back because I can just press Ctrl with my side palm and press cc quickly.
    – zer09
    Apr 14, 2022 at 5:59
  • in fact I was able to map <C-c><C-c>; the issue arises when vim is busy.
    – D. Ben Knoble
    Apr 14, 2022 at 18:04

Your Answer

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

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