home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 March / PCWELT_3_2006.ISO / base / 05_common.mo / usr / share / elvis-2.2_0 / scripts / isearch.ex < prev    next >
Encoding:
Text File  |  2004-02-22  |  508 b   |  28 lines

  1. " This script defines :ilist and :isearch aliases, and some vim-compatible
  2. " maps that use them.  They search for the first usage of an identifier name
  3. " in the current file.
  4.  
  5. alias ilist {
  6. " list all lines containing a given word
  7. push
  8. !%g/\<!*\>/
  9. pop
  10. }
  11.  
  12. alias isearch {
  13. " search for a word within a range (default whole file)
  14. local l=""
  15. push
  16. !%g/\<!*\>/ {
  17.  if l == ""
  18.  then let l = current("line")
  19. }
  20. eval (l)p
  21. pop
  22. }
  23.  
  24. map [i yiw:isearch 
  25. map ]i yiw:+,$isearch 
  26. map [I yiw:ilist 
  27. map ]I yiw:+,$ilist 
  28.