re-vim: sensible vim configuration
★ Single file, just download it then fire up your nvim/vim!
★ Well polished, should work on Mac, Linux and Windows.
★ Full Language Server Protocol support(node.js required).
★ Easy to maintain and extend, to fulfill your needs.
Download .vimrc file, put it in your home directory. Run vim as usual, it can handle itself quite well.
Tips for Linux & macOS users(install & update):
curl -Lo ~/.vimrc https://j.mp/re-vim
Need neovim support?
ln ~/.vimrc ~/.config/nvim/init.vim
If on Windows, run these in Command Prompt:
mkdir "%USERPROFILE%\AppData\Local\nvim"
mklink "%USERPROFILE%\AppData\Local\nvim\init.vim" "%USERPROFILE%\.vimrc"
The screenshot was taken from VimR.
Some old screenshots can be found here.
re-vim uses vim-plug (+python
required) as plugin manager. Run :PlugInstall
in vim to install all built-in plugins. This should be completed in 30 secs.
+python
required)
+lua
required)imap jk <Esc> " Use `jk` to exit Insert Mode
let mapleader = "\<Space>" " Use `<Space>` as mapleader
use :W
for sudo writing on Mac & Linux.
use :Wcolor
for showing highlight group under current cursor
Key | Mode | Action |
---|---|---|
<BS> |
Normal | unhighlight the search result |
[b |
Normal | switch to previous buffer |
]b |
Normal | switch to next buffer |
<Ctrl> + a |
Command/Insert | move the cursor to the begining of line |
<Ctrl> + e |
Command/Insert | move the cursor to the end of line |
<Ctrl> + h |
Command/Insert | move the cursor left by word |
<Ctrl> + l |
Command/Insert | move the cursor right by word |
<Ctrl> + b |
Insert | move the cursor left by char |
<Ctrl> + f |
Insert | move the cursor right by char |
<Ctrl> + j |
Insert | move the cursor down by line |
<Ctrl> + k |
Insert | move the cursor up by line |
<Ctrl> + j |
Visual | move the current line downward |
<Ctrl> + k |
Visual | move the current line upward |
<Ctrl> + h |
Normal | resize the current split window |
<Ctrl> + l |
Normal | resize the current split window |
<Ctrl> + j |
Normal | resize the current split window |
<Ctrl> + k |
Normal | resize the current split window |
<Leader>
key relatedKey | Mode | Action |
---|---|---|
<Leader> + r |
Normal | Restore last session |
<Leader> + n |
Normal | Toggle showing linenumber |
<Leader> + s |
Normal | Strip whitespace & blankline EOF |
Plugin | Key | Mode | Action |
---|---|---|---|
ctrlp.vim | <Leader> + o |
Normal | Open CtrlP window |
undotree | <Leader> + u |
Normal | Toggle undotree window |
nerdcommenter | \ |
Normal/Visual | Toggle comment |
nerdcommenter | Ctrl + \ |
Normal/Visual | CommentSexy |
emmet-vim | , + , |
Insert/Visual | Expand abbr |
vim-easy-align | <Leader> + g |
Normal/Visual | Align with |
goyo.vim | Ctrl + w + <Space> |
Normal | Toggle goyo mode |
limelight.vim | Ctrl + w + <Enter> |
Normal | Toggle limelight mode |
ultisnips | <Tab> |
Insert | Expand snips |
ultisnips | <Tab> |
Insert | Jumpforward |
ultisnips | <Shift> + <Tab> |
Insert | Jumpbackward |
tagbar | <Leader> + b |
Normal | Toggle tagbar window |
asyncrun | & |
Normal | AsyncRun arbitrary command(like wget http://myfile.zip ) |
asyncrun | g& |
Normal | AsyncRun predefined command with -strip option |
Key | Mode | Action |
---|---|---|
Ctrl + n |
Normal/Visual | select the word under cursor |
<Leader> + A |
Normal/Visual | select all occurrences of the word/selection |
Ctrl + <LeftClick> |
Normal | add a single cursor at current position |
<Leader> + <Space> |
Normal/Visual | add a cursor or create cursors vertically |
Ctrl + <Down/Up> |
Normal | create cursors vertically |
n /N /[ /] |
Normal | navigate between cursors/regions |
q /Q |
Normal | skip/remove the region under cursor |
Key | Mode | Action |
---|---|---|
gh | Normal | show hover document |
gd | Normal | coc-definition |
gf | Visual | coc-format-selected |
gy | Normal | coc-type-definition |
gs | Normal | coc-symbols |
go | Normal | coc-outline |
gc | Normal | coc-diagnostics |
gm | Normal | coc-rename |
gr | Normal | coc-references |
gi | Normal | coc-implementation |
You need to run :CocInstall coc-word coc-ultisnips coc-html coc-pyls
or something before using LSP related functions. See Using coc extensions · neoclide/coc.nvim Wiki · GitHub .
For more key bindings please refer to the plugin's manual.
re-vim uses ~/.vim/vimrc.after
(and ~/.vim/vimrc.before
) for your customization.
For example, to override the default colorscheme:
echo "colorscheme one" >> ~/.vim/vimrc.after
To enable true color support:
echo "set termguicolors" >> ~/.vim/vimrc.after
To add new plugins, you should create ~/.vim/vimrc.plug
:
echo "Plug 'altercation/vim-colors-solarized'" >> ~/.vim/vimrc.plug