On Dec 6, 2013 6:37 PM, "Asis Hallab" <asis.hallab@gmail.com> wrote:
>
> Hi there!
>
> 2013/12/6 LCD 47 <lcd047@gmail.com>:
> > On 6 December 2013, Asis Hallab <asis.hallab@gmail.com> wrote:
> >> Dear Vimmers,
> >>
> >> I just had a surprising experience with Vim's argdo command.
> >>
> >> I did the following:
> >> 1) In my ruby on rails project I opened Vim and set the argument list with
> >> :args `find . -name '*.rb'`
> >> After this, I could see, that all Ruby files in the project were in
> >> the argument list
> >> 2) I recorded a macro to add a simple comment line at the top of the file
> >> ggO# encoding: utf-8^[
> >> 3) I executed this macro on all files in the argument list:
> >> :argdo :norm @q
> >>
> >> Interestingly only a subset of the files in the argument list got
> >> changed, others were untouched.
> >> In fact it only affected the files in a certain sub-directory.
> >>
> >> Does anyone have a clue why this happened?
> > [...]
> >
> > Perhaps it aborted at an error? Macros are tricky like that.
> >
>
> Did not get any error message. Not even with
> :messages
It is not necessary seen. Try macro "fad$" when there is no "a" on the line: it aborts, but no error messages are displayed: definition of the error that aborts the macro is wider. I do not see where an error is possible in your macro. I would have used append(0) though and not a macro in this case.
>
> I just tested it on another computer (Linux Mint with latest binary
> vim 7.3). Here it works!!!!
>
> Stranger and stranger…
>
> @Tim
> >:args **/*.rb
>
> Yes, I do know the starstar notation. Just an old habbit to use :args `find… `
>
> Cheers!
>
> --
> --
> 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.
--
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:
Post a Comment