vimrc

" An example for a vimrc file.
"
" Maintainer:    Bram Moolenaar <Bram@vim.org>
" Last change:    2016 Jul 28
"
" To use it, copy it to
"     for Unix and OS/2:  ~/.vimrc
"          for Amiga:  s:.vimrc
"  for MS-DOS and Win32:  $VIM\_vimrc
"        for OpenVMS:  sys$login:.vimrc

" When started as "evim", evim.vim will already have done these settings.
if v:progname =~? "evim"
  finish
endif

" Get the defaults that most users want.
source $VIMRUNTIME/defaults.vim

if has("vms")
  set nobackup        " do not keep a backup file, use versions instead
else
  set backup        " keep a backup file (restore to previous version)
  if has('persistent_undo')
    set undofile    " keep an undo file (undo changes after closing)
  endif
endif

if &t_Co > 2 || has("gui_running")
  " Switch on highlighting the last used search pattern.
  set hlsearch
endif

" Only do this part when compiled with support for autocommands.
if has("autocmd")

  " Put these in an autocmd group, so that we can delete them easily.
  augroup vimrcEx
  au!

  " For all text files set 'textwidth' to 78 characters.
  autocmd FileType text setlocal textwidth=78

  augroup END

else

  set autoindent        " always set autoindenting on

endif " has("autocmd")

" Add optional packages.
"
" The matchit plugin makes the % command work better, but it is not backwards
" compatible.
if has('syntax') && has('eval')
  packadd matchit
endif





"===============set taglist========
let Tlist_Ctags_Cmd = '/usr/bin/ctags'
let Tlist_Auto_Open = 1  "default show
"如果你不想同时显示多个文件中的tag,设置Tlist_Show_One_File为1。缺省为显示多个文件中的tag;
let Tlist_Show_One_File=1

"如果你在想taglist窗口是最后一个窗口时退出VIM,设置Tlist_Exit_OnlyWindow为1;
let Tlist_Exit_OnlyWindow=1

""- 在gvim中,如果你想显示taglist菜单,设置Tlist_Show_Menu为1。
let TlistUpdate=1
let Tlist_show_Menu=1

"如果你想taglist窗口出现在右侧,设置Tlist_Use_Right_Window为1。缺省显示在左侧。
let Tlist_Use_Right_Window=1

let Tlist_File_Fold_Auto_Close=1 "让当前不被编辑的文件的方法列表自动折叠起来, 这样可以节约一些屏幕空间进到刚才已经tag好的目录,

"Tlist_WinHeight和Tlist_WinWidth可以设置taglist窗口的高度和宽度
"
"let Tlist_WinWidth=40
"
map <F3> :TlistOpen<Enter>
map <F4> :TlistClose<Enter>
"================winmanage===========
map <F8> :WMToggle<Enter>
let g:winManagerWindowLayout = "TagList|FileExplorer|BufExplorer"
let g:winManagerWidth = 30
"let g:AutoOpenWinManager = 1 "need change the code
"===========need_tree========
map <F2> :NERDTreeMirror<CR>
map <F2> :NERDTreeToggle<CR>
let NERDTreeChDirMode=2
let NERDTreeQuitOnOpen=1
let NERDTreeShowBookmarks=1
let NERDTreeMinimalUI=1
let NERDTreeDirArrows=1
let NERDTreeWinPos='left'
"============omnicppcomplete---------------
set completeopt=menu,menuone
let OmniCpp_MayCompleteDot=1
let OmniCpp_MayCompleteArrow=1
let OmniCpp_MayCompleteScope=1
let OmniCpp_SelectFirstItem=2
let OmniCpp_NamespaceSearch=2
let OmniCpp_ShowPrototypeInAbbr=1
let OmniCpp_GlobalScopeSearch=1
let OmniCpp_DisplayMode=1
let OmniCpp_DefaultNamespaces=["std"]
set nocp
"================minibuf===
let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplMapWindowNavArrows = 1
let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplModSelTarget = 1
"解决FileExplorer窗口变小问题  
let g:miniBufExplForceSyntaxEnable = 1  
let g:miniBufExplorerMoreThanOne=2  

set hlsearch
set nocompatible    
set backspace=indent,eol,start
set autoindent
set history=50
set ruler
set showcmd
set laststatus=2
filetype plugin on
filetype indent on
set completeopt=longest,menu    "smart tab
set guifont=Courier\ 10\ Pitch\ 12 "Gvim default font
colorscheme desert
set lines=50
set columns=85
set ts=4
set cindent shiftwidth=4
set expandtab
color desert
set nu
"set tw=78
"Open the following two to show CN in vim
set fileencodings=utf-8,gb2312,gbk,gb18030 "it change 0xff to 0x3f,why?
"set encoding=prc    "it cause quickfix window and gvim menu show wrong code
set termencoding=utf-8
set fileformats=unix
"set fileformats=unix,dos
source $VIMRUNTIME/ftplugin/man.vim
"set mouse=a
set incsearch
set showmatch
set matchtime=10
set noignorecase
set tags=tags;
set autochdir
let &termencoding=&encoding
syntax enable
syntax on
set ai
highlight Comment ctermfg=6
set nobackup
set expandtab
set cursorline
set si
set fo-=at
set mouse=a

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值