个人.vimrc配置

直接上.vimrc

autocmd! bufwritepost .vimrc source %       "修改vimrc后自动加载 


"                       打开NERDTree

"                       打开TagBar

"                       取消搜索结果高亮    

"       

"       

"       

"       

"      

"      

"                       快速保存





"通用设置==========================================================================================================================

set syntax=off          "语法高亮

syntax enable                                                                       

set nocompatible        "取消与vi的兼容

set number          "显示行号

set mouse=a         "鼠标可用

set scrolloff=3         "滚动间距

set ruler           "显示标尺

set lines=40 columns=130    "窗口大小

set autowrite           "文件修改后自动保存

set autoread            "文件在外部被修改后自动重新加载

set ignorecase          "搜索时忽视大小写

set hlsearch            "高亮搜索结果

set incsearch           "实时搜索

set confirm         "未保存退出时弹出确认

set nowrap          "取消换行

set autochdir           "自动切换目录

set laststatus=2        "显示状态栏

set noswapfile          "不产生交换文件

set nobackup            "不产生备份文件

set cursorline                                                                          

hi CursorLine cterm=NONE ctermbg=black ctermfg=white guifg=NONE guibg=NONE
set cursorcolumn        "高亮列

hi CursorColumn cterm=NONE ctermbg=black ctermfg=white guifg=NONE guibg=NONE
colorscheme murphy      "配色风格


"与缩进折叠相关设置================================================================================================================

set smarttab            "退格键一次删除四个空格

set tabstop=4           "设置
tap
set shiftwidth=4        "设置>>宽度

set smartindent         "开启新行智能缩进

set foldenable          "可折叠


"文件编码==========================================================================================================================

set fileencodings=utf-8,ucs-bom,gb-18030,gbk,gb2312,cp936
set termencoding=utf-8
set encoding=utf-8


"快捷键映射========================================================================================================================

nnoremap  :q

nnoremap  

nnoremap  

nnoremap  

nnoremap  

nmap  :w!       "正常模式下快速保存

imap  :w!      "插入模式下快速保存

nmap  :nohl     "F4快速取消搜索高亮



"符号匹配==========================================================================================================================

inoremap ( ()i

inoremap [ []i

inoremap { {}iO

inoremap ' ''i

inoremap " ""i

inoremap < <>i

inoremap ‘ ‘’i

inoremap “ “”i

inoremap 「 「」i

inoremap ) =ClosePair(')')

inoremap } =ClosePair('}')

inoremap ] =ClosePair(']')

function! ClosePair(char)

if getline('.')[col('.') - 1] == a:char

return "\"

else

return a:char
    endif
endfunction

inoremap  A

inoremap  A

inoremap  la

inoremap  la

inoremap  O

inoremap  

"TAB自动跳出括号======================================================================================================================

func! SkipPair()

    if getline('.')[col('.') - 1] == ')'||getline('.')[col('.') - 1] == ']'||getline('.')[col('.') - 1] == '"'||getline('.')[col('.') - 1] == "'"||getline('.')[col('.') - 1] == '}'

        return "\A"

    else

        return "\t"

    endif

endfunc

""inoremap  ja


"Vundle============================================================================================================================

filetype off
set 
rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

Plugin 'VundleVim/Vundle.vim'

Plugin 'scrooloose/nerdtree'

Plugin 'vim-airline/vim-airline'

Plugin 'vim-airline/vim-airline-themes'

Plugin 'vim-scripts/winmanager'

Plugin 'majutsushi/tagbar'

Plugin 'fholgado/minibufexpl.vim'

Plugin 'vim-syntastic/syntastic'

Plugin 'Valloric/YouCompleteMe'

Plugin 'vim-scripts/STL-Syntax'

Plugin 'vim-scripts/OmniCppComplete'

call vundle#end()

filetype plugin indent on



"nerdtree==========================

map  :NERDTreeToggle

let g:NERDTreeDirArrowExpandable = '+'

let g:NERDTreeDirArrowCollapsible = '-'

let g:NERDTreeWinPos="left"

let g:NERDTreeSize=30

let g:NERDTreeShwoLineNumbers=1

let g:NERDTreeShowHidden=0

autocmd vimenter * if !argc()|NERDTree|endif        
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
"autocmd vimenter * NERDTree

"p到上层目录 P到根目录      K到第一个节点  K到最后一个节点

"!执行此文件 u打开上层目录 M显示文件系统菜单   r递归刷新当前目录   R递归刷新当前根目录


"vim-airline=======================



"tagbar============================

map  :TagbarToggle

let g:tagbar_right=1

let g:tagbar_width=30
""set g:tagbar_ctags_bin

autocmd BufReadPost *.cpp,*.c,*.h,*.hpp call tagbar#autoopen()



"vim airline=======================

""let g:airline_theme='murphy'












你可能感兴趣的:(Linux,vim)