On Tue, Jun 14, 2011 at 9:58 PM, Ulf Magnusson <[email protected]> wrote: > On Tue, Jun 14, 2011 at 9:44 PM, cyboman <[email protected]> wrote: >> i'm not new to vim but somewhat confused about this. what is the >> difference between buffers and windows in vim? and is it significant? >> >> any help is appreciated. >> >> -- >> 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 >> > > A buffer is a blob of text in memory, usually (but not always) bound > to some file. > > When you open a file, Vim loads the contents of that file into a > buffer. When you edit the text, it's the contents of the buffer that > you're changing. When you write the file, what you're actually doing > is writing the contents of the buffer to the file. > > Think of a window as a viewport through which you view some buffer. If > you have two split windows with the same file, both of those windows > are views onto the same buffer.
By the way, you can change what file a buffer is bound to with the :file command. Thus, ":file foo" followed by ":w" will write the buffer to the file "foo". /Ulf -- 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
