If you need to configure vim, simply create a directory in the Home ~ / .vimrc file can now configure vim, you can
Commonly used vimrc file
"设置行号
set number
colorscheme hybrid
"按下F2进入粘贴模式
set pastetoggle=<FZ>
"高亮搜索
set hlsearch
"设置折叠方式
set foldmethod=indent
"一些方便点的映射
let mapleader=','
let g:mapleader=','
"使用jj进入normal模式
inoremap jj <Esc>`^
"使用leader+w直接保存"
inoremap <leader>w <Esc>:w<cr>
noremap <leader>w :w<cr>
"切换buffer
nnoremap <silent> [b :bprevious<CR>
nnoremap <silent> [n :bnext<CR>
"ctrl + h/j/k/l switch window
noremap <C-h> <C-w>h
noremap <C-j> <C-w>j
noremap <C-k> <C-w>k
noremap <C-l> <C-w>l
vim mapping
- Set leader key
let mapleader= ","
common comma or space - For example, with `inoremap
w :w Re-insert mode to save
How to modify the vimrc file take effect
one: Quit vim re-enter the
two::source ~/.vimrc
Separated list of plugins to another file
~/.vimrc.bundles
To load ~ / .vimrc.bundles file, must ~ / .vimrc adding the following code fragment file:
if filereadable(expand("~/.vimrc.bundles"))
source ~/.vimrc.bundles
endif