On 2010-10-17, tekion wrote: > All, > I have > function TrimTab() > %s/^tab//g > endfunction > > map <S-F11> :call TrimTab()<CR> > > It works when their are tabs in my file to remove, but display error > when there are no tabs. Is there a way to catch and handle the error > so I could display a friendly message? Thanks.
If you want to just ignore the error and not display a different message, just add the 'e' flag: %s/^tab//ge See :help :s_flags Regards, Gary -- 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