Quantcast

key mapping help

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

key mapping help

retiredff
From macvim help, and other posts and example .vimrc files I have examined, the following should work:

"toggle list - this works, not in insert mode
map <F1> :set nolist!<CR>

"this should work in insert mode but does not
imap <F1> <ESC> :set nolist!<CR>

"nor does this
map! <F1> :set nolist!<CR>

when I press F1, I see displayed on the screen "<F1>".

what am I doing wrong to catch insert mode keys?

Thanks

TonyB
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: key mapping help

Bee-16


On Feb 18, 7:40 am, retiredff <[hidden email]> wrote:

> From macvim help, and other posts and example .vimrc files I have examined,
> the following should work:
>
> "toggle list - this works, not in insert mode
> map <F1> :set nolist!<CR>
>
> "this should work in insert mode but does not
> imap <F1> <ESC> :set nolist!<CR>
>
> "nor does this
> map! <F1> :set nolist!<CR>
>
> when I press F1, I see displayed on the screen "<F1>".
>
> what am I doing wrong to catch insert mode keys?
>
> Thanks
>
> TonyB
>
> --
> View this message in context:http://vim.1045645.n5.nabble.com/key-mapping-help-tp5495434p5495434.html
> Sent from the Vim - Mac mailing list archive at Nabble.com.

Try removing the space after <esc>:

imap <F1> <ESC>:set nolist!<CR>

--OR-- better and not leaving insert mode:

imap <F12> <c-o>:set list!<cr>

Bill

--
You received this message from the "vim_mac" 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: key mapping help

retiredff
Bill,

I tried imap <F7> <c-o>:set nolist!<CR>
and <esc> instead of <c-o>

both seem to work, but, if the cursor is on a blank line when I press F7 I see "7" then it disappears. I also see on the same row as --INSERT-- right justified "<80>k7". I have not noticed this before. normal?

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: key mapping help

Bee-16


On Feb 19, 3:22 am, retiredff <[hidden email]> wrote:

> Bill,
>
> I tried imap <F7> <c-o>:set nolist!<CR>
> and <esc> instead of <c-o>
>
> both seem to work, but, if the cursor is on a blank line when I press F7 I
> see "7" then it disappears. I also see on the same row as --INSERT-- right
> justified "<80>k7". I have not noticed this before. normal?
>
> --
> View this message in context:http://vim.1045645.n5.nabble.com/key-mapping-help-tp5495434p5496732.html
> Sent from the Vim - Mac mailing list archive at Nabble.com.

I can not reproduce the problem if on a blank line.

:help <silent>

This is in my .vimrc:

" toggle invisibles
nmap <silent> <F1> :setlocal list!<cr>
imap <F1> <C-O><F1>
vmap <F1> <Esc><F1>gv

Bill

--
You received this message from the "vim_mac" 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: key mapping help

retiredff
Bill,

Since my last reply, I shut down MacVim and had to reboot my DSL modem and my computer. The problems has disappeared. Don't know why.

Thanks for the reply's

Tony

 
Loading...