Thursday, February 21, 2013

Re: vim script: repeat(\)

On 2/20/2013 4:36 PM, Ben Fritz wrote:
> Your mapping should look like:
>
> :nnore <expr> ,gg ':'.MyGit("new post")
that really works!, so looks the key here is
1) use <expr> as you mentioned,
2) use ":" . func()
3) return the command string from the func

great to learn!
>
> Then your command can look something like:
>
> :command! MyGit exec MyGit(<q-args>)
this also works, but
it seems the exec helps to
1) evaluate the expression, but also
2) execute the result right away.
is there a way to evaluate the express (1) , but not to "execute"
them(2) , in "command" ?

none of these works...
command! -nargs=* MyGit call MyGit(<q-args>)
command! -nargs=* MyGit eval(":" . MyGit(<q-args>))

>
> Your function must do nothing, but return the string you want Vim to put on
> the command line, complete with <Left> characters. I'm not sure whether you
> need to escape them like "\<Left>" or not, :help :map-<expr> should help
> with that.

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