Thanks for your help,Ben, what you said is exactly what the problem is, now it is fixed! Thanks very much!
On Jul 12, 1:25 am, Ben Fritz <[email protected]> wrote: > On Jul 11, 9:12 am, ZyX <[email protected]> wrote: > > > Reply to message «Re: vim map key can not work», > > sent 11:13:00 11 July 2011, Monday > > by pelican: > > > Sorry for my indistinction on this issue. > > > Simply what I do is mapping key F5 to 'set nowrap', so I added in > > > my .vimrc 'map <F5>:set nowrap<CR>', but when I press F5 in vim, it > > > just came out <80>k5 on the bottom of vim screen > > > Yes, with partially pressed mapping it does show <80>k5. You should write > > nnoremap <F5> :set nowrap<CR> > > (with space). `n' is here because you don't need this mapping for operator- > > pending and visual modes. `nore' because it makes you able to safely remap > > `:' > > and other keys present in the {rhs}: you should not use non-nore version > > unless > > you do know that {rhs} will be remapped and do know how it is remapped > > exactly. > > What is not stated explicitly here, is why your :map command was > wrong. To save you future trouble, you ALWAYS must have whitespace > between the map key and the map action--"Left Hand Side" (LHS) and > "Right Hand Side" (RHS), respectively. Because you had no space, what > you actually created was a mapping so that if you type: > > <F5>:set > > i.e. you press the F5 key, followed by a ':', followed by 's', 'e', > and 't' in sequence, then Vim will send keypresses: > > n - go to next search result > o - open a new text line and go to insert mode > wrap<CR> - insert text and another new line, remain in insert mode > > However, since you never actually typed <F5>:set, but just <F5>, you > just get the partial-command prompt given by the 'showcmd' option, as > Vim waits for you to type the rest of the mapping. Eventually Vim will > timeout waiting for your mapping and just do the default action for > <F5>, which is nothing. -- 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
