skip to main
|
skip to sidebar
Chaotic
堆積各式雜物
June 02, 2009
vim 計算機
把選起來的區塊裡面的數字加上 250 的寫法
s/\%V\d\+/\=submatch(0)+250/
%V: visual block
搜尋 _[1-9]+_ 的數字再加上 2
s/_\([1-9]\+\)_/\="_".eval(submatch(1)+2)."_"/
字串要用 " " 表示,並用 . 串接起來
Ref:
http://vim.wikia.com/wiki/Search_and_replace_in_a_visual_selection
http://greenisland.csie.nctu.edu.tw/wp/2007/04/16/993/
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
About Me
yyhuang
View my complete profile
Blog Archive
►
2019
(1)
►
March
(1)
►
2017
(2)
►
June
(1)
►
May
(1)
►
2016
(3)
►
December
(2)
►
January
(1)
►
2015
(9)
►
November
(2)
►
October
(1)
►
July
(1)
►
June
(5)
►
2014
(5)
►
September
(2)
►
August
(2)
►
July
(1)
►
2013
(11)
►
August
(1)
►
June
(1)
►
May
(2)
►
April
(2)
►
March
(1)
►
February
(2)
►
January
(2)
►
2012
(3)
►
July
(1)
►
January
(2)
►
2011
(19)
►
October
(1)
►
September
(1)
►
August
(3)
►
July
(1)
►
June
(3)
►
May
(3)
►
April
(4)
►
March
(1)
►
February
(1)
►
January
(1)
►
2010
(13)
►
December
(1)
►
November
(1)
►
October
(1)
►
September
(2)
►
August
(3)
►
June
(3)
►
May
(1)
►
April
(1)
▼
2009
(12)
►
December
(2)
►
November
(1)
►
September
(1)
▼
June
(2)
vim 計算機
add switch in bash script
►
April
(1)
►
March
(4)
►
January
(1)
►
2008
(19)
►
December
(5)
►
November
(3)
►
October
(1)
►
August
(2)
►
July
(2)
►
June
(2)
►
May
(2)
►
March
(1)
►
January
(1)
►
2007
(26)
►
December
(4)
►
November
(3)
►
October
(1)
►
August
(1)
►
July
(4)
►
June
(4)
►
May
(2)
►
April
(7)
Search This Blog
Recent Comments
Loading...
Labels
android
(2)
bang
(2)
bank
(1)
baseball
(1)
bash
(3)
boardgame
(2)
book
(1)
browser
(4)
docker
(1)
drama
(1)
erlang
(1)
food
(8)
game
(1)
git
(11)
google
(1)
hsinchu
(4)
japandrama
(1)
kindle
(2)
leverage
(1)
life
(5)
Mac
(1)
mongodb
(2)
movie
(6)
murmur
(18)
node.js
(1)
Notes
(50)
npm
(1)
Perl
(1)
python
(1)
QT
(1)
software
(1)
ssh
(3)
taipei
(2)
tea
(1)
travel
(10)
unity
(3)
vim
(16)
VirtualBox
(2)
xbox360
(1)
Subscribe To
Posts
Atom
Posts
Comments
Atom
Comments
No comments:
Post a Comment