Wednesday, July 2, 2014

Re: map a chain of commands

On 2014-07-02 22:07, Tarlika Elisabeth Schmitz wrote:
> >> > :nnoremap <buffer> <f4> :for idx in [3,18,6]<bar>let
> >> > val=split(getline('.'), '\t')[idx-1]<bar>if strlen(val)<bar>let
> >> > @+=val<bar>call input('Press enter
> >> > #'.idx)<bar>endif<bar>endfor<cr>
> >
> >The mapping takes the current line, splits it on <tab>s, iterates
> >over the desired positions (3,18,6), pulling out that value and, if
> >it has a non-zero length, stuffs it in the system clipboard [then
> >currently waiting for you to hit <enter>, but as mentioned, you
> >might be able to take that bit out].
>
> Is there maybe a typo in the command above?
> It doesn't do anything, neither prompts me to enter nor puts
> anything in the clipboad.

You're typing it all as one line? I tested it with a tab-separated
file I've got here and it (at least with the "call input(...)"
fragment) worked exactly as expected.

-tim


--
--
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/d/optout.

No comments:

Post a Comment