Skip to content

Instantly share code, notes, and snippets.

@laiwei
Created February 21, 2012 10:08
Show Gist options
  • Save laiwei/1875596 to your computer and use it in GitHub Desktop.
Save laiwei/1875596 to your computer and use it in GitHub Desktop.
vimrc
" source /etc/vimrc
" An example for a gvimrc file.
" The commands in this are executed when the GUI is started.
"
" Maintainer: Bram Moolenaar <[email protected]>
" Last change: 2001 Sep 02
"
" To use it, copy it to
" for Unix and OS/2: ~/.gvimrc
" for Amiga: s:.gvimrc
" for MS-DOS and Win32: $VIM\_gvimrc
" for OpenVMS: sys$login:.gvimrc
" Make external commands work through a pipe instead of a pseudo-tty
"set noguipty
" set the X11 font to use
" set guifont=-misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-1
set ch=2 " Make command line two lines high
"set mousehide " Hide the mouse when typing text
"set mouse=a
" Make shift-insert work like in Xterm
map <S-Insert> <MiddleMouse>
map! <S-Insert> <MiddleMouse>
" Only do this for Vim version 5.0 and later.
if version >= 500
" I like highlighting strings inside C comments
let c_comment_strings=1
" Switch on syntax highlighting if it wasn't on yet.
if !exists("syntax_on")
syntax on
endif
" Switch on search pattern highlighting.
set hlsearch
" For Win32 version, have "K" lookup the keyword in a help file
"if has("win32")
" let winhelpfile='windows.hlp'
" map K :execute "!start winhlp32 -k <cword> " . winhelpfile <CR>
"endif
" Set nice colors
" background for normal text is light grey
" Text below the last line is darker grey
" Cursor is green, Cyan when ":lmap" mappings are active
" Constants are not underlined but have a slightly lighter background
highlight Normal guibg=grey90
highlight Cursor guibg=Green guifg=NONE
highlight lCursor guibg=Cyan guifg=NONE
highlight NonText guibg=grey80
highlight Constant gui=NONE guibg=grey95
highlight Special gui=NONE guibg=grey95
endif
"=================================================
"===========set by myself=========================
set fdm=indent
"set fileencodings=chinese,ucs-bom,utf-8,taiwan,latin1
"set encoding=utf-8
"set fenc=utf-8 "设置默认语言为8位unicode
set encoding=utf-8
set fileencodings=ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1
let g:NeoComplCache_EnableAtStartup = 1
"使用右侧tag窗口
nnoremap <silent> <F8> :TlistToggle<CR>
let Tlist_Show_One_File = 1 "不同时显示多个文件的tag,只显示当前文件的
let Tlist_Exit_OnlyWindow = 1 "如果taglist窗口是最后一个窗口,则退出vim
let Tlist_Use_Right_Window = 1 "在右侧窗口中显示taglist窗口
"let Tlist_WinWidth=20
"一般设置.
"set nocompatible "VIM而不是VI
set history=50 "历史记录50条
"man Q gq "屏蔽Q, 以免进入Ex模式
filetype on "打开文件类型检测
"
""颜色设置.
"colorscheme blue
"colorscheme darkblue
colorscheme desert
"colorscheme torte
"colorscheme evening
"colorscheme murphy
syntax on "语法高亮
set hls " 查找文本高亮
"界面设置.
set ruler "显示当前位置
set number "显示行号
"set nonumber "不显示行号
"set mouse=a
"格式设置.
set autoindent "自动缩进
"set smartindent "智能缩进
"set cindent "C缩进
set tabstop=4 "硬TAB
set expandtab
set softtabstop=4 "软TAB
set shiftwidth=4 "缩进空格数
"set expandtab "空格替换TAB
"set smarttab "智能TAB
"
set showmatch "显示匹配
"set matchtime=5 "1/10秒延迟
set hlsearch "高亮搜索
"set incsearch "搜索中匹配
set tags=tags; "ctags
"set autochdir "ctags
"==========================the end======================
"设置zen coding
let g:user_zen_expandabbr_key = '<c-e>'
let g:use_zen_complete_tag = 1
"设置NERDTree
let NERDChristmasTree=1
let NERDTreeAutoCenter=1
let NERDTreeMouseMode=2
let NERDTreeShowFiles=1
let NERDTreeShowHidden=1
let NERDTreeShowLineNumbers=1
let NERDTreeWinPos='left'
let NERDTreeWinSize=31
map <C-C> :NERDTreeFind<CR>
map <C-X> :NERDTreeToggle<CR>
map <C-N> :tabnext<CR>
map <C-P> :tabpre<CR>
"nnoremap <C-L> :BufExplorer<CR>
nnoremap ,e :e <C-R>=expand('%:p:h') . '/'<CR>
nnoremap ,, :tabnew <C-R>=expand('%:p:h') . '/'<CR>
nnoremap ,r :!make restartweb<CR>
":hi CursorLine cterm=NONE ctermbg=darkred ctermfg=white guibg=darkred guifg=white
":hi CursorColumn cterm=NONE ctermbg=darkred ctermfg=white guibg=darkred guifg=white
":nnoremap <Leader>c :set cursorline! cursorcolumn!<CR>
":hi CursorLine cterm=NONE ctermbg=darkgrey
":nnoremap <Leader>c :set cursorline!<CR>
":set cursorline!
"始终显示statusline,便于查看当前文件的各种信息
:set laststatus=2
let g:fuf_modesDisable = []
let g:fuf_mrufile_maxItem = 400
let g:fuf_mrucmd_maxItem = 400
nnoremap <silent> ff :FufFile<CR>
inoremap jj <Esc>
" Clear screen clears search highlighting.
nnoremap <C-L> :nohl<CR><C-L>
call pathogen#infect()
hi IndentGuidesOdd ctermbg=black
hi IndentGuidesEven ctermbg=darkgrey
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment