Monday, August 27, 2012

Re: vim: how to substitute ^H into an delete action

Thanks Andy!
this looks a clever trick...it makes use of i_ctrl-R implementation..
looks like special charactors will be simply skipped from i_ctrl-R...


I found :@" seems to have the same (similar) issue? or not, not sure...
but I copied Ben's line into a register and tried :@", it doesn't work,
looks I have to literally input them under Ex...

Anyway as a summary, from what I tested, Ben's method:
:g//while getline('.') =~ '[^^H]^H' | s/[^^H]^H//g | endwhile

work much better. it equivalently convert ^H into a backspace action,
which is really nice, at least for me.

On 08/27/2012 12:22 PM, Andy Wokula wrote:
> :g/\b/exec "normal! 0\"rC\<C-R>r"

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: