On 10-Oct-09 4:22, winterTTr wrote:
> I map a vim key like this
> nnoremap <F1> :call foo()<CR>
> 
> and , foo() is a function written by myself.
> 
> Is there a way  to enter the insert-mode after this map is executed ,
> without modifying the map-command itself.
> 
> i mean , if i can just add some function call in the foo() to do this ?
If you don't want to simply append the 'i' command
     nnoremap <F1> :call foo()<CR>i
(e.g. because you only want to conditionally enter insert mode), use the 
:startinsert command inside foo().

PS: It is recommended to Capitalize function names (Foo()), and (if you put all 
of this in a separate script file) it is recommended to make the function 
script-local: function s:Foo() .... nnoremap <F1> :call <SID>Foo()<CR>
PPS: This question belongs to vim_use, not vim_dev.

-- cheers, ingo
-- 
   -- Ingo Karkat -- /^-- /^-- /^-- /^-- /^-- /^-- http://ingo-karkat.de/ --
   --      http://vim.sourceforge.net/account/profile.php?user_id=9713    --


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui