Bram Moolenaar wrote: > Vim has always been conservative about the default option values. > Without any .vimrc the default is 'compatible'. That's nice for people > who rely on the old Vi. But how many of these still exist? I expect > nearly all Vim users to want 'nocompatible', thus create a .vimrc ASAP. > > What has stopped me from changing this is the unexpected change. Many > users will notice that Vim suddenly behaves differently. Some may be > upset. The release of Vim 8.0 might be the best point in time to do > this. If we do this. > > Besides making 'nocompatible' the default, there are a few options that > should probably be on by default. Currently these are in > $VIMRUNTIME/vimrc_example.vim. Most of these only have a visual effect > or slightly change how editing works. You will notice this right away. > The ones that have unexpected effects should be avoided. > > If someone wants to start in the old way, the -C flag should be used: > vim -C > > If someone wants to start with 'nocompatible', but not all of the new > option values, a .vimrc would be needed to change the settings. This is > the most common and also most tricky part. Assuming that the user will > want most of the new option values, but not all, he should be able to > revert to the old value. For options that is easy. But including the > matchit plugin is not easy to revert. > > What we can probably always do: > > set backspace=indent,eol,start > set history=50 " keep 50 lines of command line history > set ruler " show the cursor position all the time > set showcmd " display incomplete commands > set incsearch " do incremental searching
Except for incsearch, my .vimrc already incorporates these settings, so I'm fine with them myself. incsearch is "noisy" and changes the visual interface (ie. becomes prominent) and I don't advise doing so, even though I myself might decide to use it someday. At least its easily reversible in one's .vimrc. > > " Don't use Ex mode, use Q for formatting > map Q gq Doesn't modify look&feel (unless one types a "Q", of course). Guess I'm neutral on this one. > > " In many terminal emulators the mouse works just fine, thus enable it. > if has('mouse') > set mouse=a > endif Probably a good idea. > if &t_Co > 2 || has("gui_running") > syntax on > set hlsearch > let c_comment_strings=1 > endif Setting hlsearch definitely modifies the look&feel, and I myself only use hls in specific situations. I'd rather not have this one, although at least its easy to countermand with a set nohls. > > if has("autocmd") > " Enable file type detection. > filetype plugin indent on > > augroup vimrcEx > au! > > " For all text files set 'textwidth' to 78 characters. > autocmd FileType text setlocal textwidth=78 This modifies look&feel and is difficult to prevent except on a file-by-file basis. Please don't do this. > > " When editing a file, always jump to the last known cursor position. > " Don't do it when the position is invalid or when inside an event handler > " (happens when dropping a file on gvim). > autocmd BufReadPost * > \ if line("'\"") >= 1 && line("'\"") <= line("$") | > \ exe "normal! g`\"" | > \ endif I myself already do something like this in my .vimrc. However, even though I like this, it would be difficult not-to-have. Perhaps cp should have levels: 0=compatible, 1= current nocp, 2=more, etc, or perhaps a letter-driven selection (something like complete). > > augroup END > else > set autoindent " always set autoindenting on > endif I don't care, I guess -- easily reversed. > > if has('langmap') && exists('+langnoremap') > set langnoremap > endif I had to look this one up as I've never had cause to use it. Easily reversed, so I'm neutral on this one. > > > Probably not: > > " these two leave files behind > set backup > set undofile > > " may conflict with a user mapping > inoremap <C-U> <C-G>u<C-U> > > " hard to revert > if has('syntax') && has('eval') > packadd matchit > endif > > Comments? > Leaving files behind -- I have enough of a problem with macs and .dSYM directories getting into my tarballs; I use set directory to move swap files where I don't back them up, and I've not used undofiles. These two are easily reversible, though. I'm sure I wouldn't like the proposed ctrl-u map, although I know how to get rid of it so it wouldn't be a major problem. I think it would be best to document any of these changes and include how-to-prevent/restore/obviate them. Does the last item (with matchit) mean that matchit will become a package which must be packadd'd? Regards, Chip Campbell -- -- 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 --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.