Vim configuration

  
        

Ubuntu12.04 used in the vim settings is a reference to this article, to share with everyone!

Setting method in ubuntu10.10:

$cd /etc/vim

$sudo cp vimrc vimrc.bak

$sudo gedit vimrc< Br>


Then copy the following to the bottom of the penultimate paragraph of the text

set number " display line number

set tabstop=4 " Set the length of the tab to 4

set cindent "Set the automatic indentation method using C/C++ language

set cinoptions={0,1s,t0,n-2,p2s,(03s ,=.5s,>1s,=1s,:1s "Setting the specific indentation method of C/C++ language


Other settings such as the following code can be added at their own discretion :

set nocompatible " Turn off vi compatibility mode

syntax on " Auto syntax highlighting

colorscheme molokai " Set color scheme

set Number " Display line number

set cursorline " Highlight current line

set ruler " Open status bar ruler

set shiftwidth=4 " Set< < and >> The width of the command when moving is 4

set softtabstop=4 " so that you can delete 4 spaces at a time when pressing the backspace key

set tabstop=4 " Tab length is 4

set nobackup " does not back up when overwriting files

set autochdir " automatically switches the current directory to the directory where the current file is located

filetype plugin indent on " ; Open Plugin

set backupcopy=yes " Set the behavior when backing up as an overlay

set ignorecase smartcase " ignore case when searching, but keep it when there are one or more uppercase letters Case sensitive

set nowrapscan " Prevent re-searching when searching for both ends of the file

set incsearch " Display search results when entering search content

set hlsearch " Highlight the found text when searching

set noerrorbells " Close error message ringing

set novisualbell " Turn off using visible ringing instead of calling

Set t_vb= " Terminal code for emptying the wrong ringtone

" set showmatch " When inserting parentheses, briefly jump to the matching parenthesis

" set matchtime=2 " Brief jump to Time to match parentheses

set magic " Set magic

set hidden " Allows you to switch buffers when there are unsaved changes. The modification at this time is saved by vim

set guioptions-=T " Hide Toolbar

set guioptions-=m " Hide Menu Bar

set smartindent " Use Smart Auto Indent when opening new lines

set backspace=indent,eol,start

" Not set in the insert state. You cannot use the backspace key and the Delete key to delete the carriage return

set cmdheight=1 " The number of lines in the command line is 1

set laststatus=2 " Display status bar (default is 1, the status bar cannot be displayed)

set statusline=\\ %<%F[ ,null,null,3],%1*%M%*%n%R%H]%=\\ %y\\ %0(%{&fileformat}\\ %{&encoding}\\ %c:%l/%L%)\\

" Set in Status display information

set foldenable " Start folding

set foldmethod=syntax " Set syntax folding

set foldcolumn=0 " Set the width of the collapsed area < Br>

setlocal foldlevel=1 " Set the number of fold layers to

" set foldclose=all " Set to automatically close the fold

" nnoremap @=((foldclosed( Line('.')) < 0) ? 'zc' : 'zo')

" Use the space bar to toggle the



" return OS type, eg: windows, or linux, mac, et.st..

function! MySys()

if has("win16")

Copyright © Windows knowledge All Rights Reserved