Created
May 16, 2013 13:00
-
-
Save anonymous/5591546 to your computer and use it in GitHub Desktop.
vim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
autocmd FileType python setlocal et sta sw=4 sts=4 | |
set nocp | |
filetype plugin indent on | |
set history=50 | |
set fencs=utf-8,usc-bom,euc-jp,gb18030,gbk,gb2312,cp936 | |
syntax on | |
set hlsearch | |
set nobackup | |
setlocal noswapfile | |
set bufhidden=hide | |
set ruler | |
set nu | |
set showcmd | |
set mouse=a | |
set shortmess=atI | |
set ignorecase | |
set incsearch | |
set smartindent | |
set autoindent | |
" powerline | |
set encoding=utf-8 | |
set laststatus=2 | |
set t_Co=256 | |
let g:Powerline_symbols= "fancy" | |
"setfillchars+=stl:\ ,stlnc:\ | |
call pathogen#infect() | |
nnoremap <F12> :GundoToggle<CR> | |
nmap <silent> <leader>nh :set nomousehide<CR> | |
nmap <silent> <leader>vv :vsplit<CR> | |
nmap <silent> <leader>vo :split<CR> | |
nmap <silent> <C-w> :q<CR> | |
nmap <silent> <leader>qq :cc<CR> | |
nmap <silent> <leader>vk :wincmd k<CR> | |
nmap <silent> <leader>vj :wincmd j<CR> | |
nmap <silent> <leader>vh :wincmd h<CR> | |
nmap <silent> <leader>vl :wincmd l<CR> | |
au BufRead,BufNewFile *.go set filetype=go | |
"自动保存,第一句是失去焦点之后自动保存,第二句是离开插入模式就自动保存 | |
au FocusLost * silent! :w | |
"au InsertLeave * :w | |
"nmap <silent> <A-Up> :wincmd k<CR> | |
"nmap <silent> <A-Down> :wincmd j<CR> | |
"nmap <silent> <A-Left> :wincmd h<CR> | |
"nmap <silent> <A-Right> :wincmd l<CR> | |
"set guifont=Courier\ 10\ Pitch\ 10 | |
set guifont=DejaVu\ Sans\ Mono\ 10 | |
"set guifont=WenQuanYi\ Micro\ Hei\ 9 | |
"set guifont=FreeSans\ 7 | |
"Set mapleader | |
let mapleader = "," | |
"if filereadable(".viminfo") | |
" rviminfo .viminfo | |
"endif | |
"if filereadable("Session.vim") | |
"source /home/young001/programming/Session.vim | |
"endif | |
"au Filetype perl :set equalprg=perltidy | |
"au Filetype c :set equalprg=indent | |
"au VimLeave * WMToggle | |
"au VimLeave * !rm /home/young001/Session.vim | |
au VimLeave * mksession! /home/young001/Session.vim | |
au VimLeave * wviminfo! /home/young001/young001.viminfo | |
"au VimEnter * WMToggle | |
"source /home/young001/Session.vim | |
"rviminfo /home/young001/young001.viminfo | |
"au VimEnter * WMToggle | |
"Fast reloading of the .vimrc | |
"the nerd commter | |
map <leader>cc <leader>cs | |
"map <leader>cu \cu | |
map <leader>bash :ConqueTerm bash | |
map <silent> <leader>wh :Vimwiki2HTML<cr> | |
map <silent> <leader>wah :VimwikiAll2HTML<cr> | |
map <silent> <leader>ww \ww | |
map <silent> <leader>dd \w\w | |
map <silent> <leader>wd \wd | |
map <silent> <leader>wr \wr | |
map <silent> <leader>wt \wt | |
map <silent> <leader>sg :source ~/.gvimrc<cr> | |
"Fast editing of .vimrc | |
map <silent> <leader>ee :e ~/.gvimrc<cr> | |
let g:indent_guides_guide_size=1 | |
"When .vimrc is edited, reload it | |
"autocmd! bufwritepost .vimrc source ~/.vimrc | |
map <silent> <leader>ss :source ~/.gvimrc<cr> | |
map <C-s> :w<cr> | |
map <C-t> :tabnew<cr> | |
map <C-v> "+gP<cr> | |
map <C-c> "+y<cr> | |
map <C-x> "+x<cr> | |
map <C-q> :wq<cr> | |
map <A-q> :bd<cr> | |
"map :q :bd<cr> | |
"let Tlist_Use_Right_Window = 1 | |
"let Tlist_Show_Menu = 1 | |
"let Tlist_Auto_Open = 1 | |
"let g:netrw_winsize = 20 | |
"map <silent> <F6> :Sexplore!<cr> | |
"let g:bufExplorerDefaultHelp=0 " Do not show default help. | |
"let g:bufExplorerShowRelativePath=1 " Show relative paths. | |
"let g:bufExplorerSortBy='mru' " Sort by most recently used. | |
"let g:bufExplorerSplitRight=0 " Split left. | |
"let g:bufExplorerSplitVertical=1 " Split vertically. | |
"let g:bufExplorerSplitVertSize = 30 " Split width | |
""let g:bufExplorerUseCurrentWindow=1 " Open in new window.autocmd BufWinEnter \[Buf\ List\] setl nonumber | |
"autocmd BufWinEnter \[Buf\ List\] setl nonumber | |
"let g:winManagerWindowLayout = "BufExplorer|FileExplorer|TagList" | |
""let g:winManagerWindowLayout = "BufExplorer|FileExplorer" | |
"let g:winManagerWidth = 30 | |
"let g:defaultExplorer = 0 | |
"nmap <leader>vt :FirstExplorerWindow<cr> | |
"nmap <leader>vb :BottomExplorerWindow<cr> | |
"nmap <silent> <F8> :WMToggle<cr> | |
let g:LookupFile_MinPatLength = 2 | |
let g:LookupFile_PreserveLastPattern = 0 | |
let g:LookupFile_PreservePatternHistory = 1 | |
let g:LookupFile_AlwaysAcceptFirst = 1 | |
let g:LookupFile_AllowNewFiles = 0 | |
au Filetype php,html,xml,xsl source ~/.vim/plugin/closetag.vim | |
let g:pep8_map='<F3>' | |
map <F4> :call CompilePython()<cr> | |
function! CompilePython() | |
exec "w" | |
exec "!python %" | |
endfunction | |
nmap <silent> <leader>ll :LUBufs<cr> | |
" lookup file with ignore case | |
function! LookupFile_IgnoreCaseFunc(pattern) | |
let _tags = &tags | |
try | |
let &tags = eval(g:LookupFile_TagExpr) | |
let newpattern = '\c' . a:pattern | |
let tags = taglist(newpattern) | |
catch | |
echohl ErrorMsg | echo "Exception: " . v:exception | echohl NONE | |
return "" | |
finally | |
let &tags = _tags | |
endtry | |
" Show the matches for what is typed so far. | |
let files = map(tags, 'v:val["filename"]') | |
return files | |
endfunction | |
setlocal bufhidden=hide | |
colorscheme desert | |
autocmd FileType c,cpp map <buffer> <leader><space> :w<cr>:make<cr> | |
nmap <leader>cn :cn<cr> | |
"next error | |
nmap <leader>cb :cp<cr> | |
"last error | |
nmap <leader>cv :cw 8<cr> | |
"show 8 error | |
set sessionoptions-=curdir | |
set sessionoptions+=sesdir | |
"set sessionoptions=blank,buffers,folds,help,options,tabpages,winsize,sesdir | |
set sessionoptions=blank,folds,help,options,tabpages,winsize,sesdir | |
"set guioptions-=s | |
set guioptions+=s | |
set guioptions+=m | |
"close menu-bar | |
"set guioptions-=m | |
"close toolbar | |
"set guioptions-=T | |
"set guioptions+=T | |
"nmap <leader>ss :source /home/young001/Session.vim<cr> | |
"function Do_CsTag() | |
"let dir = getcwd() | |
""if filereadable("tags") | |
""let tagsdeleted=delete("./"."tags") | |
""endif | |
""if(tagsdeleted!=0) | |
""echohl WarningMsg | echo "Fail to do tags! I cannot delete the tags" | echohl None | |
""return | |
""endif | |
""endif | |
"if has("cscope") | |
"silent! execute "cs kill -1" | |
"endif | |
""if filereadable("cscope.files") | |
""let csfilesdeleted=delete("./"."cscope.files") | |
""endif | |
""if(csfilesdeleted!=0) | |
""echohl WarningMsg | echo "Fail to do cscope! I cannot delete the cscope.files" | echohl None | |
""return | |
""endif | |
""endif | |
""if filereadable("cscope.out") | |
"""if(g:iswindows==1) | |
"""let csoutdeleted=delete(dir."\\"."cscope.out") | |
"""else | |
""let csoutdeleted=delete("./"."cscope.out") | |
""endif | |
""if(csoutdeleted!=0) | |
""echohl WarningMsg | echo "Fail to do cscope! I cannot delete the cscope.out" | echohl None | |
""return | |
""endif | |
""endif | |
"if(executable('ctags')) | |
""silent! execute "!ctags -R --c-types=+p --fields=+S *" | |
"silent! execute "!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q ." | |
"endif | |
"if(executable('cscope') && has("cscope") ) | |
""if(g:iswindows!=1) | |
""silent! execute "!find . -name '*.h' -o -name '*.c' -o -name '*.cpp' -o -name '*.java' -o -name '*.cs' > cscope.files" | |
""else | |
"silent! execute "!dir /s/b *.c,*.cpp,*.h,*.java,*.cs >> cscope.files" | |
"endif | |
"silent! execute "!cscope -b" | |
"execute "normal :" | |
"if filereadable("cscope.out") | |
"execute "cs add cscope.out" | |
"endif | |
"endif | |
"endfunction | |
"cut vertical | |
"nmap <leader>cv <C-w><C-v><cr> | |
nmap <leader>cv <C-w><C-v><cr> | |
",vj向上,vk是向下,vh相左,vl向右, move window | |
"nmap <leader>vk <C-w><C-k><cr> | |
"nmap <leader>vj <C-w><C-j><cr> | |
"nmap <leader>vh <C-w><C-R><cr> | |
"nmap <leader>vl <C-w><C-r><cr> | |
"fold the codes by syntax | |
"autocmd FileType c,cpp setl fdm=syntax | setl fen | |
"au FileType python set omnifunc=pythoncomplete#Complete | |
let g:neocomplcache_enable_at_startup = 1 | |
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete | |
let g:SuperTabDefaultCompletionType = "context" | |
"let g:SuperTabDefaultCompletionType = 2 | |
"let g:SuperTabRetainCompletionType = "<C-X><C-U>" | |
let g:pydiction_location = '~/.vim/complete-dict' | |
"defalut g:pydiction_menu_height == 15 | |
"let g:pydiction_menu_height = 20 | |
"set makeprg=gcc\ -Wall\ -ohello\ hello.c | |
"inoremap <C-p> <C-X><C-O> | |
"inoremap <C-F> <C-X><C-F> | |
"inoremap <C-D> <C-X><C-D> | |
"inoremap <C-L> <C-X><C-L> | |
"setting for completion | |
set completeopt=menu,longest | |
set pumheight=8 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment