Difference between revisions of "Editor SlickEdit"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (Brace style: added else block in the example code.)
m (Brace style)
Line 15: Line 15:
  
 
=== Brace style ===
 
=== Brace style ===
Although there is no one particular brace style that this project mandates, it generally uses '''BSD style''' throughout the code base.  The BSD style code looks like this:
+
Although there is no one particular brace style that our project mandates, we generally use '''BSD style''' throughout our code base.  The BSD style code looks like this:
  
 
   if (condition)
 
   if (condition)

Revision as of 05:09, 6 January 2007

Although not open-source nor free as in beer, SlickEdit is a powerful commercial code editor with a large number of followers. It is especially well suited for a large-scale C/C++/Java project where the number of source files easily exceeds thousands. This page aims to describe how to set up SlickEdit for optimal hacking experience of OpenOffice.org (OO.o) codebase.

Editor setup

Code format

Indentation

The OO.o project mandates 4-space indentation & use of whitespace characters for indentation for newly-submitted code. But the legacy code mostly uses tab characters for indentation. So, you need to set up SlickEdit to properly handle this format.

Go to Tools > Options > File Extension Setup..., and select the extension of c. Select the Indent tab page and set the following options:

  • Change the Indent style to Syntax indent, and set the number to 4.
  • Set the Tabs setting to +4, which sets the tab spacing to every 4 characters.
  • Uncheck the Indent with tabs check box if checked.

The c extension also covers other extensions used commonly for C/C++ sources files, such as cpp, cxx, h, hpp, and hxx, so you don't need to set these options for all of these extensions individually.

Brace style

Although there is no one particular brace style that our project mandates, we generally use BSD style throughout our code base. The BSD style code looks like this:

 if (condition)
 {
     // Do something for this condition....
 }
 else
 {
     // Do something different when the condition is not met...
 }

To set this brace style within the editor so that its various syntax expansion features set the brace(s) in the right place, go to Tools > Options > File Extension Setup..., select the c extension, click the Options button in the bottom, and set the brace style to Style 2.

Personal tools