On Sun, Jul 24, 2016 at 9:02 AM, Bram Moolenaar <[email protected]> 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
>
Please do not set &incsearch. It's one of the more annoying things in all
of Vim, and very likely to bring an unexpected "what the heck?"
" Don't use Ex mode, use Q for formatting
> map Q gq
>
> " In many terminal emulators the mouse works just fine, thus enable it.
> if has('mouse')
> set mouse=a
> endif
> if &t_Co > 2 || has("gui_running")
> syntax on
> set hlsearch
> let c_comment_strings=1
> endif
>
> 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
>
> " 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
>
> augroup END
> else
> set autoindent " always set autoindenting on
> endif
>
I am very opposed to everything in the above augroup. There is no reason
to foist this stuff on people just because "7" is changing to "8". Also
that BufReadPost autocmd is not easily reversible for newbs, since it's not
a simple "set".
Please don't "setlocal" a &textwidth value for text files. Don't mess with
this at all, but if you do, don't make it "setlocal". It is extremely
annoying to have Vim sometimes hard-wrap lines and sometimes not, depending
on which kind of file you're in---unless one specifically authorized this
by purposely turning filetype plugins on or having a plugin/package that
does this for certain &filetype.
if has('langmap') && exists('+langnoremap')
> set langnoremap
> endif
>
>
> 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?
>
Definitely not! Especially "matchit", since it's hard to reverse. I don't
want that thing. &undofile will leave unexpected litter around, which is
ban enough; but since the litter will start with dots it will
unintentionally wind up making it into tarballs because people will forget
that such files are lurking. Also, the "backup" related things will mess
up "creation date" in mac OS depending on how they're configured.
Currently the creation date is preserved on macOS by Vim's default settings.
I'm not in general opposed automatically to the idea of making a small
tweak or two for Vim 8, provided they won't affect too many people. E.g.,
&nocompatible is probably OK. But this proposal has too many of them, and
for no good reason. Frankly, for no reason at all other than "they happen
to appear in an example of a vimrc". Probably all that should happen is
that &nocompatible is the default. Definitely add nothing that requires
more than a simple "set" cmd to reverse, and nothing that affects the
filesystem.
-Manny
--
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.