"Basic{
set nocompatible " explicitly get out of vi-compatible mode
set noexrc " don't use local version of .(g)vimrc, .exrc
set background=dark "
set cpoptions=aABceFsmq
" |||||||||
" ||||||||+-- When joining lines, leave the cursor
" ||||||| between joined lines
" |||||||+-- When a new match is created (showmatch)
" |||||| pause for .5
" ||||||+-- Set buffer options when entering the
" ||||| buffer
" |||||+-- :write command updates current file name
" ||||+-- Automatically add <CR> to the last line
" ||| when using :@r
" |||+-- Searching continues at the end of the match
" || at the cursor position
" ||+-- A backslash has no special meaning in mappings
" |+-- :write updates alternative file name
" +-- :read updates alternative file name
syntax enable "开启语法
syntax on " syntax highlighting on(高亮语法)
"}
"General{
set nobackup "设置没有备份文件。
set noswapfile "设置没有交换文件。
"filetype plugin indent on " load filetype plugins/indent settings
"set autochdir " always switch to the current file directory
set backspace=indent,eol,start " make backspace a more flexible
"set backupdir=~/.vim/backup " where to put backup files
set clipboard+=unnamed " share windows clipboard
"set directory=~/.vim/tmp " directory to place swap files in
"set fileformats=unix,dos,mac " support all three, in this order
"set hidden " you can change buffers without saving
" (XXX: #VIM/tpope warns the line below could break things)
set iskeyword+=_,$,@,%,# " none of these are word dividers
set mouse=v " use mouse everywhere
set noerrorbells " don't make noise
"set wildmenu " turn on command line completion wild style
"set wildignore=*.dll,*.o,*.obj,*.bak,*.exe,*.pyc,*.jpg,*.gif,*.png
"set wildmode=list:longest " turn on wild mode huge list
"}
"UI{
"set cursorcolumn " highlight the current column(高亮当前列)
"set cursorline " highlight current line(高亮当前行)
set number " turn on line numbers(显示行号)
set numberwidth=5 " We are good up to 99999 lines
set statusline=%F%m%r%h%w[%L][%{&ff}]%y[%p%%][%04l,%04v]
" | | | | | | | | | | |
" | | | | | | | | | | + current
" | | | | | | | | | | column
" | | | | | | | | | +-- current line
" | | | | | | | | +-- current % into file
" | | | | | | | +-- current syntax in
" | | | | | | | square brackets
" | | | | | | +-- current fileformat
" | | | | | +-- number of lines
" | | | | +-- preview flag in square brackets
" | | | +-- help flag in square brackets
" | | +-- readonly flag in square brackets
" | +-- rodified flag in square brackets
" +-- full path to file in the buffer
"}
" GUI Settings {
if has("gui_running")
" Basics {
colorscheme desert " (only works in GUI)
set columns=150 "
set guifont=inconsolata\ 16 "
"set guioptions=ce
" ||
" |+-- use simple dialogs rather than pop-ups
" + use GUI tabs, not console style tabs
set lines=50 "
set mousehide " hide the mouse cursor when typing
" }
" Font Switching Binds {
"map <F8> <ESC>:set guifont=Consolas:h8<CR>
"map <F9> <ESC>:set guifont=Consolas:h10<CR>
map <F9> <ESC>:set guifont=inconsolata\ 10<CR>
"map <F10> <ESC>:set guifont=Consolas:h12<CR>
map <F10> <ESC>:set guifont=inconsolata\ 12<CR>
"map <F11> <ESC>:set guifont=Consolas:h16<CR>
map <F11> <ESC>:set guifont=inconsolata\ 16<CR>
"map <F12> <ESC>:set guifont=Consolas:h20<CR>
map <F12> <ESC>:set guifont=inconsolata\ 20<CR>
" }
endif
"}
"Text Formatting/Layout {
set shiftwidth=4 " auto-indent amount when using cindent,(设置当行之间交错时使用4个空格)
" >>, << and stuff like that
set softtabstop=4 " when hitting tab or backspace, how many spaces
"should a tab be (see expandtab)
set tabstop=8 " real tabs should be 8, and they will show with
"set list on
"}
" Folding {
set foldenable " Turn on folding
set foldmarker={,} " Fold C style code (only use this as default
" if you use a high foldlevel)
set foldmethod=marker " Fold on the marker
set foldlevel=100 " Don't autofold anything (but I can still
" fold manually)
set foldopen=block,hor,mark,percent,quickfix,tag " what movements
" open folds
function SimpleFoldText() " {
return getline(v:foldstart).' '
endfunction " }
set foldtext=SimpleFoldText() " Custom fold text function
" (cleaner than default)
" }
" Plugin Settings {
"bufexplorer插件{
let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplMapWindowNavArrows = 1
let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplModSelTarget = 1
"}
"grep {
nnoremap <silent> <F3> :Grep<CR>
"}
"miniBufExplorer{
let g:miniBufExplMapWindowNavVim = 1"用<C-h,j,k,l>切换到上下左右的窗口
let g:miniBufExplMapWindowNavArrows = 1"用<C-箭头键>切换到上下左右窗口
"}
" tagList Settings {
let Tlist_Auto_Open=0 " let the tag list open automagically
let Tlist_Compact_Format = 1 " show small menu
let Tlist_Ctags_Cmd = 'ctags' " location of ctags
let Tlist_Enable_Fold_Column = 0 " do show folding tree
let Tlist_Exist_OnlyWindow = 1 " if you are the last, kill
" yourself
let Tlist_File_Fold_Auto_Close = 0 " fold closed other trees
let Tlist_Sort_Type = "name" " order by
let Tlist_Use_Right_Window = 1 " split to the right side
" of the screen
let Tlist_WinWidth = 40 " 40 cols wide, so i can (almost always)
" read my functions
" Language Specifics {
" just functions and classes please
let tlist_aspjscript_settings = 'asp;f:function;c:class'
" just functions and subs please
let tlist_aspvbs_settings = 'asp;f:function;s:sub'
" don't show variables in freaking php
let tlist_php_settings = 'php;c:class;d:constant;f:function'
" just functions and classes please
let tlist_vb_settings = 'asp;f:function;c:class'
" }
" }
" winManager Settings{
map <C-W><C-F> :FirstExplorerWindow<cr>
map <C-W><C-B> :BottomExplorerWindow<cr>
"map <c-w><c-t> <leader>wm :WMToggle<cr>
nmap wm :WMToggle
let g:winManagerWindowLayout='FileExplorer|TagList'
let g:winManagerWidth = 30
let g:defaultExplorer = 0
" }
"}End Plugin Settings