用户讨论:Corey:修订间差异

来自Ubuntu中文
跳到导航跳到搜索
Corey留言 | 贡献
无编辑摘要
Corey留言 | 贡献
正在将页面替换为 '喜欢使用ubuntu和vim,但是都不是很了解,都在慢慢学! <br>'
第1行: 第1行:
我的一些设置保存,以后修改!(当然,如果你是用vim的,也可以参照一下,呵呵
喜欢使用ubuntu和vim,但是都不是很了解,都在慢慢学!


不过大多数我都是在windows下用的,linux下没有测试,应该大多数可用,不忙的时候好好整理!)


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
<br>
 
exe &amp; 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(??)
 
==========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("&lt;cword&gt;")<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 SelectTabpage()<br> execute 'tabn'<br>endfun
 
func NewTabpage()<br> execute 'tabnew'<br> if exists("s:ToggleFlag")<br> if s:ToggleFlag &gt;= 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
 
(line("$"))-1 ) '<br>endfun
 
func Insert_Number()<br> execute 'g/^/exec "s/^/".strpart(" ".line("."). " ",len(" ".line("."). " ")-len(line
 
("$"))-1 ) '<br>endfun
 
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 CancleMarkCL()<br> match none<br>endfun
 
"func SetHighlightUnderLine()<br> "call CancleMarkCL()<br> ""highlight CurrentLine guibg=darkgrey guifg=white (or whatever colors you want)<br> "hi CurrentLine term=underline cterm=underline gui=underline ctermbg=NONE guibg=NONE<br> "au! Cursorhold * exe 'match CurrentLine /\%' . line('.') . 'l.*/'<br> "au! InsertEnter * match none<br> "set ut=60<br>"endfun
 
func SetMarkCL()<br> call StorePos()<br> hi CurrentLine ctermbg=darkgrey guibg=darkgrey term=NONE cterm=NONE gui=NONE<br> exe 'match CuMe /\%' . line('.') . 'l.*/'<br>endfun
 
func SetSimsun()<br> set guifont=NSimSun:h14:cGB2312<br> set printfont=NSimSun:h13:cGB2312<br>endfun
 
func SetGothic()<br> set guifont=MS_Gothic:h14:cSHIFTJIS<br> set printfont=MS_Gothic:h13:cSHIFTJIS<br>endfun
 
func SetUTF8()<br> set encoding=utf-8<br>endfun
 
func StorePos()<br> execute 'let g:save_cursor = getpos(".")'<br>endfun
 
func GobackPos()<br> execute 'call setpos(".", g:save_cursor)'<br>endfun
 
func AllToggle()<br> if exists("s:ToggleFlag")<br> if s:ToggleFlag &gt;= 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 &lt;silent&gt;' . ',te' . ' :call TrimEndSpace()&lt;cr&gt;'<br>execute 'vnoremap &lt;silent&gt;' . ',te' . ' &lt;ESC&gt;:call TrimEndSpace()&lt;cr&gt;'
 
" set up the mappings to trim space line<br>execute 'nnoremap &lt;silent&gt;' . ',tl' . ' :call TrimSpaceLine()&lt;cr&gt;'<br>execute 'vnoremap &lt;silent&gt;' . ',tl' . ' &lt;ESC&gt;:call TrimSpaceLine()&lt;cr&gt;'
 
" mark one line<br>execute 'nnoremap &lt;silent&gt;' . 'mn' . ' :call CancleMarkCL()&lt;cr&gt;'<br>execute 'vnoremap &lt;silent&gt;' . 'mn' . ' &lt;ESC&gt;:call CancleMarkCL()&lt;cr&gt;'<br>execute 'nnoremap &lt;silent&gt;' . 'mm' . ' :call SetMarkCL()&lt;cr&gt;'<br>execute 'vnoremap &lt;silent&gt;' . 'mm' . ' &lt;ESC&gt;:call SetMarkCL()&lt;cr&gt;'<br>execute 'nnoremap &lt;silent&gt;' . 'm,' . ' :call GobackPos()&lt;cr&gt;'<br>execute 'vnoremap &lt;silent&gt;' . 'm,' . ' &lt;ESC&gt;:call GobackPos()&lt;cr&gt;'
 
"NewTabpage<br>execute 'nnoremap &lt;silent&gt;' . 'tt' . ' :call NewTabpage()&lt;cr&gt;'<br>execute 'vnoremap &lt;silent&gt;' . 'tt' . ' &lt;ESC&gt;:call NewTabpage()&lt;cr&gt;'
 
" Section: Menu item setup {{{1<br>" ================================================<br>"check if the user wants the menu to be displayed <br>if 1 != 0
 
let menuRoot = '&amp;Plugin.&amp;util'<br> <br> "execute 'menu &lt;silent&gt; '. menuRoot .'.-Sep- :'<br> execute 'nmenu &lt;silent&gt; '. menuRoot .'.Trim\ Trailing\ Space&lt;TAB&gt;' . escape(',te', '\') . ' :call
 
TrimEndSpace()&lt;CR&gt;'<br> execute 'nmenu &lt;silent&gt; '. menuRoot .'.Trim\ Space\ Line&lt;TAB&gt;' . escape(',tl', '\') . ' :call
 
TrimSpaceLine()&lt;CR&gt;'
 
execute 'menu &lt;silent&gt; '. menuRoot .'.-Sep2- :'<br> execute 'nmenu &lt;silent&gt; '. menuRoot .'.Cancle\ Mark&lt;TAB&gt;' . escape('mn', '\') . ' :call CancleMarkCL()
 
&lt;CR&gt;'<br> execute 'nmenu &lt;silent&gt; '. menuRoot .'.Mark\ CurrentLine&lt;TAB&gt;' . escape('mm', '\') . ' :call SetMarkCL
 
()&lt;CR&gt;'<br> execute 'nmenu &lt;silent&gt; '. menuRoot .'.Go\ Mark&lt;TAB&gt;' . escape('m,', '\') . ' :call GobackPos()&lt;CR&gt;'<br> "execute 'nmenu &lt;silent&gt; '. menuRoot .'.Set\ Underline\ CurrentLine&lt;TAB&gt;' . escape('mv', '\') . ' :call
 
SetHighlightUnderLine()&lt;CR&gt;'
 
execute 'menu &lt;silent&gt; '. menuRoot .'.-Sep3- :'<br> execute 'nmenu &lt;silent&gt; '. menuRoot .'.New\ Tabpage&lt;TAB&gt;' . escape('tt', '\') . ' :call NewTabpage()
 
&lt;CR&gt;'<br> execute 'nmenu &lt;silent&gt; '. menuRoot .'.Insert\ Number,\ 0\ Ahead&lt;TAB&gt;' . escape(' ', '\') . ' :call
 
Insert_0_Number()&lt;CR&gt;'<br> execute 'nmenu &lt;silent&gt; '. menuRoot .'.Insert\ Number,\ No\ 0&lt;TAB&gt;' . escape(' ', '\') . ' :call
 
Insert_Number()&lt;CR&gt;'
 
amenu 1.51 PopUp.-SEP_COREY- &lt;Nop&gt;<br> amenu &lt;script&gt; &lt;silent&gt; 1.52 PopUp.Trim\ &amp;End\ Space :call TrimEndSpace()&lt;CR&gt;<br> amenu &lt;script&gt; &lt;silent&gt; 1.53 PopUp.Trim\ Space\ Li&amp;ne :call TrimSpaceLine()&lt;CR&gt;<br> amenu &lt;script&gt; &lt;silent&gt; 1.54 PopUp.Insert\ Nu&amp;mber :call Insert_Number()&lt;CR&gt;<br> amenu &lt;script&gt; &lt;silent&gt; 1.56 PopUp.Font.&amp;Simsun :call SetSimsun()&lt;CR&gt;<br> amenu &lt;script&gt; &lt;silent&gt; 1.57 PopUp.Font.&amp;Gothic :call SetGothic()&lt;CR&gt;<br> amenu &lt;script&gt; &lt;silent&gt; 1.58 PopUp.UTF-&amp;8 :call SetUTF8()&lt;CR&gt;<br> endif
 
" Section: short key item setup {{{1<br>" =======================================<br>noremap &lt;C-tab&gt; :call SelectTabpage()&lt;CR&gt;<br>noremap &lt;F6&gt; :call SaveP()&lt;CR&gt;<br>noremap &lt;F5&gt; :call ReloadP()&lt;CR&gt;
 
noremap &lt;F3&gt; :call Search_Word()&lt;CR&gt; <br>"map &lt;F2&gt; :call TrimSpaceLine()&lt;CR&gt; <br>"map &lt;F4&gt; :call TrimEndSpace()&lt;CR&gt; <br>noremap &lt;F8&gt; :call AllToggle()&lt;CR&gt;
 
" vim: set foldmethod=marker :
 
"--------encode_corey-----------------<br>elseif &amp;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
 
if has("statusline")<br> set statusline=%&lt;%f\ %h%m%r%=%{\"[\".(&amp;fenc==\"\"?&amp;enc:&amp;fenc).\"]\ \"}%k\ %-14.(%l,%c%V%)\ %P<br>endif
 
set tags=tags,./tags
 
" フォント設定:<br>"<br>if has('win32')<br><br>
 
====== =========== ======
 
File ${VIMRT}\gvim.exe<br> File ${VIMRT}\install.exe<br> File ${VIMRT}\uninstal.exe<br> File ${VIMRT}\vimrun.exe<br> File ${VIMRT}\xxd.exe<br> File ${VIMRT}\diff.exe<br> File ${VIMRT}\vimtutor.bat<br> File ${VIMRT}\README.txt<br> File ${VIMRT}\uninstal.txt<br> File ${VIMRT}\*.vim<br> File ${VIMRT}\rgb.txt<br> File ${VIMRT}\ctags.exe<br> File ${VIMRT}\iconv.dll<br> File ${VIMRT}\intl2.dll<br> File ${VIMRT}\msvcr71.dll
 
SetOutPath $INSTDIR<br> File ${VIMRT}\gvimrc<br><br>

2008年3月16日 (日) 15:28的版本

喜欢使用ubuntu和vim,但是都不是很了解,都在慢慢学!