Monday, November 22, 2010

Re: caps lock invert in insert mode? (Fortran 77 editing)

On 11/22/2010 07:01 AM, Rob wrote:
> I find it quite awkward to edit a language such as Fortran 77 where all keywords are in capitals. I am constantly turning caps lock on and off, sometimes forgetting which means I then enter the wrong commands.
>
> Is there any vim feature to make this easier? I'm thinking something like ':set capsinvert' would help. It would only affect insert mode, and invert the functionality of the caps lock key. ie. normally type in capitals, but can be disabled (turn the caps lock light on) for typing string literals in normal case.
>
> Any thoughts?
>
> thanks,
> Rob
>
>
>
>

I have a sort of similar case: often, completion gives me a word with
first letter capitalized, while I need all lower-case (e.g. for a
variable). I have an insert-mode mapping that lowercases first letter of
that word and returns to insert mode:

inoremap <m-0> <esc>b~ea

You can use for example gUe command to uppercase to the end of a word.
That way you only need a single keystroke per word, which I think is
better and easier than switch to upper, type, then switch back. You also
won't have a problem with forgetting that you're in uppercase and typing
something that should be lowercase. -ak

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: