Please submit all suggestions and bugs via github.
Code Crusader provides a powerful UNIX development environment. Its major features are:
makeThe Project window is a convenient place to store all the files associated with a project and provides a foundation for the interface to GNU make. The tutorial provides an introduction to this interface.
Any file can be added to the project, not only a source file. To do this, use "Add files..." on the Source menu. You can also add a file that is open in a Text Editor window to a project by using the "Add to project" menu on the Tasks menu in the Text Editor window. If you select a file in the project before using "Add files..." or "Add to project", the new files will be inserted after the selection. If you select a group, the new files will be appended to the group.
When you select the files, you can also choose the type of path information to store. The default is relative to the project file's path, which makes it easy to transfer the project's directory structure to a different location or even a different machine. Once a file has been added to the project, its path can be changed by holding down the Meta key and double clicking on the file with the left mouse button. You can then either change the name directly or click on the button to use the Choose File dialog.
To open a file from the Project window, double click with the left button. To open the complement file of a C/C++ source or header file, double click with the middle button. If you have selected multiple files, you can either use the items on the Source menu or the shortcuts Return or Ctrl-Tab. These are the same bindings as in the inheritance trees.
If you add a library to the project and then try to open it, you will be asked to find the project file corresponding to the library. This makes it easy to open sub-projects from the main project window. These sub-projects are automatically built before building the main project. You can change the project file for the library and other options via the "Edit sub-project configuration" item on the Source menu. Each sub-project will be built using the command specified in its own Project Configuration dialog.
As with all lists in Code Crusader, to find a group or a file that is visible, simply type the first few letters of its name.
Groups are used to collect related files and hide them when you are not working on them. To rearrange files or groups, simply select them and drag them to where you want them to be. You can also drag them to other windows that support the XDND protocol, like the multi-file search list in the Search Text dialog. If you drag a group, it is like dragging all the files in that group.
To change the name of a group, simply double click on it.
To open or close a group, click on the triangle to the left of the name. You can also use the following key shortcuts:
The Shift modifier also works when clicking on the triangle.
make Code Crusader allows you to maintain and use your own Makefile if you wish to do so. However, it is usually preferable to let Code Crusader build the Makefile for you. You have the choice of using either makemake, CMake, or qmake. The basic steps are the same for either one:
The tutorial provides a step-by-step introduction to this procedure when using makemake. Once you understand this, you should study the help section on compiling.
The Config button in the upper right corner of the Project window opens the Make.header file (for makemake), the CMake.header (for CMake), the QMake.header file (for qmake), or the Makefile (for the manual option).
As mentioned above, you can add libraries to the project. (static or shared, as specified in the Edit File Types dialog) When using makemake, these will be included in Make.files as dependencies. Unfortunately, make is not powerful enough to recognize .so.<vers>, so Code Crusader doesn't recognize it either. To get a pure .so file, either create a symbolic link or place the version number in front of the .so suffix. (The latter is preferred because then there is never any confusion at link time.)
Note that the directories that you specify in the Search Paths dialog are not passed to the compiler because every compiler has a different way of handling this. If you are using makemake, you have to edit Make.header to modify SEARCHDIRS. If you are using CMake, you have to edit CMake.header to modify the INCLUDE_DIRECTORIES() command. If you are using qmake, you have to edit QMake.header to modify INCLUDEPATH.
Notes on CMake
If you want to use the platform specification features of CMake, then you must invoke them by hand in CMake.header. Define a variable (e.g., MY_OS_FILES) within an IF ... ELSE ... ENDIF block and add this variable (e.g., ${MY_OS_FILES}) in the "Expression to append to list of dependencies" in the Project Configuration dialog.
Notes on qmake
Since qmake requires a list of both source and header files, Code Crusader attempts to build the list of header files automatically. However, only header files that directly correspond to source files in the project will be included. If you have additional header files, or if you place your header files in a different directory than your source files, you will have to explicitly add these header files to the project if you want them to be included in the .pro file.
If you want to use the platform specification features of qmake, then you must invoke them by hand in QMake.header. Use -= to remove files from the list and += to add files to the list.
Since qmake is a generic utility, the default configuration in QMake.header does not include anything specific to Qt. If you want to use qmake to build Qt programs, you need to add qt to the line that begins with CONFIG.
The following options can be changed in the Project Configuration dialog:
make allows: evaluate variables, invoke functions, etc. This is useful for conditional or variable dependencies.The following options can be changed in the Project Preferences dialog:
You can use the "External editors..." item on the Preferences menu to set which text and binary editors to use when displaying files. For the text editor, the common choices are:
emacsclient $f emacsclient +$l $f M-x server-start from within emacs)xterm -title "$f" -e vi $f xterm -title "$f" -e vi +$l $fhexl-find-file command.xterm -title "$f" -e vi $fIf a character is preceded by a backslash, the backslash is removed and any special meaning is ignored. Thus, use \$ to get a dollar character and \\ to get a backslash character.
The advantages of using the built-in text editor are explained in the Text Editor help section.
This tutorial will walk you through the steps required to create and run the famous Hello World program in C++ using the GNU C++ compiler. The basic steps are the same for other compilers and languages. Refer to the end of this tutorial for notes on other languages.
hello_world.jccThis creates the project file hello_world.jcc along with the text files Make.header and Make.files. You will learn how to edit Make.header later in this tutorial. Make.files will be automatically rewritten for you based on the contents of the Project window. These two files will be used by makemake to create Makefile which will in turn be used to compile your program.
hello_world.Since this is a C++ project, you need to link the standard C++ library to your program:
-lstdc++ in front of -lm on the line that begins with LOADLIBES.You need to learn at least the basics of GNU make in order to fully understand the contents of Make.header. You do not have to do this in order to complete this tutorial, however.
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
cout << "Hello world!" << endl;
return 0;
}
hello_world.ccargc is the number of command line arguments. argv contains the command line arguments, starting with argv[0] which is the name of the program. The return value is used by shell scripts to determine success or failure. Returning zero indicates success.
Notice that once you saved file, context-sensitive highlighting became active and the Functions menu appeared in the menu bar. This is because the suffix ".cc" tagged it as a C++ source file.
The first window shows the result of compiling and linking your program. The second window shows the result of running your program.
Now that the project has been built, the Symbol Browser window will display the reference to your function, main(). If you double-click on the function name, Code Crusader will open the source file to display the function.
When you add functions, classes, static variables, preprocessor defintions, etc. to your program, these will all show up in the Symbol Browser window once you either build the project or use the "Update" item on the Symbol menu. Note that function declarations (prototypes) are displayed in italics to distinguish them from function definitions.
Now that you have successfully compiled and run a simple project, the possibilities are endless. This can be both a blessing and a curse.
The following sub-sections discuss how to create libraries and projects for other languages. Once you have read this information, we suggest that you study the full on-line documentation for working with Code Crusader projects.
O'Reilly publishes books on a wide variety of programming languages. These cover both general programming practices and philosophy and specific issues for C/C++ programmers.You can learn more about make either by reading books published by O'Reilly, such as Programming with GNU software and Managing projects with make, or by studying the on-line documentation for GNU make.
The documentation for makemake is included in this on-line help.
Each project must be placed in a separate directory to prevent the Makefiles from interfering with each other.
The simplest way to manage the source code for a project is to put all the files in a subdirectory of the project directory and then use groups in the Project window to organize the files. However, since organization is largely a personal preference, Code Crusader does not place any restrictions on the arrangement of the source files in a project.
To build a library instead of a program, all the steps are the same except:
libMyProject.a for a static library or libMyProject.so for a shared library. You could build both at the same time by entering libMyProject.a,libMyProject.so. ("MyProject" should be replaced with the name of your project. The "lib" prefix is a standard which allows others to link to your library by specifying -lMyProject in the link command.)-fPIC to the line that begins with CPPFLAGS. This tells the compiler to generate "position independent code." For other compilers, please consult the relevant documentation to determine the name of the appropriate option.Any language that compiles to .o files can be used when writing a library: C, C++, FORTRAN, Assembly, etc. You can even mix them together, i.e., write one source file in C, another in Assembly, etc.
If you use Java, all the steps are the same except:
HelloWorld.
public class HelloWorld
{
public static void main(String[] args)
{
System.out.println("Hello world!");
}
}
In addition, you should save the file as HelloWorld.java
In general, you need to change the Run task to either appletviewer my_java_applet.html or java my_java_program, depending on whether you are writing an applet or a program.
If you use FORTRAN, all the steps are the same except:
program helloworld write(6,*) "Hello world!" end
In addition, you should save the file as hello_world.f
Often, one requires multiple versions of a single program. The most common example is Debug and Release versions. The easiest way to do this is to let Code Crusader build the Debug version and then create a separate Release build target in the Makefile that builds the Debug version and then runs strip:
.PHONY: release release: my_program @cp my_program my_program_release @strip my_program_release
A more sophisticated method is described here. This method is useful if one must build the release version with a higher compiler optimization level than the debug version, or if one wants only the shared version of a library to be compiled with position independent code.
The "Save as template..." item on the File menu in the Project window lets you create a template from the current project. It will save all the project settings, including Make.files, Make.header, CMake.header, QMake.header, .pro file, Makefile, the search paths, the Tasks menu, and the C preprocessor configuration. It will also save the contents of all the files in the project that are in the project directory or in directories below the project directory. (i.e. files that are specified as ./something) These files will be recreated automatically when the project template is used. When creating a template, you can add other files to the project window as well, but it usually only makes sense to include files relative to the root directory (/) since these will always be there.
Project templates must be stored in ~/.jxcb/project_templates/. When you create a template, the Save File dialog will automatically display this directory. When creating a project, Code Crusader will automatically let you choose a template from this directory, if the directory exists.
If you want a particular template to be available to all Code Crusader users, place it in /usr/lib/jxcb/project_templates/. When creating a project, Code Crusader will automatically include templates in this directory in the menu of available project templates.
There are actually two different types of files that can be placed in the Code Crusader project template directory. The first is the type discussed above. The second type is a wizard interface. A wizard is a program that will create a customized project after asking you for the relevant information. The format of a wizard interface file is:
jx_browser_project_wizard 0 command to run the wizard program
The zero on the second line is the version number. The command on the third line can run an arbitrary program, but it must be a single command, not a sequence of commands separated by semicolons. (For this case, use a separate shell script.) In the command, $path will be replaced by the directory in which the user wants to create the project, and $name will be replaced by the name of the project.
The wizard must notify Code Crusader when it is finished by invoking Code Crusader (jcc) with the full path and name of the project file that has been created. (i.e. just as if the user had requested to open the project via the command line) If an error occurs in the wizard, it is the wizard's responsibility to report it.
The "Save as template..." item on the File menu in the Text Editor window lets you create a template from the text in the window. You can use the template by selecting the "New text file from template..." item from the File menu in any window. This creates a new Text Editor window containing the template's text. You can then use Search & Replace and macros to fill in the template.
Text file templates must be stored in ~/.jxcb/text_templates/. As with project templates, Code Crusader automatically displays this directory when you create or wish to use a text file template.
Development environments on the Macintosh (e.g. Metrowerks) and on Windows (e.g. Visual C++) hide the process of compiling the source files and building the finished program. They are able to do this because the project manager, compiler, and linker are all integrated into one system.
On UNIX, however, the compiler and linker are separate programs, and different people and different platforms (e.g. Linux vs Solaris) prefer to use different compilers and linkers. Thus, while Code Crusader and makemake do hide most of the work done by a project manager, they do not hide the details of dealing with the compiler and linker.
If a C program is contained entirely within one source file and does not require any header files other than those in /usr/include, one can compile and link it with the following command:
gcc -o program_name source_file.c
A C++ program that is contained within one source file can be compiled and linked with:
g++ -o program_name source_file.cc
If you have GNU's version of make, you can use:
make source_file
in place of either of the above commands.
For a program that is spread across more than one source file, you need to learn how to use either makemake and GNU's version of make or cmake. makemake is included as part of the Code Crusader package. You can learn more about make either by reading books published by O'Reilly, such as Programming with GNU software and Managing projects with make, or by studying the on-line documentation for GNU make.
In order to compile anything, you must first create or open a project. You can create a new project by using the "New project..." item on the File menu. The tutorial walks you through the basics of creating a project and compiling and running a very simple program. Once you have mastered these basics, you can get as fancy as you want by adding build targets to Make.header and defining your own tasks on the Tasks menu.
The basic tasks for compiling a program are automatically included on the Tasks menu. These are:
The command to build a Makefile for the project is specified in the Project Configuration dialog.
The output of the compile process is displayed in an editor window, so you can use Control-double-click to open a file (line numbers are also parsed, e.g. /usr/include/stdio.h:35) and also edit and save the output.
While the compile process is running, you can pause it by pressing the Pause button in the upper right corner or by pressing Control-Z, just like on the command line. You can stop it by pressing the Stop button in the upper right corner or by pressing Control-C (as on the command line) or Meta-period (for Macintosh fans). You can use the key shortcuts even when the window is iconified. (Note that, while the window is iconified, the *** in the window title tells you that the compile is running. If errors are found, this changes to !!!.)
If the compiler reports errors, the Errors menu in the Compiler Output window will become active. This lets you jump from one error to the next. For convenience, if you haven't already started looking at the errors, the first error is hilighted when the process finishes. You can examine the errors before the compile finishes because the Errors menu becomes active as soon as the first error is detected. To open the file containing an error, you can either Control-double-click on the file name or use "Open selection to error" on the Errors menu.
When the compile is finished and errors have occurred, the window will be de-iconized if it is iconized but will not be raised otherwise. This allows users who prefer a single virtual screen to be notified by having the window de-iconize and allows users who prefer multiple virtual screens to avoid having the window appear on their current screen by leaving it de-iconized on another virtual screen.
In order to run anything, you must first create or open a project. You can create a new project by using the "New project..." item on the File menu. The tutorial walks you through the basics of creating a project and compiling and running a very simple program. Once you have mastered these basics, you can get as fancy as you want by defining your own tasks on the Tasks menu to run or debug your program with different sets of command line arguments.
The basic tasks for running and debugging a program are automatically included on the Tasks menu. These are:
Code Medic is the default debugger. You can change this by editing the Tasks menu. Please note that other debuggers may not provide the same features, e.g., setting a breakpoint when the debugger is already running.
For your convenience, the following tasks are also provided by default:
While your program is running, you can pause it by pressing the Pause button in the upper right corner or by pressing Control-Z, just like on the command line. You can stop your program by pressing the Stop button in the upper right corner or by pressing Control-C (as on the command line) or Meta-period (for Macintosh fans). If your program refuses to respond to the Stop button, you can kill your program by pressing the Kill button in the upper right corner. You can use the key shortcuts even when the window is iconified. (Note that, while the window is iconified, the *** in the window title tells you whether or not the program is running.)
The input field at the bottom of the window lets you send text to the running process. Simply type the text and press Return. The EOF button sends end-of-file to the process. You can also use Control-D, as on the command line.
If you run your program in an Editor window, and the program terminates abnormally, Code Crusader will beep and display the reason in the Editor window.
If you run your program in a debugger, you must remember that if you have modified the source file, then the line numbers in Code Crusader will not match those used by the debugger, and confusion will ensue. A good strategy is to never save your source files until you are ready to compile again. With this method, you will never forget which files have been modified. You can view the version of the source code that was compiled into the binary by opening the source file in the debugger.
If you have Universal ctags on your execution path, the symbol browser will display a list of all the symbols in all the source files in the project and on the project's search paths.
The Symbol Browser is primarily intended to work behind the scenes because it is simply an alphabetized list of all symbols that have been defined. The real power of the Symbol Browser lies in its connection to the Text Editor. When you Meta-double-click on a symbol in a Text Editor window, Code Crusader searches the list of symbols:
Code Crusader also attempts to narrow down the appropriate choices by using context. If the name of the source file displayed in the Text Editor window matches a known class name, only symbols defined by this class and its ancestors will be considered. Since this is sometimes inappropriate, you can use Meta-Shift-double-click to avoid context sensitivity.
To locate a particular symbol, press the space bar and then type the first few letters in its name. This search is case-insensitive. To open the file to show the symbol's definition, press Return or double-click it. You do not have to de-iconify the window before typing.
Since both a function's declaration and its definition are included in the list of symbols, the declaration is italicized so you can tell the difference.
If a symbol is defined within a namespace (i.e. not at global scope), both the fully qualified version and the unqualified version will be displayed in the list, though at very different positions since the symbols are alphabetized. If a symbol is defined in more than one namespace, incremental search by typing will find the unqualified version (unless you type the entire namespace, too). To display a list of the fully qualified versions so you can choose the one you want, hold down the Meta key and double click on the unqualified symbol name, just like in the Text Editor window (see above).
This window is available via the "Show file list" item on the Project menu in all the windows related to a project. It displays every file on the project's search paths that matches a suffix type from the list of types in the File Types dialog.
To find a particular file in the list, simply type the first few characters of its name.
To display a subset of the files, you can use either a wildcard filter, which works just like file globbing on the command line (i.e., ? for a single unknown character, and * for more than one unknown character), or a regular expression.
To display a file in a file manager, use the "Show selected files in file manager" item on the List menu. The command that is used is determined by the "File manager preferences..." item on the Preferences menu.
The tree displays the inheritance relationships between the C++ classes that are found by parsing header files. Green indicates public inheritance, yellow is protected inheritance, and red is private inheritance. For the primary parent, black is used to indicate public inheritance to avoid too many distracting colors and make the protected and private inheritances stand out more.
Classes that are declared with "class" are drawn with black text. Classes that are declared as "struct" or "enum" are drawn with gray text. The names of classes that declare pure virtual functions are italicized.
If the parent of a class is not found in any of the files that are parsed, a "ghost" class is created to indicate this. Ghost classes are drawn with a gray background.
To add classes to the tree, use the "Add classes..." item on the Tree menu. (Classes in the Project window are always included in the tree.) To update the current tree without quitting, use the "Update" item. The "Edit file types..." item lets you set the suffixes for source and header files. It is a good idea to add all the directories that contain source or header files, not just those that contain classes. This way, when Code Crusader searches for a file (e.g. when you use "Open selection" in a Text Editor window), it is more likely to find it. (Note that /usr/include is always searched.)
To locate a particular class, press the space bar and then type the first few letters in its name. This search is case-insensitive and ignores the namespaces. To then open the source file, press Return. To open the header file, press Ctrl-Tab. You do not have to de-iconify the window before typing.
To display a list of all the functions implemented by a class, right-double-click the name or first select the name and then select "Open function list" from the Tree menu.
To locate all classes that implement a particular function, select "Find function" from the Tree menu and then enter the name of the function to search for. This is case sensitive. If a single function is found, its definition will automatically be displayed.
If you click on a class in the Tree window:
There are also several shortcuts in the built-in editor that connect back to the tree.
See the Tree Preferences section.
Code Crusader can never automatically know which preprocessor symbols that are defined at compile time. In order to parse header files correctly, however, it does need to know the definitions of the symbols used in your class definitions. You can specify these using the "Preprocessor macros..." item on the Preferences menu.
As an example, the ACE networking library defines classes with
class ACE_Export class_name {...}
On Windows, ACE_Export evaluates to the compiler dependent stuff required to build a DLL. On UNIX, it evaluates to nothing, so it simply disappears. Code Crusader requires that you define ACE_Export to evaluate to nothing, because otherwise the parser will not recognize it as a class definition.
This implementation is not a true preprocessor. It can handle only simple names, not full macros with arguments. This is generally sufficient because only macros in the class declaration need to be defined, and as above, they usually only need to be removed. If this is not sufficient, please contact the author.
Code Crusader can, however, replace a macro that takes arguments with a fixed string. As an example, the Qt widget library defines the macro Q_PROPERTY(...). This confuses Code Crusader's parser, but defining Q_PROPERTY() to be replaced by nothing (i.e. removed) is sufficient to allow Code Crusader to parse the rest of the file.
The tree displays the inheritance relationships between the D classes and interfaces that are found by parsing source files.
The names of interfaces are italicized.
If a class or interface is referenced but never defined in any of the files that are parsed, a "ghost" is created to indicate this. Ghosts are drawn with a gray background.
To add classes and interfaces to the tree, use the "Add classes..." item on the Tree menu. (Classes and interfaces in project files are always included in the tree.) To update the current tree without quitting, use the "Update" item. The "Edit file types..." item lets you set the suffixes for source files.
To locate a particular class or interface, press the space bar and then type the first few letters in its name. This search is case-insensitive and ignores the namespaces. To then open the source file, press Return. You do not have to de-iconify the window before typing.
To display a list of all the members in a class or functions in an interface, right-double-click the name or first select the name and then select "Open function list" from the Tree menu.
To locate all classes and interfaces that include a particular function, select "Find function" from the Tree menu and then enter the name of the function to search for. This is case sensitive. If a single function is found, its definition will automatically be displayed.
If you click on a class or interface in the Tree window:
There are also several shortcuts in the built-in editor that connect back to the tree.
See the Tree Preferences section.
The tree displays the composition relationships between the Go structs and interfaces that are found by parsing source files.
The names of interfaces are italicized. If an interface or struct is not exported, its name will be gray.
If a struct or interface is referenced but never defined in any of the files that are parsed, a "ghost" is created to indicate this. Ghosts are drawn with a gray background.
To add structs and interfaces to the tree, use the "Add structs/interfaces..." item on the Tree menu. (Structs and interfaces in project files are always included in the tree.) To update the current tree without quitting, use the "Update" item. The "Edit file types..." item lets you set the suffixes for source files.
To locate a particular struct or interface, press the space bar and then type the first few letters in its name. This search is case-insensitive and ignores the namespaces. To then open the source file, press Return. You do not have to de-iconify the window before typing.
To display a list of all the members in a struct or functions in an interface, right-double-click the name or first select the name and then select "Open function list" from the Tree menu.
To locate all interfaces that include a particular function, select "Find function" from the Tree menu and then enter the name of the function to search for. This is case sensitive. If a single function is found, its definition will automatically be displayed.
If you click on a struct or interface in the Tree window:
There are also several shortcuts in the built-in editor that connect back to the tree.
See the Tree Preferences section.
The tree displays the inheritance relationships between the Java classes that are found by parsing source files.
The names of interfaces, classes that are declared abstract, and classes that declare abstract functions are italicized. If an interface or class is not declared public, its name will be gray. If an interface or class is declared final, its name will be boldfaced.
If the parent of a class is not found in any of the files that are parsed, a "ghost" class is created to indicate this. Ghost classes are drawn with a gray background.
To add classes to the tree, use the "Add classes..." item on the Tree menu. (Classes in the Project window are always included in the tree.) To update the current tree without quitting, use the "Update" item. The "Edit file types..." item lets you set the suffixes for source files. It is a good idea to add all the directories that contain source files, not just those that contain classes. This way, when Code Crusader searches for a file (e.g. when you use "Open selection" in a Text Editor window), it is more likely to find it.
To locate a particular class, press the space bar and then type the first few letters in its name. This search is case-insensitive and ignores the namespaces. To then open the source file, press Return. You do not have to de-iconify the window before typing.
To display a list of all the functions implemented by a class, right-double-click the name or first select the name and then select "Open function list" from the Tree menu.
To locate all classes that implement a particular function, select "Find function" from the Tree menu and then enter the name of the function to search for. This is case sensitive. If a single function is found, its definition will automatically be displayed.
If you click on a class in the Tree window:
There are also several shortcuts in the built-in editor that connect back to the tree.
See the Tree Preferences section.
The tree displays the inheritance relationships between the PHP classes that are found by parsing source files.
The names of interfaces, classes that are declared abstract, and classes that declare abstract functions are italicized. If an interface or class is declared final, its name will be boldfaced.
If the parent of a class is not found in any of the files that are parsed, a "ghost" class is created to indicate this. Ghost classes are drawn with a gray background.
To add classes to the tree, use the "Add classes..." item on the Tree menu. (Classes in the Project window are always included in the tree.) To update the current tree without quitting, use the "Update" item. The "Edit file types..." item lets you set the suffixes for source files. It is a good idea to add all the directories that contain source files, not just those that contain classes. This way, when Code Crusader searches for a file (e.g. when you use "Open selection" in a Text Editor window), it is more likely to find it.
To locate a particular class, press the space bar and then type the first few letters in its name. This search is case-insensitive and ignores the namespaces. To then open the source file, press Return. You do not have to de-iconify the window before typing.
To display a list of all the functions implemented by a class, right-double-click the name or first select the name and then select "Open function list" from the Tree menu.
To locate all classes that implement a particular function, select "Find function" from the Tree menu and then enter the name of the function to search for. This is case sensitive. If a single function is found, its definition will automatically be displayed.
If you click on a class in the Tree window:
There are also several shortcuts in the built-in editor that connect back to the tree.
See the Tree Preferences section.
The following options can be changed in the Tree Preferences dialog:
The "Perform one-off task..." item allows you to execute one or more commands in an Editor window. The syntax is the same as in a terminal window, including chaining multiple commands by separating them with semicolons, except that if you want to use shell specific functions such as loops or environment variable expansion, you must explicitly invoke the shell of your choice, e.g., /bin/bash -c my_program
You can perform as many tasks as you wish simultaneously. Each time you start a new task, it either re-uses an existing, inactive window or creates a new one. Each window title contains the name of the task so you can identify each one. If you save the output of a task to a file, the window will not be re-used again.
Code Crusader provides many useful variables that you can use in your tasks to make them usable in any project or on any file:
file.c -> file)file.c -> .c)If a character is preceded by a backslash, the backslash is removed and any special meaning is ignored. Thus, use\$ to get a dollar character and \\ to get a backslash character.
If you want to perform a task on a file, and you want the task to execute in the directory that contains the file, then enter "@" as the path. This is especially useful for version control tasks.
There are many options that you can specify when performing a task:
If you find yourself performing the same task over and over again, you can use the "Save in menu" menu to add the task to the Tasks menu so you do not have to use the Perform Task dialog again.
The "Customize this menu..." item opens a dialog that lets you specify what the Tasks menu looks like and the command that each menu item executes. The top list displays the tasks that are always available, regardless of which project you have open. The bottom list displays takss that are only available when the specified project is the active one. This allows you to specify both tasks that are generic and usable with all projects (e.g., compiling) and tasks that are specific to individual projects (e.g., running a program with a particular set of command line arguments).
To edit a text item, double click on it. To change the options for a task, click in the cell to get a menu of the available options.
The menu text and menu shortcut are displayed when the menu is opened. The menu text can be anything you want. If you leave it blank, the text of the command will be displayed. The menu shortcut can include any combination of the following prefix modifiers:
If you choose a menu shortcut that is already being used for an item on another menu, then the shortcut will not appear on the Tasks menu. If you prefer that the shortcut be used on the Tasks menu instead, you can remove the original assignment by editing the menu_strings file that came as part of the Code Crusader distribution.
A bold line between rows indicates that a separator will be displayed between the corresponding items on the menu. To change this setting, click in the Options column.
To rearrange items, simply click and drag. This works both within a list and between lists. To move (rather than copy) an item from one list to the other, hold down the Meta key while you drag the item.
The command to execute, the options, and the directory are exactly the same as in the Perform Task dialog described above.
The name of the task is the name that can be used to call the task from other tasks via the & notation, e.g., the task &make_default calls the task whose name is "make_default". You cannot specify arguments when you call another task.
The command to rebuild dependencies cannot invoke subroutines with the & notation. This command is the same one displayed in the Edit Project Configuration dialog. You can manually invoke this command via the "Update Makefile" item on the Project menu in the Project window.
The Man Pages dialog lets you specify what function to look up and which section to look in. If you leave the section blank, the system will search all sections.
To search the man pages for all occurrences of the function, check the Apropos checkbox.
You can get the Man Pages dialog via the "Look up man page..." item on the Search menu in the Text Editor window and the Project menu in the Project and Symbol windows and any Class Tree window. Man pages are initially read-only.
In the Text Editor window, Meta-double-click checks the UNIX man pages if it can't find the function name in the class tree. Meta-double-click also understands the apropos format "name (#)" and automatically looks in the correct section.
The following command line options are provided so you can alias "man" to "jcc --man" and "apropos" to "jcc --apropos" whenever you are running X:
The "File types..." item on the Preferences menu lets you define how you want to deal with each text file that you open. A file can be recognized either by the file name suffix (e.g. .txt), a file name pattern (e.g. core.*), or a regular expression that matches the beginning of the file's contents. Once the file is recognized, the attributes that you specified in the table are attached to the associated Text Editor window.
If the text in the "Suffix / Regex" column begins with an up caret (^), it is interpreted as a regular expression. Otherwise, it is assumed to be a file suffix. (This usually starts with a period, but it doesn't have to.) The file's type is recalculated every time you save it, so a type based on the content will not be recognized in a brand new file until the file is saved for the first time.
Clicking in the "Type" column displays a fixed menu of choices that are linked to built-in features:
Clicking in the "Macro set" column displays a menu of all the macro sets defined in the associated dialog.
Clicking in the "Script path" column displays a menu of all the directories in /usr/lib/jxcb/scripts/ and ~/.jxcb/scripts/. Since there may be a directory with the same name in both places, they are marked as "(global)" and "(personal)", respectively. Refer to the External Scripts help section for information on how the script path is used.
Similarly, clicking in the "CPM rules" column displays a menu of all the Clean Paragraph Margins rule sets defined in the associated dialog.
Clicking in the "Word wrap" column toggles the value between Yes and No. This controls whether or not lines are wrapped if they extend beyond the right edge of the Text Editor window. Holding down the Meta key while clicking the mouse toggles the value and sets the entire column to the new value.
If the file type is External, the "Open command" column will be editable. When you use $f in this command, it will be replaced by the full path and name of the file to be opened.
Code Crusader can read UNIX, Macintosh, and DOS/Windows text files. Each file's format is indicated on the "File format" submenu on the File menu. To convert a file to a different format, simply select the desired format from this menu and then save the file.
When a file is opened, Code Crusader automatically detects the indentation method (spaces or tabs) and, if the method is "spaces," adjusts the tab width to match. If the file uses mixed indentation, whitespace is made visible. (This is especially useful when editing Makefiles, which interpret spaces and tabs differently.)
When a file name in the Windows menu is red, it means that the file has been modified and needs to be saved. This is also shown by drawing three asterisks to the left of the window title.
By default, Code Crusader follows the Macintosh clipboard model. This means that text is not automatically copied when it is selected. Instead, it is only copied when you use the "Copy" item on the Edit menu or Meta-C. The main advantage of this model is that paste can then replace the selected text. If you prefer the X clipboard model, the Preferences dialog lets you use this instead. Either way, the clipboard is persistent, so if you copy text in a Text Editor window and then close the window, you can still paste the text later on.
When Drag-And-Drop is enabled in the Text Editor Preferences dialog, you can:
xterm, add "XTerm.VT100.allowSendEvents: True" to your .Xdefaults file.)If the text will be copied when dropped, a small plus (+) will be displayed in the cursor. If the dialog will be displayed when the text is dropped, a small question mark (?) will be displayed in the cursor.
Drag-And-Drop has the disadvantage that that you cannot click and drag in the selected text to make a new selection. Some people find that this slows them down while editing.
Holding down the Meta key toggles the Drag-And-Drop setting. This allows you to get the other behavior when you need it. (Once you begin dragging, you can release the Meta key so that you can move the text. This trick also works in all text input fields.)
Drag-And-Drop can be cancelled by pressing the Escape key before releasing the mouse button.
The underlying X protocol is XDND.
The "Balance closest grouping symbols" item on the Search menu searches for the closest pair of grouping symbols ((), {}, []) that enclose either the caret or the current selection and selects the text between this pair of grouping symbols. Repeated use of this menu item expands the selection outward to the next pair.
The one special case is that, if you select a single grouping symbol, this menu item will attempt to balance that symbol instead of treating it like a normal selection.
This feature is useful when trying to check a complicated expression containing many nested pairs of parentheses. It is also useful for block indenting since it can instantly select all the text between a pair of braces.
Note that the algorithm does not use a lexer to balance the grouping symbols, so it will fail when grouping symbols are used inside character and string constants.
If you have Universal ctags on your execution path, Code Crusader will automatically display an additional menu in the menu bar listing all the functions defined in the file. When you select a function from this menu, the text scrolls to display that function's definition. In the Preferences, you can choose whether to display the function names alphabetically or in the order defined in the file. With the latter configuration, a horizontal line is drawn on the menu to indicate the location of the caret in the file. If you want to momentarily display the functions in the opposite order, hold down the Meta key while opening the menu.
The Web Browser Preferences dialog lets you specify the commands for viewing files and URL's in the browser of your choice. The default is to use Firefox:
You can use any other browser, if you can figure out the commands to execute. "$f" is replaced by the full path and file name when it is used in the command to view a file, while "$u" is replaced by the URL name when it is used in the command to view a URL. If a character is preceded by a backslash, the backslash is removed and any special meaning is ignored. Thus, use\$ to get a dollar character and \\ to get a backslash character.
Left clicking positions the insertion caret. Left clicking and dragging selects the characters that you drag across. Left double clicking selects the entire word under the cursor. If you drag instead of releasing after the second click, the selection will extend one word at a time. Left double clicking while holding down the partial word modifier (adjustable in the Preferences dialog) selects the partial word under the cursor and dragging extends the selection by one partial word at a time. Left triple clicking selects the entire line, and dragging extends the selection by a line at a time.
Holding down the Shift key while left clicking or simply right clicking extends the selection in the same way that the original selection was performed, i.e. if the original selection was one word at a time, the extended selection will also be one word at a time.
Middle clicking pastes the current contents of the clipboard at the position where you click.
If Drag-And-Drop is turned on in the Preferences, left clicking on the current selection and dragging lets you drag the selected text instead of selecting text.
Additional shortcuts:
The double click shortcuts activate when you release the mouse button, so you can select more than a single word. This is useful for strings like "std::ios".
The arrow keys move the caret around inside the text. Holding down the Control key makes the up and down arrows move the caret to the top and bottom of the visible text, respectively, while the left and right arrows move the caret by one word at a time. Control-up/down is useful for scrolling the text by one line without having to use the scrollbar: simply press Control-up/down-arrow and then up/down. It is also useful for bringing the cursor to the visible text after scrolling.
Holding down the partial word modifier key (settable in the Preferences dialog) makes the left and right arrows move the caret by one partial word at a time. As an example, this lets you move around inside both GetFileName and get_file_name.
Holding down the Meta key makes the up and down arrows move the caret to the beginning and end of the file, respectively, while the left and right arrows move the caret to the beginning and end of the current line, respectively. In addition, Meta-left-arrow is smart enough to move the caret to the beginning of the text on the line. Pressing it a second time moves the caret to the beginning of the line. (This is configurable in the preferences.)
Holding down the Shift key while using the arrow keys selects text. This works even in conjunction with the Meta, Control, and partial word modifier keys.
The backspace key on the main keyboard deletes the character to the left of the caret. The delete key on the keypad deletes the character to the right of the caret.
If automatic indentation is turned on, Shift-Return maintains the current indentation but ignores the line prefix.
Meta-comma activates the line number display so you can jump to a different line. Meta-Shift-comma activates the column number display so you can jump to a particular column on the current line. Pressing return takes you to the line or column that you have entered and returns you to the text. Pressing Shift-return in the line number display takes you to the line and activates the column number display.
This feature allows you to paste the output of an arbitrary program into an editor window.
If you right-click on selected text (or Meta-right-click if you have "Allow Drag-and-Drop" disabled in the Preferences), the resulting context menu will include a menu of all the executable scripts in the directory that you selected in the File Types dialog. (Subfolders are also displayed so you can group scripts together if you have a lot of them.) The script that you select is run with the three arguments: path to the file, name of the file, line number of the start of the selection. The selected text is fed to the script via stdin (file descriptor 0) and is replaced by the script's output (file descriptor 1).
The "Run script" item on Edit menu provides a more general interface which allows you to specify the arguments to the script. In this case, the script must be on your execution path. You do not have to select any text in this case, but if you do, it will be fed to the script via stdin (file descriptor 0). The output of the script (file descriptor 1) will either be pasted in at the current caret location or will replace the selected text.
The following strings are replaced when they are used in the "Run script" dialog:
If a character is preceded by a backslash, the backslash is removed and any special meaning is ignored. Thus, use\$ to get a dollar character and \\ to get a backslash character.
Word wrapping can be adjusted separately for each file type, so this option is in the File Types dialog.
The following options can be changed in the Text Editor Preferences dialog:
), }, or ] in a source window, the matching (, {, or [ will flash to show you where it is.), }, or ], Code Crusader will beep.Newly opened windows start in Command mode. When in Input mode, Esc switches to Command mode. The following key bindings are implemented in Command mode:
For any command that deletes, yanks, or pastes text, you can prepend a number to specify the number of items, e.g., 5x deletes five characters. You can also specify a named buffer, e.g., 5"ax deletes five characters and places them in the "a" buffer instead of the default buffer. "ap will then paste the contents of the "a" buffer.
Code Crusader has several features to protect you from accidental crashes of both the X Server and Code Crusader itself:
hello_world.c is safety saved in #hello_world.c#)assert(), every file is safety saved in a ## file. (e.g. hello_world.c is safety saved in ##hello_world.c##) The original # file is not modified because, when the program itself crashes, data may have become corrupted, so the # file may be better than the ## file.Note: When performing actions in the dialog window, the Text Editor window that will be affected is the one that was last clicked or typed in.
Enter the text for which to search in the "Search for" input area. The right "Find" button searches for the next match and selects it, while the left "Find" button searches for the previous match.
If "Ignore case" is checked, the search will not be case-sensitive. If "Wrap search" is checked, the search will wrap around if it hits the beginning or end of the text and will continue from the end or the beginning, respectively. If "Entire words only" is checked and the search text is also entire words (e.g. "hello" or "hi there", but not "this?"), the search will ignore matches that are part of other words. As an example, "and" will not match "sand".
If "Regex search (egrep)" is checked, the search text will be interpreted as a regular expression. The "Ref" button displays a short reference summary of regular expression syntax. If "Treat as single line" is checked, the regex will be allowed to match across multiple lines. Otherwise, each match will only be allowed to extend until it reaches a newline character.
Clicking on the down arrow next to the "Search for" input area displays a menu of the last 20 search patterns. Selecting one copies it to the input area.
The right "Find" button has the shortcuts Return and Meta-G. The left "Find" button has the shortcuts Shift-Return and Meta-Shift-G. The latter shortcuts are the same as in the Text Editor window.
If "Regex replace" is checked, the replace pattern will be interpreted as a regular expression. Note that the shortcut for toggling this checkbox is Meta-Shift-X, because Meta-X is the shortcut for "Regex search."
If "Preserve case" is checked, the case of the replace text will be adjusted to match that of the matched search text, when possible. This is primarily useful when performing a case-insensitive search. The rules for when the case is adjusted are as follows:
Clicking on the down arrow next to the "Replace with" input area displays a menu of the last 20 replace patterns. Selecting one copies it to the input area.
The "Replace" button has the shortcut Meta-=. The right "Replace & Find" button has the shortcut Meta-L. The left "Replace & Find" button has the shortcut Meta-Shift-L. These are the same shortcuts as in the Text Editor window.
If "Search directory" is checked, the right "Find" button will search each file that matches the wildcard filter in the specified directory. If you specify a relative path, it will be relative to the directory containing the active project, if any. If "Search all subdirectories" is checked, all subdirectories will also be searched, except those specified in the exception list. The exception list is a wildcard filter, just like the file name filter. (Symbolic links are not followed to avoid infinite loops.) If "Invert" is checked next to the wildcard filter, all files that do not match the given filter will be searched.
If "Search files" is checked, the right "Find" button will search each text file in the list.
These two "Search ..." checkboxes can be turned on at the same time. The checkboxes on the Options menu apply to both.
The output window will display each line that contains a match, underlining the text that matches. (If a file in the list is binary, it will not be searched.) The search is performed in the background, so you can continue to work. The Search Results window displays a progress indicator to show how much has been done.
As soon as each result is added to the Search window, you can open the file to see the match by Control-double-clicking on the file name or by using the Matches menu.
If you only want a list of the files that contain matches, turn on the "Only list file names" checkbox. If you want a list of the files that do not contain matches, turn on the "List files that do not match" checkbox.
If "Search files" is checked, the right "Replace all" button will search each file in the list, open the ones with matches, and replace all the matches. This provides a second way to undo the changes, in addition to the "Cancel" button in the progress window, because you can simply close a file without saving it.
This option is only available if you are using the built-in editor.
Since many programs allow you to search through text, Code Crusader has been designed to allow the search parameters to be automatically shared with other programs via the XSearch protocol. The advantage of this is that you can use the "Enter search string" menu item in one program, the "Enter replace string" menu item in a second program, and then search and replace in a third program without ever having to use the clipboard to transfer any of the text. All the other options in the Search Text dialog are also shared, so you can configure a search in one program and then use it in any other program that supports the protocol.
Keyword completion allows you to type the beginning of a word and then press Tab, Control-Space, or Control-Shift-Space to complete the word automatically. As an example, when writing C code, you could type cont and then Tab would complete it to give continue. (Macros provide the complementary functionality of automating specific, repetitive typing tasks. These are checked before keyword completion so that they can end with ordinary characters. Control-Shift-Space is provided as a trigger for keyword completion so macros can be ignored if necessary.)
You can turn off the special behavior of Tab in the Text Editor Preferences dialog. To insert a Tab character without triggering the completion mechanism, hold down the Shift key.
If the text matches more than one keyword, completion will fill in as many characters as possible. As an example, in C, r matches register, return, and reinterpret_cast, but they all start with re, so pressing Tab after r will add e. You can then type another character and press Tab again, e.g., typing t would complete the word to return.
If you press Tab and nothing is added, you can press Tab again to display a menu of all the matching completions. The first ten choices have the shortcuts 1, 2, ..., 9, 0, and the next twenty-size choices have the shortcuts a, b, ..., z, so you can avoid using the mouse most of the time. To close the menu without selecting anything, press Tab again. To insert a tab character via the menu, select the first item, which has the shortcut ` (single back quote).
The words that can be completed are the reserved keywords for the language (see below), any words that you enter into the bottom list in the corresponding dialog for context-sensitive highlighting, and all class names and methods in all open projects.
For HTML, only the names of special characters are included by default because it is a feature of HTML that there is no fixed list of tags, and the common tags are all very short. If you frequently use any long tags, simply enter them into the context-sensitive highlighting dialog. Usually, it is more convenient to create a macro for each tag because this can initialize the attributes at the same time.
Character Actions provide a way to automatically type a sequence of characters after you type a particular character. As an example, when writing C code, you could have the editor automatically type return after you type a semicolon.
Macros provide shortcuts for typing sequences of characters. A macro is activated by typing the shortcut and then pressing Tab or Control-Space. As an example, when writing C code, you could type #" and then Tab could activate the macro that converts this into #include "".
Keyword completion provides the complementary functionality of completing words regardless of how much you have already typed. This is checked after macros so that macros can end with ordinary characters.
You can turn off the special behavior of Tab in the Text Editor Preferences dialog. To insert a Tab character without triggering the macro, hold down the Shift key.
You can create sets of actions and macros in the dialog obtained from the "Macros..." item on the Preferences menu in each Text Editor window.
In this dialog, the left columns contain the action or macro, while the right columns contain the keystrokes to perform. In the right column, all characters except for backslash (\) and dollar ($) translate directly to keystrokes. Backslash indicates a special character as follows:
\n newline (return) \t tab \b backspace \f forward delete \l left arrow \r right arrow \u up arrow \d down arrow \\ backslash \$ dollar symbol
If any other character is preceded by a backslash, the backslash is simply removed.
Dollar is used to indicate a variable or a command to be executed:
To get a right parenthesis inside a command, use \). Similarly, to get a dollar symbol, use \$.
The characters typed by actions and macros do not trigger other actions or macros because it is very hard to avoid infinite loops and because it is much clearer if each keystroke script is self-contained.
For C/C++, the following macros can be useful:
*/) and puts the caret inside so you can type the text.#include "" and puts the caret between the quotes so you can type the file name.#include <> and puts the caret between the brackets so you can type the file name.For HTML, the following macros can be useful:
href) and puts the caret between the quotes so you can type the URL.For HTML, the following actions can be useful:
html-auto-close is included in the Code Crusader package.For XML, the following actions can be useful:
xml-auto-close is included in the Code Crusader package.Code Crusader provides context-sensitive highlighting for several languages.
The "... styles" items on the Preferences menu in the Text Editor windows allow you to turn highlighting on or off and to set the styles to be displayed.
The top list specifies the styles for the different types of text. As an example, the "Comment" item for C/C++ specifies how comments will be displayed in source and header files.
The bottom list specifies the styles for specific words that override the top list. As an example, if you created an item "#pragma" in the C/C++ window, then all #pragma directives would use this style instead of the style for "Preprocessor directive" in the top list. (The words in this list are also used for keyword completion.)
To change the style of an item, right-click on the item, and select from the menu that appears. To change the style of several items, select them and then right-click on any one of them. Note that fonts like 6x13 cannot be displayed in italic because there is no italic version of these fonts installed on most systems. Courier can be displayed in italic, however.
You cannot change the items in the top list, only their styles.
To add an item to the bottom list, click the "New" button. To remove items from the bottom list, select them and click the "Remove" button. To change the text of an item in the bottom list, double click on it.
#include, even though the style is applied to both the name and the arguments.div, even though the style is applied to both the name and the arguments.lt instead of <)The context-senstitive highlighting API is very simple, so it is easy to add support for other languages once a lexer is written. This cannot be linked in dynamically, however, because it does require minor changes to other parts of Code Crusader, such as the preferences file and the Preferences menus. If you are interested in adding support for another language, please submit a pull request via github.
Note that, in order to be compatible with Code Crusader, the code will have to be written in C++ and will have to use the JCore library.
When this feature is turned on in the Text Editor Preferences and you press Return, the Clean Paragraph Margin Rules discussed below are used to determine the current line's prefix. This prefix is then used to compute the prefix of the newly created line.
To copy only the whitespace, hold down the Shift key while pressing Return.
The "Clean paragraph margins" item on the Edit menu inserts and removes newlines in the paragraph that contains the caret so that no line exceeds the width set in the Text Editor Preferences. (default: 75)
A paragraph is defined as a sequence of non-empty lines that have the same prefix. A line is empty if it has no characters or only prefix characters.
If there is a selection, the item reads "Clean margins for selection" instead and performs the above operation on each paragraph touched by the selection.
The "Coerce paragraph margins" item defines a paragraph as a sequence of non-empty lines, even if the prefixes are different. This is useful if you want to force a change in the prefix, because you only have to change the prefix of the first line by hand.
The "Clean paragraph margins rules..." item on the Preferences menu in the Text Editor windows lets you define what a paragraph prefix is. You can define as many different sets of rules as you wish, and you can share them with others by using the "Load" and "Save" buttons. The File Type dialog lets you choose which set of rules to use for each file.
Each rule has three parts:
The rule for treating only whitespace as a prefix is built in, so you only have to specify rules for other patterns. You also do not need to use the up caret (^) anchor to specify that the match must occur at the beginning of the line because Code Crusader does this automatically.
A simple example is the single rule required for email:
The First and Rest patterns are the same because all lines begin with some mix of brackets (>) and spaces. The Replace pattern simply says to use the first line's prefix on all the following lines. "Clean paragraph margins" will therefore collect consecutive lines that begin with exactly the same pattern of brackets and spaces and rearrange the words to fit within the line width constraint set in the Text Editor Preferences. "Coerce paragraph margins" will first collect consecutive lines that begin with any pattern of brackets and spaces and will then change the prefix of each line to match the prefix of the first line before rearranging the words to fit within the line width constraint. Both will stop collecting if they find a line that contains nothing but brackets and spaces, because this is recognized as an empty line.
Here is an example:
Original text:
|---------------| > This sentence does not > fit on one >>line.
"Clean paragraph margins" result:
"Coerce paragraph margins" result:|---------------| > This sentence > does not fit > on one >>line.
|---------------| > This sentence > does not fit > on one line.
A more complicated example is the two rules required for multiline C comments:
The first rule specifies that the prefix of the first line is /* followed by more asterisks and spaces. Following lines start with spaces and asterisks, like this:
/* This C comment * spans two lines. */
The Rest pattern includes the possibility of a slash following the last asterisk in order to treat the line with */ as empty and force the collecting to stop.
The second rule specifies that one can also have a paragraph where all the prefixes are spaces and asterisks, like this:
/* This is the first line. * * This is a paragraph * within a C comment. */
Note the Rest pattern again includes the possibility of */, for the same reason.
Whenever you specify a rule where the first line's prefix is different from the rest, you must include a second rule which matches only the first rule's Rest pattern.
This not only allows sub-paragraphs, as in the C comment above, but it is also required by the algorithm that Code Crusader uses to find paragraph boundaries.
The "Compare files" dialog lets you compare files in various ways:
Once the results are displayed, you can quickly find the differences by using the Differences menu. If you change one of the files or revisions, you can recalculate the differences via the "Redo diff" button.
The Normal tab lets you specify which two files to compare and the styles used to indicate the differences between them. Text that is only in the first file is displayed using the top Style menu, and text that is only in the second file is displayed using the bottom Style menu. Text that is common to both files is displayed using the "Shared text style" menu.
You can select files graphically by clicking the Choose buttons or by dropping files on the input fields via Drag-and-Drop.
A command line option is provided so you can alias "diff" to "jcc --diff" whenever you are running X. This normally requires two files. If you only specify one file, it assumes you want to compare file~ and file, unless the file name begins with #, in which case it assumes you want to compare it with the original. If you specify a file and a directory, it assumes that you want to use the file with the same name in the second directory.
The CVS, Subversion, and Git tabs let you specify the file and the revisions to be compared. The revisions work exactly the same as the corresponding command line interface. If the first revisions is "Current", the second revisions must be "Edited." If you select "Date" from either revision menu, CVS and Git accept any format, but Subversion requires YYYY-MM-DD.
If you enter a directory instead of a file, the raw output from the command line interface will be displayed in a window. Turning on the "Summary" option produces a summarized output. You can select a directory by holding down the Meta key and clicking on the Choose button.
You can get the File Differences dialog via the "Compare files..." item on the Search menu in the Text Editor window and the Project menu in the Project and Symbol windows and any Class Tree window.
You can also compare files by using the "Compare selected files with backup" item on the Source menu in the Project window and the smart compare item on the File menu in the Text Editor window.
By default, Code Crusader follows the Macintosh clipboard model. This means that text is not automatically copied when it is selected. Instead, it is only copied when you use the "Copy" item on the Edit menu or Meta-C. (Meta-C works in any input area, regardless of whether or not the window contains an Edit menu.) The main advantage of this model is that paste can then replace the selected text. If you prefer the X clipboard model, the Text Editor Preferences dialog lets you use this instead.
On PC's, Meta is normally bound to the Alt key on the keyboard. Your system's configuration may be different, however. You can use "xmodmap" to examine and change this configuration.
Drag-And-Drop can be cancelled by pressing the Escape key before releasing the mouse button.
Tab shifts focus to the next input area. Shift-Tab shifts focus to the previous input area.
To use a shortcut for a button or checkbox, hold down the Meta key and press the underlined character.
All scrollbars display increment/decrement arrow pairs if there is space. Coupled with the Shift key which makes the arrows scroll a half page at a time, this conveniently packages all the scrolling functions in one place.
Clicking the middle button in a scrollbar forces the thumb to jump to the place where you clicked.
The arrow keys scroll the tree, read-only text, and help by small steps the way the scrollbar arrows do. Meta-End and Meta-Page Up/Down scroll horizontally, just like End and Page Up/Down scroll vertically.
To save your current position so you can easily jump back to it later, hold down the Meta key and click the left mouse button on the scrollbar thumb. This creates a scrolltab. Clicking on this scrolltab scrolls to the saved location. You can place as many scrolltabs on each scrollbar as you wish.
These functions are also accessible via the menu that pops up when you right-click on the thumb or any scrolltab.
In the Project, Tree, and Text Editor windows, Control-1 through Control-9 scroll to the first through ninth vertical scrolltab, respectively.
The mouse wheel will scroll the widget that you point to:
Tab completion in the Path input field is supported, but only when the caret is at the far right of the text. (This allows Tab to be used to switch to the next input area in all other situations.) You don't actually need tab completion, however, because typing in the file list table performs an incremental search, after which you can use the following keys:
Note that Meta-up-arrow and Meta-down-arrow work even if the file list table does not have focus.
The next sub-section describes how to select multiple files in the Choose Files dialog.
Double clicking a file in the Save File dialog copies the name to the input field. This is useful if you want to replace a file or create a new file with a similar name.
The window is resizable, and always remembers its size and position.
If selecting more than one item at a time is possible in a particular list, you can do so with the following actions:
If you are editing an item in a list or a table, you can switch to a different item by using the following shortcuts:
The digits correspond to the appropriate positions on a numeric keypad.
Code Crusader's paradigm is to display information in many separate windows instead of trying to cram everything into a single window. This allows you to easily place windows side by side so you can view more than one at a time and drag information from one to the other. It also allows you to place different windows on different virtual desktops. For those who prefer to work with all their windows arranged within a single window, refer to the section on Window Docks.
You can call up any particular window by using the Windows menu. To make it easier to navigate between windows without using the Windows menu, you should consider re-configuring your window manager/desktop to use the "point to focus" method and then adding a key shortcut that raises or lower the window that has focus. This allows you to simply point to a window with the cursor and then press a key to bring that window to the front.
In addition, Code Crusader has several features that minimize the amount of effort required to deal with window placement and focus:
This is especially useful for guaranteeing that source and header windows will appear side-by-side instead of on top of each other, and that the compile and run output will be displayed unobtrusively in a corner.
Some window managers have an option that defeats Code Crusader's automatic window placement. To avoid this, you can do the following:
~/.fvwmrc~/.fvwm2rc~/.twmrcWindow managers like KDE and Gnome that provide a taskbar listing all the currently open windows allow you to filter this list based on the window's title or WM_CLASS attribute. Code Crusader sets WM_CLASS as follows:
The setting for the Compiler Output window allows you to either filter out all text windows with Code_Crusader_Editor* or filter out all other text windows with simply Code_Crusader_Editor. It is often convenient to display the Compiler Output window on the taskbar because the *** disappears when the compiler is finished.
You can choose which keys on your keyboard should map to each modifier by using xmodmap in your ~/.xinitrc file. As an example, if you have a PC keyboard with the new Windows key between Ctrl and Alt, you can change the left Windows key to produce the Mod4 modifier as follows:
xmodmap -e "clear mod4" xmodmap -e "keycode 115 = Super_L" xmodmap -e "add mod4 = Super_L"
To check which keys produce each modifier, use xmodmap -pm.
You can use xev to get the keycode for a particular key on your keyboard. Run it from a terminal window, move the cursor into the resulting window, press the key, and check the keycode value that is printed.