New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
defaults, part 1 #2676
Comments
Just a note to anyone who wants to send PRs regarding this: please update vim_diff.txt as well. |
@pyrohh Added a note about it in the description. |
Does |
No, it does what you say. There's an explanation at the vim wiki:
|
I don't see the point of It reduces my 'text canvas' (the screen area I can reach without scrolling) by one line at the top and one line at the bottom. There would now be two lines visible on the screen that I can't reach directly any more ( I've just checked TextEdit and gEdit, both behave as with I think |
@glts Been thinking of this, and I tend to agree with you. I asked @tpope at vim-sensible about the rationale behind it, just so we have more info about this. |
This is the reply I got:
(For the "if I read you correctly" part, I was a bit confused about
which I found insightful. |
I went outside for a walk, and am now convinced that One, Two, I conclude that And that's it from me. 😄 |
What about making H and L jump to the line that's on top or bottom of the window and scroll |
Agreed with @glts , I had always expected that we would not adopt scrolloff from sensible.vim. Same with Just to get my other objections out of the way:
|
It scrolls the screen, which is IMO very annoying. |
@fmoralesc I think the mappings aren't too bad, but then there's a rat-tail of other commands that you might want to 'fix' in this way such as I appreciate this 'Defaults' initiative, I really do, but in the case of |
OK, then, let's make that a policy. I'll include it to the Notes here, and mark this one setting as a dud, like I did with But we also might need a policy not to prevent a setting to be the default unless a good argument is provided against it :p |
I'm fine with |
Hm... that SO thread has a good point. Since we are enabling filetype plugins (hopefully ;)), indentation should be better than what smartindent provides for most use cases, so |
|
|
Adding Btw, did someone took out |
I never edit people's posts, so it wasn't me. In any case, I'm pretty sure I just saw |
I won't mind if anyone with access touches up the issue here (for example, if someone opens a PR about one of these, I might not see it right away and the issue description might get outdated); anyway, i just realized we had derrailed on the |
👍 I'll mark some checkboxes if I see they're outdated.
Oh yeah, of course. I was just clarifying I wouldn't edit posts (unless something was said, like you did above). |
I think with neovim/neovim#2676 this shouldn't be necessary.
The settings are [defaults in Neovim][1] and these commands are actually redundant for Vim as well, because [vim-plug applies the same settings][2]. [1]: neovim/neovim#2676 [2]: https://github.com/junegunn/vim-plug/wiki/faq
@fmoralesc Any recollection about why we decided against |
Continued at #6289 |
I've also tweaked wildmode a bit more to my liking after having attention drawn to it in the defaults debate issue. See: neovim/neovim#2676
[vim-polyglot](https://github.com/sheerun/vim-polyglot) is a collection of language packs that are loaded on demand by checking the current file's type. It's great if you switch languages often. .Managing plugins **** Vim has a plugin manager since version 8. In the interest of keeping everything as simple as possible, I'll use that over installing an external plugin manager. To install a plugin, place it into `~/.vim/pack/plugins/start` (you can use any directory name instead of plugins, but this made sense to me). For more information about packages in Vim, check out `:help packages`. **** Since this configuration is stored in a [git repository](https://github.com/jeffkreeftmeijer/.vim), we use git's submodules to install plugins and update them later. $ git submodule add git@github.com:sheerun/vim-polyglot.git pack/plugins/start/vim-polyglot After installing the plugin, Vim should automatically load the correct language file for each opened file. Aside from syntax highlighting, vim-polyglot configures whitespace preferences per language. Unless you disagree with how whitespace is handled in the language you use, you can remove your `expandtab` and `tabstop` configuration and let the language pack handle those. Lastly, vim-polyglot [includes part of vim-sensible](https://github.com/sheerun/vim-polyglot/blob/73c518717741fb3ebb6822645d38f37ffae7c19b/plugin/polyglot.vim#L16-L109), which is loaded unless vim-sensible itself is loaded. On NeoVim, which [has sensible defaults out of the box](neovim/neovim#2676), we can disable this to prevent these defaults from being loaded twice. if has('nvim') let g:polyglot_disabled = ['sensible'] endif Although vim-polyglot checks the presence of vim-sensible by consulting `g:loaded_sensible`, we're disabling it through vim-polyglot's settings rather than setting `g:loaded_sensible`. That'll make it easier to take it out later if we decide to switch away from vim-polyglot.
See neovim/neovim#2676 for a fully documented list.
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., thenvim
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 -&
andset -&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 theset-& 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 theP_VI_DEF
flag, you'll have to change it toP_VIM
and change the default for vim only. E.g.:becomes
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).
filetype plugin indent on
syntax enable
langnoremap
autoindent
backspace=indent,eol,start
complete-=i
i
can make completion slow as currently implemented.smarttab
nrformats-=octal
ttimeout ttimeoutlen=100
incsearch
hlsearch
mouse=a
laststatus=2
ruler
REJECTED(#6087)showcmd
REJECTED(#6087)wildmenu
wildmode=list:longest,full
scrolloff=1
sidescrolloff=5
scrolloff=1
.)sidescroll=1
display+=lastline
listchars=tab:>\ ,trail:-,nbsp:+
formatoptions+=j
setglobal tags-=./tags tags^=./tags;
autoread
fileformats+=mac
history=10000
tabpagemax=50
viminfo^=!
sessionoptions-=options
runtime! macros/matchit.vim
shortmess+=c
background=dark
'backupdir'
if'backup'
is setSome mappings have been proposed too:
Y yanks to the end of the line.noremap Y y$
<C-u>
(delete text typed in the current line)inoremap <C-U> <C-G>u<C-U>
<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' : '_'
<esc><esc>
leaves terminal mode.<C-L>
to clear the highlighting of :set hlsearch.nnoremap <silent> <C-L> :nohlsearch<CR><C-L>
Other tasks
The text was updated successfully, but these errors were encountered: