3

I want to disable Capslock functionality in Visual Mode. How can I do that?

Ex:

  • In Insert Mode, Capslock=On, A should print A.
  • In Visual Mode, Capslock=On, A should trigger append text after cursor (not append text to end of current line)
Benji Mizrahi
  • 2,154
  • 2
  • 23
  • 38
  • Do you still want to be able to do "Append to end of line" with Shift-A? – Ingo Karkat Dec 04 '12 at 08:59
  • Wrong answer :-) That means that the simple remapping trick in @kiddorails' answer is not sufficient?! – Ingo Karkat Dec 04 '12 at 14:23
  • Outside of the scope of Vim but I just remap my capslock key to escape. I never intentionally use capslock so this worked for me. I guess if I wanted to enter a long string of caps I could enter them lowercase and then do some madness with `vl[~` or something... ;) – dash-tom-bang Dec 06 '12 at 02:04
  • Related: http://stackoverflow.com/q/10530185/945456, http://vim.wikia.com/wiki/Insert-mode_only_Caps_Lock, and http://vi.stackexchange.com/q/376 (wait, there's a vi.SE?!) – Jeff B Aug 20 '15 at 19:02

1 Answers1

0

What did you mean by "append to next character" in visual selection?

In your vimrc file or vim session, do following (for command mode):

:map A a

If you just meant that selection should be ended and you must be able to append characters at end of the current position, do:

:map A Ctrl+VEsca

Bingo!

kiddorails
  • 12,961
  • 2
  • 32
  • 41
  • Why also change the normal mode? For visual mode, a `:xnoremap` would be sufficient. – Ingo Karkat Dec 04 '12 at 14:24
  • @IngoKarkat Didn't know of it, so thought of this mapping. Reading about it now. :) – kiddorails Dec 04 '12 at 14:54
  • I suspect that "append to next character" means the normal `a` behavior instead of "append to end of line" that you'd get with `A` (which is what would be generated were capslock set). – dash-tom-bang Dec 06 '12 at 02:05