Hi Tony and All,

Actually, it turns out the reason it's not working properly is because I have :set paste turned on by default (which I need, as I'm always pasting from windows aps into Vim). And when :set paste is turned on, it literally types out whatever function key was pressed --- so if I press F11, it types out <F11>

I was looking at the Vim doc, and it seems the only exception to this Insert (paste) rule is the following:

:set pastetoggle=<F11>

That will turn paste mode off when in Insert (paste) mode.

Is there any work around so that I can always have paste mode on and use mappings? I'm wondering, is it possible to trigger a function when pastetoggle is executed?

Or is it possible to customize my paste mode -- i.e. have it work the way it does, but not have it affect Function keys. I looked at :help paste but the documentation is sparse, and doesn't elude to this.

Thanks for your help,

Sean

A.J.Mechelynck wrote:

Sean Lerner wrote:

Hello,

I'd like to toggle line number on and off in Vim 7. I've set:

map <F11> :set invnumber <CR>
imap <F11> <ESC>:set invnumber <CR>li

[...]

    :imap <F11> <C-O>:set invnumber<CR>


see ":help i_CTRL-O"


Best regards,
Tony.




Reply via email to