[email protected] wrote:
> I use :vsp together with a BufEnter function which does vertical
> resize the current window.
> However, vertical resize does not work, when the same file is loaded
> in both windows.
From :help autocmd-events
BufEnter After entering a buffer. Useful for setting
options for a file type. Also executed when
starting to edit a buffer, after the
BufReadPost autocommands.
BufWinEnter After a buffer is displayed in a window. This
can be when the buffer is loaded (after
processing the modelines) or when a hidden
buffer is displayed in a window (and is no
longer hidden).
Does not happen for |:split| without
arguments, since you keep editing the same
buffer, or ":split" with a file that's already
open in a window, because it re-uses an
existing buffer. But it does happen for a
":split" with the name of the current buffer,
since it reloads that buffer.
WinEnter After entering another window. Not done for
the first window, when Vim has just started.
Useful for setting the window height.
If the window is for another buffer, Vim
executes the BufEnter autocommands after the
WinEnter autocommands.
So it would appear that you want to set that autocommand on WinEnter,
not BufEnter.
-Tobia
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---