There are some general settings for convenience in almost everyone’s
.vimrc file. Let’s shorten your
.vimrc and make the default vim better.
If you want a lightweight vim configuration without installing the plugin, I also maintain the content of vim-better-default on gist, you can directly download it as a basic but still nice vim config.
Out-of-the-box: address a ton of deficiencies of the default vim configurations that nearly everyone can agree upon.
Mnemonic key bindings: commands have mnemonic prefixes like
<Leader> bfor the buffer commands or
<Leader> wfor the window commands.
SPCkey is recommended as the leader key.
If new to Vim, you can install vim-better-default as a starting point, rather than copying some random vimrc you found.
If you have been a vimer for quit a while, please see default.vim directly. In the beginning vim-better-default is intended for simplifying the tedious
.vimrc file, so you may also use it to shorten your
This plugin can be installed with a varity of plugin managers, such as:
Plugin 'liuchengxu/vim-better-defaultto .vimrc
Plug 'liuchengxu/vim-better-defaultto .vimrc
||Only add essential funationalities||0|
||Whole key (re)mappings||1|
||Basic key (re)mappings||1|
||Buffer key mappings||1|
||File key mappings||1|
||Fold key mappings||1|
||Window key mappings||1|
If you set the
vim_better_default_minumum option, then vim seemingly looks like no difference with the default vim, it only adds some essential funtionalities.
let g:vim_better_default_minimum = 1
If you want to exclude key mappings in vim-beter-default, just set the value as 0.
let g:vim_better_default_key_mapping = 0
For more details, please refer to the default.vim. Don’t worry. It is extremely simple and just part of your own
.vimrc file alike.
You can also fork vim-beter-default and modify
plugin/default.vim for more customization.
How to override the existing settings?
default.vim normally loads after your
.vimrc, making it a bit tricky to override. If you want to load it earlier, add the following content to your
.vimrc, then follow on the settings you want to override.
For instance, if you don’t like relativenumber:
runtime! plugin/default.vim set norelativenumber
vim-better-default needs you !