Vim


Vim7嘗鮮

Wednesday, May 10th, 2006

剛發現Debian的experimental pool中其實已經有vim 7.0 beta了,所以就裝來玩玩了。 為了用tab page,還得設一些新的key binding。 很多人都用Ctrl-T來開tab,但ctrl-t在trace code時很常用,所以我只好mapping到別的鍵了。

map tl :tabnext
map th :tabprev

map tn :tabnew

map td :tabclose

另外,設定cursorline和cursorcolumn兩個option可以使游標所在的行、列高亮度顯示出來。設定spell可以開啟新的spell checking功能。

Vim7

Wednesday, May 10th, 2006

Vim7正式推出了,以下是官方公佈的一些新功能:

  • Spell checking support for about 50 languages
  • Intelligent completion for C, HTML, Ruby, Python, PHP, etc.
  • Tab pages, each containing multiple windows
  • Undo branches: never accidentally lose text again
  • Vim script supports Lists and Dictionaries (similar to Python)
  • Vim script profiling
  • Improved Unicode support
  • Highlighting of cursor line, cursor column and matching braces
  • Translated manual pages support.
  • Internal grep; works on all platforms, searches compressed files
  • Browsing remote directories, zip and tar archives
  • Printing multibyte text

因為debian還沒有推出正式的package,我也就還沒試用。但從上面看來,我最期待的就是tab page, undo branches了 :-D

一些好用的Vim scripts

Sunday, November 6th, 2005

下午閒來無事,逛逛vim.org,發現一些還蠻不錯的scripts。
趁機記下來,免得老是忘了有這些功能可以用 XD


MultipleSearch.vim

Highlight multiple searches at the same time, each with a different color.

:Search <pattern1>
:Search <pattern2>

:SearchReset

ZoomWin.vim

Brief-like ability to zoom into/out-of a window

Press <c -w>o : the current window zooms into a full screen
Press </c><c -w>o again: the previous set of windows is restored

SearchComplete.vim

Tab completion of words inside of a search (‘/’)

懶人用好東西:p

ShowMarks

Visually shows the location of marks

\mt : Toggles ShowMarks on and off.
\mh : Hides an individual mark.
\ma : Hides all marks in the current buffer.
\mm : Places the next available mark.

vimspell.vim

ispell or aspell based spell checker with fly-spelling

TagList

Source code browser (supports C/C++, java, perl, python, tcl, sql, php, etc)
(其實是tag brower,要搭配ctags使用)