Personal vim simple configuration

Streamline .vimrc configuration, simple simple

This configuration does not fancy plug-ins, but with ctags and cscope and vim with the basic functions provided can be completed common code editing, browsing, search and other work.

"***********************vim 配置*************************
set nocompatible
set encoding=utf-8
set fileencoding=utf-8
set fileencodings=ucs-bom,utf-8,gbk,cp936,latin-1
set fileformat=unix
set fileformats=unix,dos,mac
set nobackup
set noswapfile

filetype on

set smartindent
set autoindent
set cindent
"set expandtab
set tabstop=4
set shiftwidth=4
"set smarttab
set backspace=indent,eol,start
set autoread


"***********************搜索*************************
set hlsearch
set incsearch
set ignorecase
set smartcase

"***********************界面设置*************************
set laststatus=2
set cmdheight=1
set number 
set cursorline

syntax on


set tags=tags;
let Tlist_Ctags_Cmd = '/usr/bin/ctags'
let Tlist_Show_One_File = 1            "不同时显示多个文件的tag,只显示当前文件的
let Tlist_Exit_OnlyWindow = 1          "如果taglist窗口是最后一个窗口,则退出vim
let Tlist_Use_Left_Window = 1         "在左侧窗口中显示taglist窗口

" -----------------------------------------------------------------------------
"    < cscope 工具配置 >
" -----------------------------------------------------------------------------
if has("cscope")
    set cscopetag
    set cscopequickfix=c-,d-,e-,g-,i-,s-,t-
    if filereadable("cscope.out")
        cs add cscope.out
    else
        let cscope_file=findfile("cscope.out",".;")
        let cscope_pre=matchstr(cscope_file, ".*/")
        if !empty(cscope_file) && filereadable(cscope_file)
            exe "cs add" cscope_file cscope_pre
        endif
    endif
endif

vim keyboard map

Guess you like

Origin www.cnblogs.com/ZhaoKevin/p/12296626.html