Franšais

OpenCTags is an add-on for simple code editors as Crimson Editor, EditPlus, UltraEdit or (new) Notepad++.

NEW - OpenCTags for Notepad++ released 

OpenCTags will help you when you write code in big projects and you need a quick reference to keywords (classes, variables, structures, #define) in your project. It may be used as an autocomplete feature or to navigate throw your sources to reach the definition of your keyword. It keeps navigation history so you can easily go back and forth throw your code

It relies on ctags files to find keywords.


Requirements:

-
Microsoft Winsows as operating system.
-
A code editor like Crimson Editor, EditPlus, UltraEdit or Notepad++. I will adapt it on other editors, as soon as you will let me know your wish. Any editor that have an user tools facility may be used.
-
You will need Exuberant CTags to generate a tags file.

Installation instructions for Notepad++:

Download and install Exuberant CTags if you are not already using it. Copy the ctags.exe file to plugins directory of Notepad++ installation directory (eg. C:\Program Files\Notepad++\plugins)

You will need to download and extract the OpenCTagsForNpp-binW32.zip in the plugins directory of Notepad++ installation directory.

Verify that you have in plugins directory the files ctags.exe and OpenCTagsForNpp.dll


Installation instructions for Crimson Editor, EditPlus or UltraEdit:

Download and install Exuberant CTags if you are not already using it.

You will need to download and extract the OpenCTags-binW32.zip file wherever you like.

Configuration for Notepad++:

Once you've installed OpenCTagsForNpp as described above you have to restart Notepad++ if it was running and that's all.

Configuration for Crimson Editor:

-
Choose Tools->Configure User Tools;
-
Menu Text: OpenCTags
-
Command: <<Path to OpenCTags directory>>\OpenCTags.exe
-
Argument: $(CurrWord) -e crimson -f $(FilePath) -l $(LineNum)
-
Initial dir: $(FileDir)
-
Hot key : whathever you like
-
Check the case "Close on exit" and uncheck all the others;
To navigate back or forth throw the code, same configuration with these changes :
-
Menu Text: OpenCTags Prev. (or Next)
-
Argument: -e crimson -f $(FilePath) -l $(LineNum) -a p (or n for Next)

Configuration for EditPlus:

-
Choose Tools->Configure User Tools->Add Tool;
-
Menu Text: OpenCTags
-
Command: <<Path to OpenCTags directory>>\OpenCTags.exe
-
Argument: $(CurWord) -e editplus -sel $(CurSel) -f $(FilePath) -l $(CurLine)
-
Initial directory: $(FileDir)
-
Check the case "Close window on exit" and uncheck all the others;
To navigate back or forth throw the code, same configuration with these changes :
-
Menu Text: OpenCTags Prev. (or Next)
-
Argument: -e editplus -f $(FilePath) -l $(CurLine) -a p (or n for Next)

Configuration for UltraEdit:

-
Choose Advanced->Tool Configuration
-
Command line: <<Path to OpenCTags directory>>\OpenCTags.exe -e uedit -sel %sel% -f %F -l %line%
-
Working Directory: %P
-
Menu Item Name: OpenCTags
-
Check the case Windows Program
To navigate back or forth throw the code, same configuration with these changes :
-
Menu Item Name: OpenCTags Prev. (or Next)
-
Command line: <<Path to OpenCTags directory>>\OpenCTags.exe -e uedit -f %F -l %line% -a p (or n for Next)

Using OpenCTags with Notepad++

You will remark that you'll have the OpenCTags submenu in Plugins menu. The keyboard shortcuts are:
Alt + SPACEBAR
to open a the popup window with a tag corresponding with the current word selected. You can tape the rest of the word to find a tag.
Once you have found the tag you may hit the:
- SPACEBAR to navigate to the definition of the tag;
- ENTER key to complete the tag and close the window
- ESC key to simply close the window.
Alt + P
to navigate to previous position in your code, just before you opened a tag
Alt + N
to navigate to next position in your code, if you've just gone to previous position
Alt + C
to generate or regenerate the tags file. This launches ctags.exe for you. You will be proposed to select the root of your project as the place to save the tags file, if a tags file was not found in the parent directories of the currently opened file. You may cancel the tags file generation by clicking the cancel button next to the progress bar that appears. You may work normally, while the tags file is generated.

Using OpenCTags with Crimson Editor, EditPlus or UltraEdit

If you are not used to use ctags, do as follow:

-
Open Command Prompt and go to your project directory;
-
Tape <<Path To Ctags>>\ctags.exe -R *

That's all. This must create a file named "tags" in your project directory.

That may be a good idea to configure a user tool in your preferred code editor for ctags, so you will have a handy shortcut to regenerate the tags file. For Crimson Editor that may be something like :

-
Choose Tools->Configure User Tools;
-
Menu Text: ctags
-
Command: <<Path to Exuberant CTags directory>>\ctags.exe
-
Argument: -R *
-
Initial dir: <<Your project directory>>
-
Hot key : whathever you like
-
Check the case "Capture output" and uncheck all the others;

Once you have opened a file in your editor, you will just need to press the shortcut that you may have configured for OpenCTags tool. Usually, it's Ctrl + 1. A window will open in the center of the screen. If you have selected a word in your editor or your cursor were on a word (that's works only on Crimson and EditPlus) this word will apear on the top of the window and below you will have the list of keyords that begins with this word below.

After you select desired keyword, press the TAB key for autocomplete or the SPACE key to open the file where the definition of the keyword is, at the exact location of this definition.

If you regenerate the tags file, OpenCTags will reload the tags file


Licence:

This add-on is distributed under the GNU General Public License (GPL)

For any suggestion or issue you may write to OpenCTags Forum or e-mail me : Romeo JUNCU.

SourceForge.net Logo