""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"set shortmess=atI "
"winpos 5 5 "
"set lines=40 columns=155 "
"set nu "
set go= "
"color asmanian2 "
set guifont=Courier_New:h10:cANSI "
"syntax on "
autocmd InsertLeave * se nocul "
autocmd InsertEnter * se cul "
"set ruler "
set showcmd " ,
"set cmdheight=1 " ( ) , 1
"set whichwrap+=,h,l " backspace ( )
"set scrolloff=3 " buffer 3
set novisualbell " ( )
set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ %{strftime(\"%d/%m/%y\ -\ %H:%M\")} "
set laststatus=1 " (1), (2)
set foldenable "
set foldmethod=manual "
"set background=dark "
set nocompatible " vi , bug
"
if version >= 603
set helplang=cn
set encoding=utf-8
endif
"
"colorscheme murphy
"
"if (has("gui_running"))
" set guifont=Bitstream\ Vera\ Sans\ Mono\ 10
"endif
set fencs=utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936
set termencoding=utf-8
set encoding=utf-8
set fileencodings=ucs-bom,utf-8,cp936
set fileencoding=utf-8
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" .c,.h,.sh,.java ,
autocmd BufNewFile *.cpp,*.[ch],*.sh,*.java exec ":call SetTitle()"
"" SetTitle,
func SetTitle()
" .sh
if &filetype == 'sh'
call setline(1,"\#########################################################################")
call append(line("."), "\# File Name: ".expand("%"))
call append(line(".")+1, "\# Author: ma6174")
call append(line(".")+2, "\# mail: [email protected]")
call append(line(".")+3, "\# Created Time: ".strftime("%c"))
call append(line(".")+4, "\#########################################################################")
call append(line(".")+5, "\#!/bin/bash")
call append(line(".")+6, "")
else
call setline(1, "/*************************************************************************")
call append(line("."), " > File Name: ".expand("%"))
call append(line(".")+1, " > Author: ma6174")
call append(line(".")+2, " > Mail: [email protected] ")
call append(line(".")+3, " > Created Time: ".strftime("%c"))
call append(line(".")+4, " ************************************************************************/")
call append(line(".")+5, "")
endif
if &filetype == 'cpp'
call append(line(".")+6, "#include")
call append(line(".")+7, "using namespace std;")
call append(line(".")+8, "")
endif
if &filetype == 'c'
call append(line(".")+6, "#include")
call append(line(".")+7, "")
endif
" ,
autocmd BufNewFile * normal G
endfunc
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
nmap w :w!
nmap f :find
" + ctrl+a
map ggVGY
map! ggVGY
map gg=G
" Ctrl+c
vmap "+y
"
nnoremap :g/^\s*$/d
"
nnoremap :vert diffsplit
"
map :tabnew
"
map :tabnew .
"
map \be
"C,C++ F5
map :call CompileRunGcc()
func! CompileRunGcc()
exec "w"
if &filetype == 'c'
exec "!g++ % -o % :call Rungdb()
func! Rungdb()
exec "w"
exec "!g++ % -g -o % :w:make
"
set completeopt=preview,menu
"
filetype plugin on
"
set clipboard+=unnamed
"
set nobackup
"make
:set makeprg=g++\ -Wall\ \ %
"
set autowrite
set ruler "
set cursorline "
set magic "
set guioptions-=T "
set guioptions-=m "
"set statusline=\ %,h,l
" buffer ( office )
set mouse=a
set selection=exclusive
set selectmode=mouse,key
" : commands ,
set report=0
" ,
set fillchars=vert:\ ,stl:\ ,stlnc:\
"
set showmatch
" ( )
set matchtime=1
" buffer 3
set scrolloff=3
" C
set smartindent
" txt ( txt.vim )
au BufRead,BufNewFile * setfiletype txt
"
:inoremap ( ()i
:inoremap ) =ClosePair(')')
:inoremap { {}O
:inoremap } =ClosePair('}')
:inoremap [ []i
:inoremap ] =ClosePair(']')
:inoremap " ""i
:inoremap ' ''i
function! ClosePair(char)
if getline('.')[col('.') - 1] == a:char
return "\"
else
return a:char
endif
endfunction
filetype plugin indent on
" ,
set completeopt=longest,menu
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" CTags
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let Tlist_Sort_Type = "name" "
let Tlist_Use_Right_Window = 1 "
let Tlist_Compart_Format = 1 "
let Tlist_Exist_OnlyWindow = 1 " buffer,kill kill buffer
let Tlist_File_Fold_Auto_Close = 0 " tags
let Tlist_Enable_Fold_Column = 0 "
autocmd FileType java set tags+=D:\tools\java\tags
"autocmd FileType h,cpp,cc,c set tags+=D:\tools\cpp\tags
"let Tlist_Show_One_File=1 " tag,
" tags
set tags=tags
"set autochdir
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Taglist
let Tlist_Auto_Open=1
""""""""""""""""""""""""""""""
" Tag list (ctags)
""""""""""""""""""""""""""""""""
let Tlist_Ctags_Cmd = '/usr/bin/ctags'
let Tlist_Show_One_File = 1 " tag,
let Tlist_Exit_OnlyWindow = 1 " taglist , vim
let Tlist_Use_Right_Window = 1 " taglist
" minibufexpl
let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplMapWindowNavArrows = 1
let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplModSelTarget = 1