Wednesday, February 20, 2013

vim script: repeat(\)

struggled for nearly 2 hours, googled, no luck..

I think I didsucceed somewhere sometime, but can't recall back...

so I want to make a small script to archive this goal:

press just ",gg",
vim prompt out some long external commands in the vim ex cmd line,
then moving cursor back to some certain place,
but don't hit enter for me.

from here I can do my own modification (e.g, git msg), and
decide OK or abandon it.

but both of the map and user command methods below give me nothing:

function! MyGit(commitmsg)
let commitmsg=a:commitmsg
let GitCmd=":
\!git add -A .;
\!git commit -m " .
\commitmsg . ";" . "
\!git push origin master" .
\repeat("\<left>", 30)
exec GitCmd
endf
command! -nargs=? MyGit :call MyGit(<q-args>)
nn ,gg :call MyGit("new post:")

what's the problem?

I couldn't find anything similar in google...


--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: