Author Topic: "find in project files" command?  (Read 7873 times)

sixlbs9oz

  • Junior Community Member
  • Posts: 2
  • Hero Points: 0
"find in project files" command?
« on: November 15, 2006, 09:41:56 PM »
After much searching, both in SE help and here, I can't seem to find if there is such a thing as a "find in project files" command. What I'm wanting to do is to edit my context menu (I'm on a Wintel machine, BTW) to have, in addition to the Quick Search command, a "find in current project" command for the word under the cursor.

I'm working mostly with files that are not supported with tagging, so I want to be able to do the next best thing, which is search in all the files in a project for the word under the cursor.

Currently, I select the text, copy it to the clipboard (Ctrl+C), open the Find dialog (Ctrl+F), then paste (Ctrl+V) the text into the search string box. I also click the "Files >>" button and set it up to search the project for this text ("Look in: <Project>"). This is a good many mouse gestures and keystrokes.

I don't want to set up default search options for "Look in: <Project>", however.

Any ideas how this can be done?

Thanks.

Wanderer

  • Senior Community Member
  • Posts: 557
  • Hero Points: 23
Re: "find in project files" command?
« Reply #1 on: November 15, 2006, 10:05:11 PM »
It would be helpful if there was a way to see what commands SlickEdit issued when the user does something in the GUI.  This question -- Is there a 'find in project' command?  -- is a good example.

hs2

  • Senior Community Member
  • Posts: 2763
  • Hero Points: 292
Re: "find in project files" command?
« Reply #2 on: November 15, 2006, 10:56:44 PM »
Have a look here http://community.slickedit.com/index.php?topic=171.msg613#msg613
My little macro collection attached contains a macro(s) for searching a selection / cur. word in open buffers, project, wkspace ...

Hope this is what you want.
Have fun

HS2

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: "find in project files" command?
« Reply #3 on: November 16, 2006, 02:30:21 PM »
Macro recording is a good way to get an idea of what's going on when commands are executed from the GUI.  It's great entry point into learning Slick-C macro language.  For example, recording a macro in 11.0.2 for Find in Files, <Projects> shows:
Code: [Select]
_command last_recorded_macro() name_info(','VSARG2_MARK|VSARG2_REQUIRES_EDITORCTL)
{
   _macro('R',1);
   _mffind2('''vsGetText''','''I''','''<Project>''',
            '''*.c;*.cc;*.cpp;*.cp;*.cxx;*.h;*.hh;*.hpp;*.hxx;*.inl;*.xpm''',
            '''''','96','0');
}

You can edit this macro, save it to different file, change the command name, and bind it to the menu or to key.

sixlbs9oz

  • Junior Community Member
  • Posts: 2
  • Hero Points: 0
Re: "find in project files" command?
« Reply #4 on: November 16, 2006, 02:46:36 PM »
Rock on. Thanks for the help. It's interesting that I'm learning Python now for scripting in another application (Paint Shop Pro X). I do write software for a living, so it's not scary or anything, but I do DSP and write a lot of assembly, so some of the uber-coder stuff is not natural to me. I do look forward to learning more about SE macros.

Thanks again.

Joe