Friday, April 14, 2017

Re: bufdo reload and go to end of file

Jorg Heymans wrote:

> On Friday, April 14, 2017 at 6:57:03 PM UTC+2, Ben Fritz wrote:
>
> > Back on-topic: when you say you "have a bunch of files open", are they al=
> l in buffers that you are switching between in a single window? Or do you h=
> ave them open in multiple windows? What happens when you run your command? =
> What did you expect to happen instead?
>
> they are in buffers in the same windows, a "bunch" i meant 3-4 split horizo=
> ntally. When i run the command only the buffer that happened to have the cu=
> rsor in it (the active buffer?) is positioned at the end of the file. All o=
> f them are reloaded though. What I expected to happen is all files to be re=
> freshed with all buffers showing the last couple of lines of each file.
>
> >=20
> > I would expect your command to end with the last buffer loaded in your wi=
> ndow, with the cursor at the end. If you have appropriate autocmds defined,=
> switching back to another buffer in the same window would have the cursor =
> on the last line, however without a "restore last position" autocmd it woul=
> d probably just go back to the beginning of the file. The 'hidden' option m=
> ay help there, I'm not 100% sure.
>
> I did try the hidden option. did not seem to make a difference. Note that w=
> hen i open the files in tabs and do the same with :tabdo everything works f=
> ine.
>
> I will read up on autocmds, still ascending on the learning curve :-)

Perhaps all you need is:

windo $

--
GUARD #1: What, ridden on a horse?
ARTHUR: Yes!
GUARD #1: You're using coconuts!
ARTHUR: What?
GUARD #1: You've got two empty halves of coconut and you're bangin' 'em
together.
The Quest for the Holy Grail (Monty Python)

/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

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