用户讨论:Corey:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
第3行: | 第3行: | ||
不过大多数我都是在windows下用的,linux下没有测试,应该大多数可用,不忙的时候好好整理!) | 不过大多数我都是在windows下用的,linux下没有测试,应该大多数可用,不忙的时候好好整理!) | ||
plugin<br>---------------<br>taglist.vim<br>encode_corey.vim<br> | plugin<br>"---------------<br>taglist.vim<br>encode_corey.vim<br>readcsv_corey.vim<br>NERD_commenter.vim<br>supertab.vim<br>util_corey.vim<br>winmanager.vim | ||
colors<br>---------<br>corey.vim<br>" Last Change: 2008 March 12<br>" This idea comes from evening scheme.<br>hi CursorLine term=underline cterm=underline gui=underline ctermbg=NONE guibg=NONE<br>hi CuMe ctermbg=darkgrey guibg=darkgrey term=NONE cterm=NONE gui=NONE | colors<br>"---------<br>corey.vim<br>" Last Change: 2008 March 12<br>" This idea comes from evening scheme.<br>hi CursorLine term=underline cterm=underline gui=underline ctermbg=NONE guibg=NONE<br>hi CuMe ctermbg=darkgrey guibg=darkgrey term=NONE cterm=NONE gui=NONE | ||
exe & dll<br>---------<br>ctags.exe<br>gvimext.dll<br>iconv.dll<br>intl2.dll<br>msvcr71.dll<br>libint.dll<br>VisVim.dll | exe & dll<br>"---------<br>ctags.exe<br>gvimext.dll<br>iconv.dll<br>intl2.dll<br>msvcr71.dll<br>libint.dll<br>VisVim.dll | ||
installer<br>---------------<br>gvim.nsis<br>vi.cmd(??) | installer<br>"---------------<br>gvim.nsis<br>vi.cmd(??) | ||
==========util=======================<br>"===============================<br>" corey 2008/03/14<br>"===============================<br>"args **/*.jsp<br>"argdo %s/old/target/c | update | ==========util=======================<br>"===============================<br>" corey 2008/03/14<br>"===============================<br>"args **/*.jsp<br>"argdo %s/old/target/c | update | ||
" Section: utillity tools {{{1<br>" ===========================================================================<br>func Search_Word()<br> let w = expand("<cword>")<br> exe "vimgrep " w "**/*.java **/*.jsp **/*.php **/*.c **/*.h **/*.htm" <br> "exe "vimgrep " w "**/*.*" <br> exe 'copen' <br>endfun | |||
" Section: utillity tools {{{1<br>" ===============================================<br>func Search_Word()<br> let w = expand("<cword>")<br> exe "vimgrep " w "**/*.java **/*.jsp **/*.php **/*.c **/*.h **/*.htm" <br> "exe "vimgrep " w "**/*.*" <br> exe 'copen' <br>endfun | |||
func TrimSpaceLine()<br> execute 'g/^\s*$/d'<br>endfun<br>func TrimEndSpace()<br> execute '%s/\s*$//'<br>endfun | func TrimSpaceLine()<br> execute 'g/^\s*$/d'<br>endfun<br>func TrimEndSpace()<br> execute '%s/\s*$//'<br>endfun | ||
第21行: | 第19行: | ||
func SelectTabpage()<br> execute 'tabn'<br>endfun | func SelectTabpage()<br> execute 'tabn'<br>endfun | ||
func NewTabpage()<br> execute 'tabnew'<br>endfun | func NewTabpage()<br> execute 'tabnew'<br> if exists("s:ToggleFlag")<br> if s:ToggleFlag >= 1<br> execute 'WMToggle'<br> endif<br> endif<br>endfun | ||
func Insert_0_Number()<br> execute 'g/^/exec "s/^/".strpart("000000000000".line("."). " ",len("000000000000".line("."). " ")-len | func Insert_0_Number()<br> execute 'g/^/exec "s/^/".strpart("000000000000".line("."). " ",len("000000000000".line("."). " ")-len | ||
第27行: | 第25行: | ||
(line("$"))-1 ) '<br>endfun | (line("$"))-1 ) '<br>endfun | ||
func Insert_Number() | func Insert_Number()<br> execute 'g/^/exec "s/^/".strpart(" ".line("."). " ",len(" ".line("."). " ")-len(line | ||
("$"))-1 ) '<br>endfun | ("$"))-1 ) '<br>endfun | ||
func SaveP() | func SaveP()<br> call inputsave()<br> let Pname = input('Save Project name?')<br> call inputrestore()<br> execute 'mksession! ~\'.Pname.'.vim'<br> execute 'wviminfo! ~\'.Pname.'.viminfo'<br>endfun | ||
func ReloadP()<br> call inputsave()<br> let Pbname = input('Load Project name?')<br> call inputrestore()<br> execute 'source ~\'.Pbname.'.vim'<br> execute 'rviminfo ~\'.Pbname.'.viminfo'<br>endfun | |||
func ReloadP() | |||
func CancleMarkCL()<br> match none<br>endfun | func CancleMarkCL()<br> match none<br>endfun | ||
第53行: | 第49行: | ||
func GobackPos()<br> execute 'call setpos(".", g:save_cursor)'<br>endfun | func GobackPos()<br> execute 'call setpos(".", g:save_cursor)'<br>endfun | ||
" Section: Comment mapping setup {{{1<br>" =========================================<br>" This is where the mappings calls are made that set up the commenting key<br>" mappings.<br>" set up the mappings to trim space at the line's end<br>execute 'nnoremap <silent>' . ',te' . ' :call TrimEndSpace()<cr>'<br>execute 'vnoremap <silent>' . ',te' . ' <ESC>:call TrimEndSpace()<cr>' | func AllToggle()<br> if exists("s:ToggleFlag")<br> if s:ToggleFlag >= 1<br> let s:ToggleFlag = 0<br> else<br> let s:ToggleFlag = 1<br> endif<br> else<br> let s:ToggleFlag = 1<br> endif<br> execute 'WMToggle'<br>endfun | ||
" Section: Comment mapping setup {{{1<br>" ===========================================================================<br>" This is where the mappings calls are made that set up the commenting key<br>" mappings.<br>" set up the mappings to trim space at the line's end<br>execute 'nnoremap <silent>' . ',te' . ' :call TrimEndSpace()<cr>'<br>execute 'vnoremap <silent>' . ',te' . ' <ESC>:call TrimEndSpace()<cr>' | |||
" set up the mappings to trim space line<br>execute 'nnoremap <silent>' . ',tl' . ' :call TrimSpaceLine()<cr>'<br>execute 'vnoremap <silent>' . ',tl' . ' <ESC>:call TrimSpaceLine()<cr>' | " set up the mappings to trim space line<br>execute 'nnoremap <silent>' . ',tl' . ' :call TrimSpaceLine()<cr>'<br>execute 'vnoremap <silent>' . ',tl' . ' <ESC>:call TrimSpaceLine()<cr>' | ||
" | " mark one line<br>execute 'nnoremap <silent>' . 'mn' . ' :call CancleMarkCL()<cr>'<br>execute 'vnoremap <silent>' . 'mn' . ' <ESC>:call CancleMarkCL()<cr>'<br>execute 'nnoremap <silent>' . 'mm' . ' :call SetMarkCL()<cr>'<br>execute 'vnoremap <silent>' . 'mm' . ' <ESC>:call SetMarkCL()<cr>'<br>execute 'nnoremap <silent>' . 'm,' . ' :call GobackPos()<cr>'<br>execute 'vnoremap <silent>' . 'm,' . ' <ESC>:call GobackPos()<cr>' | ||
execute 'nnoremap <silent>' . 'mm' . ' :call SetMarkCL()<cr>'<br>execute 'vnoremap <silent>' . 'mm' . ' <ESC>:call SetMarkCL()<cr>' | |||
execute 'nnoremap <silent>' . 'm,' . ' :call GobackPos()<cr>'<br>execute 'vnoremap <silent>' . 'm,' . ' <ESC>:call GobackPos | |||
"NewTabpage<br>execute 'nnoremap <silent>' . 'tt' . ' :call NewTabpage()<cr>'<br>execute 'vnoremap <silent>' . 'tt' . ' <ESC>:call NewTabpage()<cr>' | "NewTabpage<br>execute 'nnoremap <silent>' . 'tt' . ' :call NewTabpage()<cr>'<br>execute 'vnoremap <silent>' . 'tt' . ' <ESC>:call NewTabpage()<cr>' | ||
" Section: Menu item setup {{{1<br>" =========================================<br>"check if the user wants the menu to be displayed <br>if 1 != 0 | " Section: Menu item setup {{{1<br>" ================================================<br>"check if the user wants the menu to be displayed <br>if 1 != 0 | ||
let menuRoot = '&Plugin.&util'<br> <br> "execute 'menu <silent> '. menuRoot .'.-Sep- :'<br> execute 'nmenu <silent> '. menuRoot .'.Trim\ Trailing\ Space<TAB>' . escape(',te', '\') . ' :call | let menuRoot = '&Plugin.&util'<br> <br> "execute 'menu <silent> '. menuRoot .'.-Sep- :'<br> execute 'nmenu <silent> '. menuRoot .'.Trim\ Trailing\ Space<TAB>' . escape(',te', '\') . ' :call | ||
第91行: | 第83行: | ||
Insert_Number()<CR>' | Insert_Number()<CR>' | ||
amenu 1.51 PopUp.-SEP_COREY- <Nop><br> amenu <script> <silent> 1.52 PopUp.Trim\ &End\ Space :call TrimEndSpace()<CR><br> amenu <script> <silent> 1.53 PopUp.Trim\ Space\ Li&ne :call TrimSpaceLine()<CR><br> amenu <script> <silent> 1.54 PopUp.Insert\ Nu&mber :call Insert_Number()<CR> | amenu 1.51 PopUp.-SEP_COREY- <Nop><br> amenu <script> <silent> 1.52 PopUp.Trim\ &End\ Space :call TrimEndSpace()<CR><br> amenu <script> <silent> 1.53 PopUp.Trim\ Space\ Li&ne :call TrimSpaceLine()<CR><br> amenu <script> <silent> 1.54 PopUp.Insert\ Nu&mber :call Insert_Number()<CR><br> amenu <script> <silent> 1.56 PopUp.Font.&Simsun :call SetSimsun()<CR><br> amenu <script> <silent> 1.57 PopUp.Font.&Gothic :call SetGothic()<CR><br> amenu <script> <silent> 1.58 PopUp.UTF-&8 :call SetUTF8()<CR><br> endif | ||
" Section: short key item setup {{{1<br>" =======================================<br>noremap <C-tab> :call SelectTabpage()<CR><br>noremap <F6> :call SaveP()<CR><br>noremap <F5> :call ReloadP()<CR> | |||
noremap <F3> :call Search_Word()<CR> <br>"map <F2> :call TrimSpaceLine()<CR> <br>"map <F4> :call TrimEndSpace()<CR> <br>noremap <F8> :call AllToggle()<CR> | |||
" vim: set foldmethod=marker : | |||
"--------encode_corey-----------------<br>elseif &encoding ==? 'cp936'<br>let value = 'ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1'<br>"set encoding=japan | |||
"----------gvimrc--------------<br>" vim:set ts=8 sts=2 sw=2 tw=0: <br>"------------------------------<br>"edited by corey<br>"<br>"<br>source $VIMRUNTIME/mswin.vim<br>source $VIMRUNTIME/gvimrc_example.vim | |||
" | set encoding=japan<br>" カラー設定:<br>colorscheme corey<br>set nobk<br>set number<br>set shiftwidth=2<br>set softtabstop=4<br>set tabstop=4<br>autocmd BufNewFile,BufRead *.vb set ft=vbnet<br>autocmd BufNewFile,Bufread *.csv call CSVSELECT() <br>set nowrap<br>set expandtab<br>set noignorecase<br>set guioptions+=b<br>let g:winManagerWindowLayout='FileExplorer|TagList' | ||
set cul<br>au InsertEnter * set nocul<br>au InsertLeave * set cul | |||
"au GUIEnter * simalt ~x "maximum the initial window | "au GUIEnter * simalt ~x "maximum the initial window | ||
if has("statusline")<br> set statusline=%<%f\ %h%m%r%=%{\"[\".(&fenc==\"\"?&enc:&fenc).\"]\ \"}%k\ %-14.(%l,%c%V%)\ %P<br>endif | |||
set tags=tags,./tags | |||
" フォント設定:<br>"<br>if has('win32')<br><br> | " フォント設定:<br>"<br>if has('win32')<br><br> |
2008年3月14日 (五) 15:37的版本
我的一些设置保存,以后修改!(当然,如果你是用vim的,也可以参照一下,呵呵
不过大多数我都是在windows下用的,linux下没有测试,应该大多数可用,不忙的时候好好整理!)
plugin
"---------------
taglist.vim
encode_corey.vim
readcsv_corey.vim
NERD_commenter.vim
supertab.vim
util_corey.vim
winmanager.vim
colors
"---------
corey.vim
" Last Change: 2008 March 12
" This idea comes from evening scheme.
hi CursorLine term=underline cterm=underline gui=underline ctermbg=NONE guibg=NONE
hi CuMe ctermbg=darkgrey guibg=darkgrey term=NONE cterm=NONE gui=NONE
exe & dll
"---------
ctags.exe
gvimext.dll
iconv.dll
intl2.dll
msvcr71.dll
libint.dll
VisVim.dll
installer
"---------------
gvim.nsis
vi.cmd(??)
==========util=======================
"===============================
" corey 2008/03/14
"===============================
"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'
if exists("s:ToggleFlag")
if s:ToggleFlag >= 1
execute 'WMToggle'
endif
endif
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("."). " ",len(" ".line("."). " ")-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 CancleMarkCL()
match none
endfun
"func SetHighlightUnderLine()
"call CancleMarkCL()
""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 SetMarkCL()
call StorePos()
hi CurrentLine ctermbg=darkgrey guibg=darkgrey term=NONE cterm=NONE gui=NONE
exe 'match CuMe /\%' . line('.') . 'l.*/'
endfun
func SetSimsun()
set guifont=NSimSun:h14:cGB2312
set printfont=NSimSun:h13:cGB2312
endfun
func SetGothic()
set guifont=MS_Gothic:h14:cSHIFTJIS
set printfont=MS_Gothic:h13:cSHIFTJIS
endfun
func SetUTF8()
set encoding=utf-8
endfun
func StorePos()
execute 'let g:save_cursor = getpos(".")'
endfun
func GobackPos()
execute 'call setpos(".", g:save_cursor)'
endfun
func AllToggle()
if exists("s:ToggleFlag")
if s:ToggleFlag >= 1
let s:ToggleFlag = 0
else
let s:ToggleFlag = 1
endif
else
let s:ToggleFlag = 1
endif
execute 'WMToggle'
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>'
" mark one line
execute 'nnoremap <silent>' . 'mn' . ' :call CancleMarkCL()<cr>'
execute 'vnoremap <silent>' . 'mn' . ' <ESC>:call CancleMarkCL()<cr>'
execute 'nnoremap <silent>' . 'mm' . ' :call SetMarkCL()<cr>'
execute 'vnoremap <silent>' . 'mm' . ' <ESC>:call SetMarkCL()<cr>'
execute 'nnoremap <silent>' . 'm,' . ' :call GobackPos()<cr>'
execute 'vnoremap <silent>' . 'm,' . ' <ESC>:call GobackPos()<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\ Trailing\ 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\ Mark<TAB>' . escape('mn', '\') . ' :call CancleMarkCL()
<CR>'
execute 'nmenu <silent> '. menuRoot .'.Mark\ CurrentLine<TAB>' . escape('mm', '\') . ' :call SetMarkCL
()<CR>'
execute 'nmenu <silent> '. menuRoot .'.Go\ Mark<TAB>' . escape('m,', '\') . ' :call GobackPos()<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>'
amenu 1.51 PopUp.-SEP_COREY- <Nop>
amenu <script> <silent> 1.52 PopUp.Trim\ &End\ Space :call TrimEndSpace()<CR>
amenu <script> <silent> 1.53 PopUp.Trim\ Space\ Li&ne :call TrimSpaceLine()<CR>
amenu <script> <silent> 1.54 PopUp.Insert\ Nu&mber :call Insert_Number()<CR>
amenu <script> <silent> 1.56 PopUp.Font.&Simsun :call SetSimsun()<CR>
amenu <script> <silent> 1.57 PopUp.Font.&Gothic :call SetGothic()<CR>
amenu <script> <silent> 1.58 PopUp.UTF-&8 :call SetUTF8()<CR>
endif
" Section: short key item setup {{{1
" =======================================
noremap <C-tab> :call SelectTabpage()<CR>
noremap <F6> :call SaveP()<CR>
noremap <F5> :call ReloadP()<CR>
noremap <F3> :call Search_Word()<CR>
"map <F2> :call TrimSpaceLine()<CR>
"map <F4> :call TrimEndSpace()<CR>
noremap <F8> :call AllToggle()<CR>
" vim: set foldmethod=marker :
"--------encode_corey-----------------
elseif &encoding ==? 'cp936'
let value = 'ucs-bom,utf-8,cp936,gb18030,big5,euc-jp,euc-kr,latin1'
"set encoding=japan
"----------gvimrc--------------
" vim:set ts=8 sts=2 sw=2 tw=0:
"------------------------------
"edited by corey
"
"
source $VIMRUNTIME/mswin.vim
source $VIMRUNTIME/gvimrc_example.vim
set encoding=japan
" カラー設定:
colorscheme corey
set nobk
set number
set shiftwidth=2
set softtabstop=4
set tabstop=4
autocmd BufNewFile,BufRead *.vb set ft=vbnet
autocmd BufNewFile,Bufread *.csv call CSVSELECT()
set nowrap
set expandtab
set noignorecase
set guioptions+=b
let g:winManagerWindowLayout='FileExplorer|TagList'
set cul
au InsertEnter * set nocul
au InsertLeave * set cul
"au GUIEnter * simalt ~x "maximum the initial window
if has("statusline")
set statusline=%<%f\ %h%m%r%=%{\"[\".(&fenc==\"\"?&enc:&fenc).\"]\ \"}%k\ %-14.(%l,%c%V%)\ %P
endif
set tags=tags,./tags
" フォント設定:
"
if has('win32')
===========
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