On Wednesday, June 20, 2012 8:35:00 AM UTC-5, Yue Wu wrote: > > I'm runing gvim on windows xp sp3. To reproduce: > > gvim.exe -u NONE > :set nocp > > :set iminsert? > > It should produce 0. > > :set iminsert=1 > > :new > > To start a new buffer > > :set iminsert? > > it will show iminsert is 1, it should be 0. >
I can confirm that this happens with the :new command, even if I use :setlocal instead of :set. However, the subject of this thread implies that setting the value changes existing buffers. It does not. Only new buffers do the wrong thing. :help local-options > When splitting a window, the local options are copied to the new window. Thus > right after the split the contents of the two windows look the same. > When editing a new buffer, its local option values must be initialized. Since > the local options of the current buffer might be specifically for that buffer, > these are not used. Instead, for each buffer-local option there also is a > global value, which is used for new buffers. With ":set" both the local and > global value is changed. With "setlocal" only the local value is changed, > thus this value is not used when editing a new buffer. I'm seeing the behavior for split windows, not the behavior for new buffers, when I use :new, even if I use :new with a filename. :e newfilename also does not initialize the value of 'iminsert' to the global value, it keeps the same value as the previous buffer. -- You received this message from the "vim_dev" 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
