Hi.

In a nutshell, I am having trouble trying to set the insert mode in a vim
function, and having it "stick" after the statement ends.

what I am trying to accomplish is the equivalent of hitting A, or I in vi.
(note the caps)

Problem is, once I do normal! I, it automatically escapes out of insert mode
afterwords.  I need it to "stay there" and let a few if statements process.
Once that happens, I'm hoping to write in text while it's in this mode.
Something else I am not sure how to do.

Example:  (section of a function)


  if a:pos == "comment_and_write"
    normal! A
  else
    normal! I
  endif

  if a:syn == "vim"
    " write " here
  elseif a:syn == "c"
    " write // here


... etc.

PS I am aware of the vim plugins to do what I'm trying to do (autocomment
code)... but I am doing it myself in .vimrc so my script is far more
portable.  Any advice GREATLY appreciated...  I had a real tough time
googling for relevant keywords to help myself out.



-- 
smu johnson <[email protected]>
-- 
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

Reply via email to