. Vimrc Vim configuration Feng

Source: Internet
Author: User

. Vimrc Configuration

"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""
" => Global configuration
"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""
" Disable compatibility mode
Set Nocompatible

"Set the number of historical record steps
SetHistory=400

"Enable file type judgment plug-in
Filetype plugin on
Filetype indent on

"The file is automatically updated when it is modified externally.
SetAutoread

" Set quick save and exit
" Saved as, S
" Quick exit (SAVE) is, W
" Quick exit (not saved) is, Q
NMAP < Leader > S: W ! < Cr >
NMAP < Leader > W: WQ ! < Cr >
NMAP < Leader > Q: Q ! < Cr >

" Map <C-F9> :! Ctags-r -- C ++-kinds = + p -- fields = + IAS -- extra = + q. <CR>
" Set the shortcut key to win
" Source $ vimruntime/mswin. Vim
" Behave mswin

" Set pastetoggle = <F3>

" Tag
Set Tag = .. / Tags ,.. / Tags, tags, tags

"Cscope
SetCscopequickfix=S-, C-, D-, I-, T-, E-

" C \ H file Switch
Nnoremap < Silent > < F12 > : < Cr >
"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""
" => Font and color
"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""
" Enable syntax
Syntax enable

"Set Font
SetGuifont=Dejavu \ Sans \ monospace \12

"Set color
Colorscheme desert

" highlight the current row
set cursorline
Hi cursorline guibg = # 222222
Hi cursorcolumn guibg = # 333333

"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""
"=> Files and backups
"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""
"Disable Automatic Backup
SetNobackup
SetNowb

"Disable swap file
SetNoswapfile

"""""""""""""""""""""""""""""""""""""" "
" => fold
""""""""""""""""""""""""""""""""""" "
" enable collapse
" set nofen
set FDL = 0
set FDC = 2
set OFDM = syntax

"""""""""""""""""""""""""""""""""""""" "
" => Text Processing
""""""""""""""""""""""""""""""""""" "
" set (soft) tab width to 4
set tabstop = 4
set softtabstop = 4

"Set smarttab

"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""
"=> Indent
"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""
"Auto indent
SetAI

"Smart indent
SetSi

"Set the number of indented spaces to 4
SetAutoindent

"Set automatic indent: the indent value of each line is equal to that of the previous line. Use noautoindent to cancel the settings.
SetShiftwidth=4

"Set the automatic indent mode in C/C ++ Language
SetCindent

"""""""""""""""""""""""""""""""""""""" "
" => Vim interface
""""""""""""""""""""""""""""""""""" "
" set 7 lines to the curors-when moving vertical ..
" set so = 7

" turn on wild menu
" set wildmenu

" display ruler
set ruler

"Set the height of the command line
SetCmdheight=1

"Number of lines displayed
SetNu

"Show matching parentheses ([{And}])
SetShowmatch

"Highlight the search content
SetHlsearch

"Taglist
Let tlist_show_one_file=1
Let tlist_exit_onlywindow=1

"Winmanager
Let G: winmanagerwindowlayout='Fileexplorer | taglist'
Nmap wm: wmtoggle<Cr>

"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""
" => Encoding settings
"""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""

" Vim internal character encoding methods, including Vim buffer, menu text,
" Message text. In the user manual, we recommend that you change its value only in. vimrc,
" In fact, it seems that it makes sense to change its value only in. vimrc.
Set Encoding = UTF - 8
" Set encoding = PRC

" When Vim is started, it will detect
" Character encoding method, and set fileencoding to the final detected character encoding method.
" Therefore, it is best to put the Unicode encoding method at the beginning of this list.
" Set fileencodings = Unicode, UTF-8, gb2312, GBK, gb18030, Latin-1
" Set fencs = UTF-8, Unicode, gb2312, GBK, gb18030, Latin-1, cp936
Set Fencs = UTF - 8 , UCS - Bom, shift - JIS, gb18030, GBK, gb2312, cp936, Latin - 1 , PRC
" Set fileencodings = UCS-bom, utf8, PRC

" The character encoding method of the currently edited file in vim,
" Vim saves the file as a character encoding method when saving the file.
Set Fileencoding = UTF - 8
" Set fileencoding = PRC

" Termencoding: the terminal used by VIM (or the Windows Console window)
" . This option is invalid for gvim in Gui mode,
" For Vim In the Console mode, it isCodePage
" (For Windows), and we usually do not need to change it.
" The following statement only affects Vim in normal mode (non-graphic interface.
" Set termencoding = PRC
Let & Termencoding = & Encoding

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.