用户讨论:Corey

来自Ubuntu中文
Corey留言 | 贡献2008年3月7日 (五) 13:11的版本
跳到导航跳到搜索

我的一些设置保存,以后修改!

plugin
---------------
taglist.vim
encode_japan.vim
readcsv.vim
NERD_commenter.vim
supertab.vim
util_corey.vim

colors
---------
corey.vim

exe & dll
---------
ctags.exe
gvimext.dll
iconv.dll
intl2.dll
msvcr71.dll
libint.dll
VisVim.dll

installer
---------------
gvim.nsis
awiconsprosetup.exe

vi.cmd

====================================================
"args **/*.jsp
"argdo %s/old/target/c | update

" Section: utillity tools {{{1
" ===================================================
func Search_Word()
let w = expand("<cword>")
"exe "vimgrep " w "*.java *.jsp *.php *.c *.h *.htm"
exe "vimgrep " w "**/*.*"
exe 'copen'
endfun

func TrimSpaceLine()
execute 'g/^\s*$/d'
endfun
func TrimEndSpace()
execute '%s/\s*$//'
endfun

func SelectTabpage()
execute 'tabn'
endfun

func NewTabpage()
execute 'tabnew'
endfun

func Insert_0_Number()
execute 'g/^/exec "s/^/".strpart("000000000000".line("."). " ",
len("000000000000".line("."). " ")-len(line("$"))-1 ) '
endfun

func Insert_Number()
execute 'g/^/exec "s/^/".strpart(line(".")." ", 0, len(line("$")) + 1)'
endfun

func SaveP()

call inputsave()
let Pname = input('Save Project name?')
call inputrestore()

execute 'mksession! ~\'.Pname.'.vim'
execute 'wviminfo! ~\'.Pname.'.viminfo'
endfun

func ReloadP()

call inputsave()
let Pbname = input('Load Project name?')
call inputrestore()

execute 'source ~\'.Pbname.'.vim'
execute 'rviminfo ~\'.Pbname.'.viminfo'
endfun

func CancleHighlightCurrentLine()
au! Cursorhold
match none
endfun

func SetHighlightUnderLine()
call CancleHighlightCurrentLine()
"highlight CurrentLine guibg=darkgrey guifg=white (or whatever colors you want)
hi CurrentLine term=underline cterm=underline gui=underline ctermbg=NONE guibg=NONE
au! Cursorhold * exe 'match CurrentLine /\%' . line('.') . 'l.*/'
au! InsertEnter * match none
set ut=60
endfun

func SetHighlightCurrentLine()
call CancleHighlightCurrentLine()
hi CurrentLine ctermbg=darkgrey guibg=darkgrey term=NONE cterm=NONE gui=NONE
au! Cursorhold * exe 'match CurrentLine /\%' . line('.') . 'l.*/'
au! InsertEnter * match none
set ut=60
endfun

" Section: Comment mapping setup {{{1
" ===========================================================================
" This is where the mappings calls are made that set up the commenting key
" mappings.
" set up the mappings to trim space at the line's end
execute 'nnoremap <silent>' . ',te' . ' :call TrimEndSpace()<cr>'
execute 'vnoremap <silent>' . ',te' . ' <ESC>:call TrimEndSpace()<cr>'

" set up the mappings to trim space line
execute 'nnoremap <silent>' . ',tl' . ' :call TrimSpaceLine()<cr>'
execute 'vnoremap <silent>' . ',tl' . ' <ESC>:call TrimSpaceLine()<cr>'

" set up the mappings to Cancle and set Highlight Current Line
execute 'nnoremap <silent>' . 'mm' . ' :call CancleHighlightCurrentLine()<cr>'
execute 'vnoremap <silent>' . 'mm' . ' <ESC>:call CancleHighlightCurrentLine()<cr>'

execute 'nnoremap <silent>' . 'mn' . ' :call SetHighlightCurrentLine()<cr>'
execute 'vnoremap <silent>' . 'mn' . ' <ESC>:call SetHighlightCurrentLine()<cr>'

execute 'nnoremap <silent>' . 'mv' . ' :call SetHighlightUnderLine()<cr>'
execute 'vnoremap <silent>' . 'mv' . ' <ESC>:call SetHighlightUnderLine()<cr>'

"NewTabpage
execute 'nnoremap <silent>' . 'tt' . ' :call NewTabpage()<cr>'
execute 'vnoremap <silent>' . 'tt' . ' <ESC>:call NewTabpage()<cr>'

" Section: Menu item setup {{{1
" ===========================================================================
"check if the user wants the menu to be displayed
if 1 != 0

let menuRoot = '&Plugin.&util'

execute 'menu <silent> '. menuRoot .'.-Sep- :'
execute 'nmenu <silent> '. menuRoot .'.Trim\ End\ Space<TAB>' .
escape(',te', '\') . ' :call TrimEndSpace()<CR>'
execute 'nmenu <silent> '. menuRoot .'.Trim\ Space\ Line<TAB>' .
escape(',tl', '\') . ' :call TrimSpaceLine()<CR>'

execute 'menu <silent> '. menuRoot .'.-Sep2- :'
execute 'nmenu <silent> '. menuRoot .'.Cancle\ Highlight\ CurrentLine<TAB>' .
escape('mm', '\') . ' :call CancleHighlightCurrentLine()<CR>'
execute 'nmenu <silent> '. menuRoot .'.Set\ Highlight\ CurrentLine<TAB>' .
escape('mn', '\') . ' :call SetHighlightCurrentLine()<CR>'
execute 'nmenu <silent> '. menuRoot .'.Set\ Underline\ CurrentLine<TAB>' .
escape('mv', '\') . ' :call SetHighlightUnderLine()<CR>'

execute 'menu <silent> '. menuRoot .'.-Sep3- :'
execute 'nmenu <silent> '. menuRoot .'.New\ Tabpage<TAB>' . escape('tt', '\') .
' :call NewTabpage()<CR>'
execute 'nmenu <silent> '. menuRoot .'.Insert\ Number,\ 0\ Ahead<TAB>' .
escape(' ', '\') . ' :call Insert_0_Number()<CR>'
execute 'nmenu <silent> '. menuRoot .'.Insert\ Number,\ No\ 0<TAB>' .
escape(' ', '\') . ' :call Insert_Number()<CR>'

endif
" vim: set foldmethod=marker :


gvimrc---------------------
set nowrap
set expandtab
set noignorecase
set guioptions+=b

call SetHighlightUnderLine()

"au GUIEnter * simalt ~x "maximum the initial window

map <C-tab> :call SelectTabpage()<CR>
map <F6> :call SaveP()<CR>
map <F5> :call ReloadP()<CR>
" input the tab, need to comment out [set expandtab]
inoremap <S-t> <tab>

if has("statusline")
set statusline=%<%f\ %h%m%r%=%{\"[\".
(&fenc==\"\"?&enc:&fenc).\"]\ \"}%k\ %-14.(%l,%c%V%)\ %P
endif

=======================

File ${VIMRT}\gvim.exe
File ${VIMRT}\install.exe
File ${VIMRT}\uninstal.exe
File ${VIMRT}\vimrun.exe
File ${VIMRT}\xxd.exe
File ${VIMRT}\diff.exe
File ${VIMRT}\vimtutor.bat
File ${VIMRT}\README.txt
File ${VIMRT}\uninstal.txt
File ${VIMRT}\*.vim
File ${VIMRT}\rgb.txt
File ${VIMRT}\ctags.exe
File ${VIMRT}\iconv.dll
File ${VIMRT}\intl2.dll
File ${VIMRT}\msvcr71.dll

SetOutPath $INSTDIR
File ${VIMRT}\gvimrc