Would you provide a key mapping for insert mode which could make letters between start of current word to current cursor uppercase?
- For string
abcd efgh, and now cursor is flickering at the end following
h, then I could get
- For string
abcd efgh, and now cursor is flickering on
g, then I could get
Please note, I know
map! <C-F> <Esc>gUiw`]a
But it cannot meet my second example.
Thanks in advance!
Updated on GMT 2016/3/30, 2:26:
According to comment from Carpetsmoker and as I tried,
gUb could meet my second example but not the first, while
gUiw could meet my first example but not the second.
So would anyone help to implement necessary function or logic? Thus could meet my requirement completely.
Or any other solution is also appreciated.
Updated on GMT 2016/3/30, 3:19:
Currently, there are two solutions, one is from muru and the other is from myself. Both works as I tried and are acceptable to me. I mark muru one as the answer.
Updated on GMT 2016/3/31, 23:19:
With comments from tommcdo and VanLaser, I updated my solution, and to me it's the current best one.
Updated on GMT 2016/10/20, 14:25:
Regarding the solution of
nnoremap <C-f> gUvb`]
I just found a bug. For example, in normal mode, we have
asdf qwer, and cursor is flicking on
q when we press
Ctrl-f, we will get
ASDF Qwer, rather than expected
asdf Qwer. So current best solution is
inoremap <C-f> <C-\><C-O>gUb<ESC>`]a
nnoremap <C-f> a<C-\><C-O>gUb<ESC>`]