Vim Common Configuration

Source: Internet
Author: User

Vim/etc/vim/vimrc

Set Nu "Show line number
Set Novisualbell "Do not blink
The set nocompatible "remove the nasty about VI consistency mode, avoid some bugs and limitations of previous versions
55 "Show Chinese help
If version >= 603
HELPLANG=CN Set
Encoding=utf-8 Set
endif
60 "Map Select all + Copy Ctrl + A
Map <C-A> Ggvgy
map! <C-A> <esc>ggvgy
Map <F12> gg=g
64 "Ctrl + C copy in selected state
Vmap <C-c> "+y
66 "Auto Indent
Autoindent Set
"Set Cindent
69 "Display line number
Set number
71 "Prohibit generation of temporary files
Nobackup Set
Noswapfile Set

"Auto-complete
75:inoremap (() <esc>i
76:inoremap) <c-r>=closepair (') ') <CR>
77:inoremap {{<cr>}<esc>o
78:inoremap} <c-r>=closepair ('} ') <CR>
79:inoremap [[]<esc>i
80:inoremap] <c-r>=closepair ('] ') <CR>
81:inoremap "" "<esc>i
82:inoremap ' <esc>i
function! Closepair (char)
If Getline ('. ') [Col ('. ')-1] = = A:char
"\<right>"
+ Else
A:char return
endif
Endfunction
FileType plugin indent on

Vim Common Configuration

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.