Hello, "Paul" <[email protected]> wrote:
> How would I go about making it easy for myself to select a string > matching a complex regex, such as a URL? Ideally I'd like to be able > to put my cursor into the middle of a line like > > <a href=http://vim.wikia.com/wiki/Special:Search? > search=comments&go=1>search</a> > > and type "diu" and have Vim delete just the URL. And I'd like that to > work regardless of the context where the URL is found. > > But a less perfectly streamlined solution would be fine too. > > Any suggestions? I have an "old" command that I use to select URL and other path-like strings. http://code.google.com/p/lh-vim/source/browse/misc/trunk/_vimrc_win >From this, you can define an :omap on "iu" that calls a function that is turns: 1- check the cursor is on a valid path 2- move the cursor to the beginning of the pattern 3- go into visual mode 4- move the cursor to the end of the pattern See also http://code.google.com/p/lh-vim/source/browse/cpp/trunk/plugin/omap-param.vim for complex omap definitions. HTH, -- Luc Hermitte http://lh-vim.googlecode.com/ http://hermitte.free.fr/vim/ --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
