Óï·¨¸ßÁÁ¶ÔÓÚÒ»¸ö±à¼Æ÷À´ËµÎÞÒÉÊǺÜÖØÒªµÄ¶«Î÷£¬ÒòΪºÏÊʵÄÑÕÉ«²»½ö¿ÉÒÔ±£»¤ÎÒÃǵÄÑÛ¾¦£¬¶øÇÒ¸üÖØÒªµÄÊÇËü¿ÉÒÔ°ïÎÒÃǾÀ´í¡£vimµÄwikiÉÏÓÐÒ»¸ö»»Ö÷ÌâÑÕÉ«µÄ½Å±¾£¬µ«ÊÇÖ»ÄÜÔÚÁ½¸öÖ÷ÌâÖ®¼ä½øÐÐÇл»£¬ÎҸĽøÁËһϣ¬ÈÃËü¿ÉÒÔÇ뻶à¸öÑÕÉ«Ö÷Ìâ¡£ÕâÑù¾Í²»ÓÃÿ´ÎÊÖ¶¯µÄÈ¥colorschemeÁË[code]
function! s:SwitchMyStyle()
if exists('g:my_style')
if g:my_style == '1'
let g:my_color= 'asu1dark'
let g:my_style = '2'
elseif g:my_style == '2'
let g:my_color = 'darkblue'
let g:my_style = '3'
elseif g:my_style == '3'
let g:my_color = 'borland'
let g:my_style = '4'
elseif g:my_style == '4'
let g:my_color = 'calmar256_dark'
let g:my_style = '5'
elseif g:my_style == '5'
let g:my_color = 'candycode'
let g:my_style = '1'
endif
else
let g:my_color= 'asu1dark'
let g:my_style= '1'
endif
exec "colorscheme " . g:my_color
endfunction
map
[/code]ÒÔºó°´f7£¬¾Í¿ÉÒÔÔÚ¼¸¸öÑÕÉ«Ö÷ÌâÖ®¼äÇл»¡£
ÒÔÉÏÊÇÎұȽÏϲ»¶µÄ¼¸ÖÖÑÕÉ«Ö÷Ì⣬¿ÉÒÔµ½vimµÄ¹Ù·½ÍøÕ¾ÏÂÔØÖ÷ÌâºÏ¼¯µÄ°ü£¬ÀïÃæÓÐ×î¼ÑµÄ100ÖÖÖ÷Ìâ¡£
ÁíÍâvimÓÐÒ»¸öautocdµÄ¹¦ÄܵŦÄÜ£¬¾ÍÊǵ±Äã±à¼ÄǸöÎļþʱ£¬Äã¾Í×Ô¶¯½øÈëÕâ¸öÎļþµÄĿ¼
set acd
µ«ÊÇÒź¶µÄ£¬ÓÐЩ±àÒë¹ýµÄvim£¬Ã»ÓÐÌí¼ÓÕâ¸ö¹¦ÄÜ£¬ÈÃÎÒÃÇ×Ô¼ºÀ´Ð´Ò»¸öÕâÑùµÄ¶«Î÷[code]
function! ChangeCwd(nextdir)
silent! :execute 'cd ' . a:nextdir
endfunction
:autocmd! BufRead * silent!:call ChangeCwd('%:h')
:autocmd! BufEnter * silent!:call ChangeCwd('%:h')
[/code]vim×Ô¶¯²¹È«µÄ¼üÕæÊǺܶà....
c-x c-lÐв¹È«
c-x c-fÎļþÃü²¹È«
c-x c-o omni²¹È«
c-n¹Ø¼ü×Ö²¹È«£¬µÈµÈµÈ...
¿ÉÄÜÄã²»Ïë¼ÇÒäÕâô¶àµÄ¼ü£¬ºÃ°É£¬×Ô¼º¶¯ÊÖдһ¸ösuperclevertab½Å±¾£¬Ê¹ÓÃtab×Ô¶¯Åжϲ¹È«µÄÀàÐÍ¡£[code]
function! SuperCleverTab()
let col = col('.') - 1
if !col || strpart(getline('.'), 0, col) =~ '^\s*'
return "\
else
if &dictionary != ''
return "\
else
return "\
endif
endif
endfunction
inoremap
[/code]ÀÁµÃд£¬¸ü¶àµÄ¼¼ÇÉÇë¿´vimµÄwiki¡£
Bruce.Ko ÓÚ 2009-09-28 21:17:04·¢±í:
ºÜ²»´í°¡£¡Ö§³ÖÂ¥Ö÷·¢Ìù£¡
RFCOS ÓÚ 2009-09-28 15:15:04·¢±í:
żµÄvimºÜÀË£¬555