Why `vim.keymap.set` is case sensitive sometimes and insensitive other times?

Hi everybody, I have these two mappings to work with clipboard selection (+ register in nvim), and I’m puzzled by the fact that I specified <C-V> for pasting in insert mode and it correctly let me use the key combination CTRL-SHIFT-v (notice that V is in uppercase when setting the mapping).

However I have <C-C> for copying but it works with CTRL-c, and if I press CTRL-SHIFT-c, it doesn’t do anything and just keeps me in visual selection mode.

It’s not a big deal, but it breaks homogeneity for me.

-- copy, visual mode
vim.keymap.set('v', '<C-C>', '"+y')
-- paste, insert mode
vim.keymap.set('i', '<C-V>', '"+gP')

I know modifier keys can be in lower or uppercase, but what is Neovim considering for the {rhs}?

Also, if I press just CTRL-v for pasting it prints the {rhs} pasting command, which is "+gP, but as text instead of acting as command.

These mappings aren’t applied at all when you pressed these keys, because they are handled by the terminal emulator. This means that CTRL-SHIFT-V works in your terminal emulator even if you don’t have any mappings.

You are correct. I didn’t notice that it was using the terminal mapping to paste text. However CTRL-SHIFT-c, also from my terminal, doesn’t work, so I’ll keep that mapping.

So the lack of homogeneity was because that. I’ll mark your answer as the solution.

And I guess mappings are case insensitive.