Vim Tips Wiki
m (Move script template out of the argument to the delete template)
(Remove delete and add todo to review status later)
Line 1: Line 1:
{{delete|Script 1062 does the same thing but better}}
 
 
 
{{review}}
 
{{review}}
 
{{TipImported
 
{{TipImported
Line 31: Line 29:
   
 
==Comments==
 
==Comments==
  +
{{Todo}}
{{script|id=1062}} does the same thing but better
 
  +
It has been suggested that [[Category_talk:Candidates_for_deletion/Archive4#Tip 950 Search multiple buffers for next match|this tip should be deleted]], mainly because it doesn't function totally satisfactorily, and the script mentioned below is superior.
  +
  +
The decision was to keep the tip for now, and to think about it again. Please add any comments here (or just improve the tip). Let's think again whether to delete it in August 2008. --[[User:JohnBeckett|JohnBeckett]] 12:46, 22 April 2008 (UTC)
  +
  +
----
 
{{script|id=1062}} does the same thing but better.
   
 
----
 
----

Revision as of 12:46, 22 April 2008

Tip 950 Printable Monobook Previous Next

created June 15, 2005 · complexity basic · author Bill Weir · version 5.7


When editing multiple files I like to have a search operation that behaves a bit like "/*" in less (to search multiple buffers looking for the next match). The Nextmatch function (below) does this, although it doesn't behave quite as I would like.

function! Nextmatch()
  let v:errmsg = "X"
  let s:x = bufnr("%")
  while v:errmsg != ""
    bnext
    if bufnr("%") == s:x
      break
    endif
    1
    let v:errmsg = ""
    silent! /
  endwhile
endfunction

Comments

 TO DO 
It has been suggested that this tip should be deleted, mainly because it doesn't function totally satisfactorily, and the script mentioned below is superior.

The decision was to keep the tip for now, and to think about it again. Please add any comments here (or just improve the tip). Let's think again whether to delete it in August 2008. --JohnBeckett 12:46, 22 April 2008 (UTC)


script#1062 does the same thing but better.