Odd mapping behavior...

19 views
Skip to first unread message

Sonny Chee

unread,
Apr 28, 2016, 4:03:36 PM4/28/16
to vim_use
Hey Guys,

I have the following two mappings to turn on and then turn off the paste setting.

inoremap <F8> <esc>:set paste<cr>i
inoremap <s-F8> <esc>:set nopaste<cr>i


The first mapping works and when I press F8 while in insert mode, I see the label on my status line.

INSERT (paste)

However, when I pressed shift-F8 while in insert mode, I just the follt owing characters in my current buffer

<S-F8>

Can anyone help me understand why my second mapping isn't working as (I) expected?

Dmitri Vereshchagin

unread,
Apr 28, 2016, 4:58:58 PM4/28/16
to vim_use
* Sonny Chee <sonny...@gmail.com> [2016-04-28 23:03]:
> I have the following two mappings to turn on and then turn off the paste setting.
>
> inoremap <F8> <esc>:set paste<cr>i
> inoremap <s-F8> <esc>:set nopaste<cr>i
>
> [...]
>
> However, when I pressed shift-F8 while in insert mode, I just the follt owing characters in my current buffer
>
> <S-F8>

When paste is on mapping in Insert mode is disabled. Check pastetoggle
option.

--
Dmitri Vereshchagin

Sonny Chee

unread,
Apr 29, 2016, 2:47:22 PM4/29/16
to vim_use


Thanks Dmitri, that solved my problem.

Reply all
Reply to author
Forward
0 new messages