skip to main
|
skip to sidebar
Doro One Two Three
2009/08/10
Vim tip: 搜尋高亮度(search highlight)
VIM在搜尋時有個耳熟能詳的快速鍵*,它能搜尋游標所在字,同時若有設定高亮度搜尋字串(:set hls),搜尋到的字會反白,如下圖是在aaa按下*的截圖:
有時我們會希望將目前搜尋到的目標(如上的aaa)再增加新的游標所在字(如bbb),如下圖:
我們可藉由正規表示式的|來達到,但其實命令有點複雜,所以這裡我提供一個快速鍵sa,來完成此目的,請將下圖的script加入你的.vimrc。
map sa :exec "/\\(".getreg('/')."\\)\\\\|".expand("<cword>")<CR>
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
About Me
Unknown
View my complete profile
My Gallery
打造自己的VIM 系列文章
Labels
Programming
(53)
vim
(30)
Linux
(28)
Computer
(27)
Ubuntu
(11)
Life
(9)
NAS
(8)
Diary
(6)
Hacking
(5)
Arduino
(4)
QNAP
(4)
wargame
(4)
android
(3)
python
(3)
Drama
(2)
GTK
(2)
Graphic
(2)
Investment
(2)
Web
(2)
docker
(2)
GDB
(1)
Kernel
(1)
M$
(1)
embedded
(1)
Blog Archive
►
2018
(1)
►
March
(1)
►
2017
(3)
►
December
(1)
►
October
(1)
►
June
(1)
►
2015
(2)
►
November
(1)
►
August
(1)
►
2013
(29)
►
November
(5)
►
October
(2)
►
September
(1)
►
August
(3)
►
July
(2)
►
June
(6)
►
May
(5)
►
April
(3)
►
March
(2)
►
2012
(1)
►
August
(1)
►
2011
(7)
►
September
(2)
►
August
(3)
►
July
(1)
►
June
(1)
►
2010
(6)
►
September
(1)
►
August
(2)
►
May
(2)
►
April
(1)
▼
2009
(32)
▼
August
(4)
Vim tip: 使用快速鍵編譯C程式
COSCUP: Vim Hack
Vim tip: 搜尋高亮度(search highlight)
Git for Windows
►
July
(1)
►
April
(1)
►
March
(10)
►
February
(15)
►
January
(1)
►
2008
(26)
►
July
(4)
►
June
(2)
►
April
(1)
►
March
(5)
►
February
(5)
►
January
(9)
Posts
Atom
Posts
Comments
Atom
Comments
No comments:
Post a Comment