Skip to content

defaults, part 1 #2676

Closed
Closed

Description

I'm opening this issue to consolidate the discussions in #276, #1664, #1667, #2071 and elsewhere, and to have a place to track progress on the change of default settings.

Notes

RULE 1 of the default club: These defaults should be adjusted considering the most common use cases for nvim.

RULE 2 of the default club: If possible, changes to the defaults should be available in the scenario where there is no $VIMRUNTIME available (e.g., the nvim executable was copied over to a remote server).

PRs opened for this must have options: as a prefix.

There must be a unequivocal argument in favor of changing the defaults, or to reject the proposed changes.

@justinmk has stressed the need to keep the set -& and set -&vim idioms behaving as they do now (which means the approach in #1667 is not viable) (see #1664 (comment), #1667 (comment)) (There's been some discussion on whether it's worth it to keep the set-& idiom, but that is lower priority).

The vi defaults are not to be changed or removed (see #1667 (comment)). This means that if the option uses the P_VI_DEF flag, you'll have to change it to P_VIM and change the default for vim only. E.g.:

  {"wildmode",    "wim",  P_STRING|P_VI_DEF|P_COMMA|P_NODUP,
   (char_u *)&p_wim, PV_NONE,
   {(char_u *)"full", (char_u *)0L} SCRIPTID_INIT},

becomes

  {"wildmode",    "wim",  P_STRING|P_VIM|P_COMMA|P_NODUP,
   (char_u *)&p_wim, PV_NONE,
   {(char_u *)"full", (char_u *)"list:longest,full"} SCRIPTID_INIT},

Changing some of these settings will cause the tests to behave differently, so keep it in mind when working on this.

Also keep in mind you'll need to update vim_diff.txt as well.

These changes are not a priority, and could be introduced after the first release.

New defaults and progress

(These were the settings I had in #1667, which are based on sensible.vim and the discussions in #276. Feel free to comment on them).

Setting Status Notes
  • filetype plugin indent on
INCLUDED (#4252) can also be fixed by including a default plugin manager
  • syntax enable
INCLUDED (#4252) idem
  • langnoremap
INCLUDED (#2853)
  • autoindent
INCLUDED (#2857)
  • backspace=indent,eol,start
INCLUDED (#2639)
  • complete-=i
INCLUDED (#2854) Reason: i can make completion slow as currently implemented.
  • smarttab
INCLUDED (#2855)
  • nrformats-=octal
INCLUDED (#2668)
  • ttimeout ttimeoutlen=100
REJECTED
  • incsearch
INCLUDED (#2858)
  • hlsearch
INCLUDED (#2859)
  • mouse=a
INCLUDED (#19290)
  • laststatus=2
INCLUDED (#2876)
  • ruler
REJECTED (#6087) Can be super slow on functional tests
  • showcmd
REJECTED (#6087) Can be super slow on the functional tests
  • wildmenu
INCLUDED (#2677)
  • wildmode=list:longest,full
REJECTED (#2677) (#3395) Not a clear win over the Vim default.
  • scrolloff=1
REJECTED (PR: #2687)
  • sidescrolloff=5
REJECTED (for same reasons as scrolloff=1.)
  • sidescroll=1
https://ddrscott.github.io/blog/2016/sidescroll/
  • display+=lastline
INCLUDED (#2866)
  • listchars=tab:>\ ,trail:-,nbsp:+
INCLUDED (#2872)
  • formatoptions+=j
INCLUDED (#2669)
  • search upwards for tags file. setglobal tags-=./tags tags^=./tags;
INCLUDED (#2670)
  • autoread
INCLUDED (#2856)
  • fileformats+=mac
REJECTED (#2867)
  • history=10000
INCLUDED (#2868)
  • tabpagemax=50
INCLUDED (#2869)
  • viminfo^=!
INCLUDED (#2870)
  • sessionoptions-=options
INCLUDED (#2871)
  • runtime! macros/matchit.vim
INCLUDED (#2723)
  • shortmess+=c
REJECTED might not be appropriate generally, helps with autocomplete plugins
  • background=dark
#2894 details
  • auto-create 'backupdir' if 'backup' is set

Some mappings have been proposed too:

Mapping Status Notes
  • Y yanks to the end of the line. noremap Y y$
REJECTED
  • allow undoing <C-u> (delete text typed in the current line) inoremap <C-U> <C-G>u<C-U>
DECIDED AGAINST
  • <home> goes to the beginning of the text on first press and the beginning of the line on second. it alternates afterwards. noremap <expr> <home> virtcol('.') - 1 <= indent('.') && col('.') > 1 ? '0' : '_'
DECIDED AGAINST
  • <esc><esc> leaves terminal mode.
REJECTED
  • use <C-L> to clear the highlighting of :set hlsearch. nnoremap <silent> <C-L> :nohlsearch<CR><C-L>
DECIDED AGAINST

Other tasks

  • Update runtime/vimrc_example.vim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    defaultsissues or PRs involving changing the defaultsissues or PRs involving changing the defaults

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions