Community
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

macro for next/previous function

 
Post new topic   Reply to topic    Community Forum Index -> Tips
View previous topic :: View next topic  
Author Message
troels_kn



Joined: 28 Oct 2005
Posts: 32

PostPosted: Sun May 20, 2007 6:30 pm    Post subject: macro for next/previous function Reply with quote

I'm mainly using Textpad for writing PHP, and I have found the following macro quite useful. It simply jumps to the next function in the file (And its counterpart jumps to the previous function). It's a quick way to navigate in large files:

To implement it:

Start with a file, where there is a function defined, somewhere below your cursor. For example:
Code:

<?php
// place cursor here
  function foobar() {
  }


(begin macro)
Press 'End'
From the menu select: Search > Find
[X] Regular expressions
Directions: Down
Find what: function[[:space:]]+[[:alnum:]_]+[[:space:]]?(
Press 'Find Next'
Press 'Close'
Press 'Home'
Press 'Home'
(stop macro)

For the opposite (find previous function), repeat the above, but switch the 'Directions' option in the search dialogue to 'Up', and don't press 'End' in the beginning.

I have these macros bound to Ctrl+Down and Ctrl+Up.

Enjoy.

PS.: I reckon that these macros should work with any C-like language (Including C, C++ and Java)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Community Forum Index -> Tips All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB