On Friday, April 14, 2017 at 12:51:02 PM UTC-5, 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 all 
> > in buffers that you are switching between in a single window? Or do you 
> > have 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 
> horizontally. When i run the command only the buffer that happened to have 
> the cursor in it (the active buffer?) is positioned at the end of the file. 
> All of them are reloaded though. What I expected to happen is all files to be 
> refreshed with all buffers showing the last couple of lines of each file.
> 

OK, so you *don't* have the buffers open in the same window, switching between 
them with buffer commands like ":b" or ":bprev" or ":bnext". You have several 
buffers open in multiple split windows.

The ":bufdo" command works by cycling through all the buffers open in Vim, 
loading them one by one in the current window. It does not affect the other 
split windows.

At the moment you visit any given buffer, it is now open in *two* windows: the 
currently active window, and the window you already had it open in. You reload 
the buffer, which affects both windows, because both windows are different 
views on the *same* buffer. Then you jump to the end of the buffer. This only 
affects the cursor position in the *current* window. The existing window is not 
affected. Then, you move on to the next buffer, so it appears that only the 
reload happened.

As Bram suggests, you probably actually wanted to use ":windo" instead of 
":bufdo".

There's a good overview image here that may clear things up a little: 
http://vim.wikia.com/wiki/Buffers

-- 
-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to