Re: repeat replace many time on each line
Tobia wrote on 02/04/2007 23:51: Bob Hiestand wrote: Tobia wrote: Arnaud Bourree wrote: I've Xml document with attribute likes: foo=00 12 AF I want to replace with: foo=0x00 0x12 0xAF this works: %s/\%(\%(foo=\\)\@=\%([0-9A-F]\{2\}\s\)*\)\@=\([0-9A-F]\{2\}\)/0x\1/g In using :s with the /g flag, I take it the potential changes are marked first, and then executed, per line? It would seem so. By the way, I would have used a simpler pattern for such a task: %s/\v%(foo\=[^]*)@=(\x\x)/0x\1/g Thanks that is exactly what I expect: it works for all values listed in foo attribute. I don't need to repeat the command. Good lesson for me today: keep it simple ;-) I prefer when dealing with that many special characters to use the very-magic form Me too. I can't stand trying to match \( \) with my eyes, they just don't look right, not to mention \{ \? \+... Egrep and Perl have it right. I wish I could turn very-magic on by default. Tobia -- Reclaim Your Inbox! http://www.mozilla.org/products/thunderbird
repeat replace many time on each line
Hello, I've Xml document with attribute likes: foo=00 12 AF I want to replace with: foo=0x00 0x12 0xAF I try: %s/\%(\%(foo=\\)\@=\%(0x[0-9A-F]\{2\}\s\)*\)\@=\([0-9A-F]\{2\}\)/0x\1/g It works fine for each first occurrence of each line but not on others whatever I've put g option. I have to use repeat manually until change is finish. How can I do repeat? Thanks, Arnaud. -- Reclaim Your Inbox! http://www.mozilla.org/products/thunderbird
Re: Vim Help for deleting text
Tim Chase wrote on 19/03/2007 23:01: Or, if all your columns align, you can use visual-block mode with control+V to create a block across the characters in question, and then just hit d to delete. -tim Sorry, I'm begginer with VIM (under Windows XP). When I want to select a block with my mouse, I can't select column block. How can I switch to line mode to column mode?
Re: Vim Help for deleting text
Tim Chase wrote on 19/03/2007 23:01: Or, if all your columns align, you can use visual-block mode with control+V to create a block across the characters in question, and then just hit d to delete. -tim Sorry, I'm begginer with VIM (Windows XP). When I want to select a block with my mouse, I can't select column block. How can I switch to line mode to column mode? -- Reclaim Your Inbox! http://www.mozilla.org/products/thunderbird
Re: Vim Help for deleting text
Arnaud Bourree wrote on 20/03/2007 10:22: Tim Chase wrote on 19/03/2007 23:01: Or, if all your columns align, you can use visual-block mode with control+V to create a block across the characters in question, and then just hit d to delete. -tim Sorry, I'm begginer with VIM (Windows XP). When I want to select a block with my mouse, I can't select column block. How can I switch to line mode to column mode? I reply myself with help file content: Since CTRL-V is used to paste, you can't use it to start a blockwise Visual selection. You can use CTRL-Q instead. You can also use CTRL-Q in Insert mode and Command-line mode to get the old meaning of CTRL-V. But CTRL-Q doesn't work for terminals when it's used for control flow. -- Reclaim Your Inbox! http://www.mozilla.org/products/thunderbird