Vim configuration file

Source: Internet
Author: User
Tags diff set background

Gvim configuration file for the Windows environment, installation directory/VIM/_VIMRC

Set nocompatible "Do not use the VI keyboard mode, but vim your own
SOURCE $VIMRUNTIME/vimrc_example.vim
SOURCE $VIMRUNTIME/mswin.vim
Behave Mswin

Set Diffexpr=mydiff ()
function Mydiff ()
Let opt = '-a--binary '
If &diffopt =~ ' icase ' | Let opt = opt. '-I ' | endif
If &diffopt =~ ' Iwhite ' | Let opt = opt. '-B ' | endif
Let arg1 = v:fname_in
If Arg1 =~ ' | Let arg1 = ' "'. Arg1. ' ' ' | endif
Let arg2 = V:fname_new
If Arg2 =~ ' | Let arg2 = ' "'. Arg2. ' ' ' | endif
Let Arg3 = V:fname_out
If Arg3 =~ ' | Let Arg3 = ' "'. Arg3. ' ' ' | endif
Let eq = '
If $VIMRUNTIME =~ '
If &sh =~ ' \<cmd '
Let cmd = ' "". $VIMRUNTIME. ' \diff '
Let eq = ' "'
Else
Let cmd = substitute ($VIMRUNTIME, "', '" ', '). ' \diff "'
endif
Else
Let cmd = $VIMRUNTIME. ' \diff '
endif
Silent execute '! '. Cmd. ‘ ‘ . Opt. Arg1. ‘ ‘ . Arg2. ' > '. Arg3. eq
Endfunction

""""""""""""""""""""""""
The Encoding settings
""""""""""""""""""""""""
Set Encoding=utf-8 "Vim internal use of the character encoding method
Set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,latin1 "Automatic identification of the encoding
If has ("Win32")
Set fileencoding=cp936
Else
Set Fileencoding=utf-8
endif
SOURCE $VIMRUNTIME/delmenu.vim
Set Langmenu=zh_cn.utf-8
SOURCE $VIMRUNTIME/menu.vim
Language message Zh_cn.utf-8
Set termencoding=cp936 "Console display Chinese

Set number  "Display line number
ColorScheme torte " color scheme
Syntax enable  "syntax highlighting
syntax on " syntax coloring
Set history=100  "History number
Set autoindent " Normal auto indent
set smartindent  "enhanced Auto indent
Set cindent " C program automatically indents
set tabstop=8  tab width
Set softtabstop=4  "soft tab width
Set shiftwidth=4 " Auto indent width
Set confirm  "When handling unsaved or read-only files, pop-up confirm
filetype on " reconnaissance file type
FileType plugin on  "load file type plug-in
filetype Plugin indent on  "Loading related indentation files for a specific file type
Set nobackup " Prevent temporary files from being generated
CD D:\Program files\tomcat\webapps\ Mywebsite\web-inf\classes "set working directory
au guienter * simalt ~x" window start maximized
setlocal omnifunc=javacomplete#complete " Java Auto-complete function

""""""""""""""""""""""""""""""
"Winmanager setting
""""""""""""""""""""""""""""""
Let g:winmanagerwindowlayout = "bufexplorer,fileexplorer| TagList "
Let G:defaultexplorer = 0
Let g:bufexplorerminheight=10 "fixed buffer list height, need to modify the original file
Nmap <silent> <F9>:wmtoggle<cr> "set shortcut key to F9


Vim configuration file for Linux environment,/ETC/VIM/.VIMRC

"————————
The General settings
"————————
"Do not use the VI-compatible keyboard mode
Set nocompatible
"Type of Detection file
FileType on
"Record the number of rows in history
Set history=100
"Do not generate backup files
Set Nobackup

"————————
The interface settings
"————————
The Display line number
Set number!
"Highlight when moving forward
The Set Cursorline
The background uses black
Set Background=dark
"Removal of toolbar in the GUI version of Vim
Set guioptions-=t
"In the editing process, the cursor position is displayed in the lower-right corner
Set ruler

"———————
The format settings
"———————
The Wrap Line
Set Wrap
"Whole word wrapping."
Set linebreak
The Auto Align
Set Autoindent
The smart Alignment
Set Smartindent
The Set auto indent
Set ai!
"Set the TAB key to 4 spaces
Set tabstop=4
"Sets the rows to be interleaved to 4 spaces
Set shiftwidth=4
"Make backspace key available
Set backspace=2
"Allow backspace and cursor keys to span line boundaries
Set Whichwrap+=<,>,h,l

"———————
The programming settings
"———————
"Syntax High brightness display
Syntax on
"Sets the matching pattern, similar to the corresponding closing parenthesis when an opening parenthesis is entered
Set Showmatch

"———————
The search Related Settings
"———————
"By default, the search results are displayed in a high-brightness setting, which turns off highlighting
The Set Nohlsearch
"Incremental Search with input
Set Incsearch

Vim configuration file

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.