Vim replace ? - Linux

By Barb Cronin
at 2009-12-31T13:21
at 2009-12-31T13:21
Table of Contents
一個小問題想請教大家~
假如今天有一個文件是這樣
test.txt
11111111_222222_44444_6666*
11111111_222222_44444_6666*
asdasdsa_222222_44444_6666*
dededeed_222222_44444_6666*
rrrrrrrr_222222_44444_6666*
11111111_222222_44444_6666*
今天我想把 這個字串 => "6666"
換掉成 7777
我應該會輸入
ESC
:%s/6666/7777/g
到這邊沒有問題
但是假如 "6666" 這個字串很長 可能是 "666666666666"
所以我可能會在文件上複製 "6666666666" 這個字串 (就是按 y 複製)
但是我在EX指令模式下 我不知道要怎樣貼上我剛剛複製的字串
我的意思是 我可能按下
ESC
:%s/????/7777/g
^
這邊我想用貼上的方法貼上字串 但是我不知道要怎麼按?
因為字串很長想用貼上的方法比較快
不知道有秘技可以分享一下嗎?
--
假如今天有一個文件是這樣
test.txt
11111111_222222_44444_6666*
11111111_222222_44444_6666*
asdasdsa_222222_44444_6666*
dededeed_222222_44444_6666*
rrrrrrrr_222222_44444_6666*
11111111_222222_44444_6666*
今天我想把 這個字串 => "6666"
換掉成 7777
我應該會輸入
ESC
:%s/6666/7777/g
到這邊沒有問題
但是假如 "6666" 這個字串很長 可能是 "666666666666"
所以我可能會在文件上複製 "6666666666" 這個字串 (就是按 y 複製)
但是我在EX指令模式下 我不知道要怎樣貼上我剛剛複製的字串
我的意思是 我可能按下
ESC
:%s/????/7777/g
^
這邊我想用貼上的方法貼上字串 但是我不知道要怎麼按?
因為字串很長想用貼上的方法比較快
不知道有秘技可以分享一下嗎?
--
Tags:
Linux
All Comments

By Aaliyah
at 2010-01-02T13:26
at 2010-01-02T13:26

By William
at 2010-01-06T12:32
at 2010-01-06T12:32

By Gary
at 2010-01-11T10:20
at 2010-01-11T10:20

By Xanthe
at 2010-01-12T22:42
at 2010-01-12T22:42

By Ivy
at 2010-01-13T10:00
at 2010-01-13T10:00
Related Posts
emesen

By Oscar
at 2009-12-31T11:10
at 2009-12-31T11:10
安裝第二張網卡

By Hedy
at 2009-12-31T01:03
at 2009-12-31T01:03
丟臉丟到對岸的linux 台灣作者

By Thomas
at 2009-12-30T23:48
at 2009-12-30T23:48
Ubuntu改密碼.... 怎麼改不成功?

By Anthony
at 2009-12-30T21:23
at 2009-12-30T21:23
Ubuntu改密碼.... 怎麼改不成功?

By Candice
at 2009-12-30T20:31
at 2009-12-30T20:31