2012/3/8 Ben Fritz <[email protected]>: > > > On Mar 8, 11:43 am, Juanjo Gomez Navarro > <[email protected]> wrote: >> Hi, I would like to create a map which removes all sort of indent >> within a selected text. I have tried this: >> >> vnoremap <BS> s/^ *// >> >> But when I select the text (with "V") and then press backspace, I get >> the whole line replaced by the text "/^*//" >> >> Any idea how to accomplish this? Thanks >> > > Add a leading colon (:) and a trailing <CR>. You are trying to use > an :ex command in visual mode with your mapping. So what you're > actually doing is: > > s - delete all text and enter insert mode > /^ *// - inserted as if typed > > What you want to do is: > > : - enter command-line mode, automatically inserting range equal to > the current visual selection ('<,'>) > s/^ *// - enter this command as if typed (a substitute command) > <CR> - run the command
I see. Thank you very much. -- Juanjo -- 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
