0

I'm trying to map C-S-[ and C-S-] respectively to :tabprev and tabnext, but when I try that then I get "no lines in buffer".

A mapping like C-S-tab works. I looked through :nmap and didn't find an existing mapping. What am I missing?

3
  • 2
    This might be helpful: How to debug a mapping.
    – statox
    Jul 16, 2020 at 18:51
  • Does this answer your question? How to debug a mapping?
    – Zoe
    Apr 19, 2021 at 12:18
  • I closed this as a dupe of the Q you mentioned in your answer, since that's what you indicated solved the problem. Note that this closure is *not a bad thing*—it may well help others find the answer to a similar problem! (and, since no else seems to have said it, welcome to Vi and Vim!)
    – D. Ben Knoble
    Apr 19, 2021 at 14:51

1 Answer 1

0

Thanks to the link in the comment by @statox♦ I was able to figure this out. This answer included a link to this question where the accepted answer explains that intercepting a <C-f> is equivalent to intercepting a <C-F> (technically <C-S-f>) in gvim, because:

Vim reads characters from the terminal, which sends ^F (ASCII code 0x06) for both Ctrl+f and Ctrl+Shift+f; Vim has no way of knowing whether you pressed the Shift key.

The solution is to just map C-[ and C-], which works well for me.

1
  • 4
    Be careful though, <c-[> is an equivalent of <esc> and <c-]> is "Jump to the definition of the keyword under the cursor". You might want to use something else, e.g <leader>].
    – Biggybi
    Jul 20, 2020 at 9:57

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