Difference between revisions of "Editor SlickEdit"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (Indentation: added bits about hrs extension.)
m (Indentation: hrs -> hrc (typo))
Line 12: Line 12:
 
* ''Uncheck'' the '''Indent with tabs''' check box if checked.
 
* ''Uncheck'' the '''Indent with tabs''' check box if checked.
  
The '''c''' extension also covers other file extensions that are commonly used 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.  We also use another extension '''hrs''' to manage string resource identifiers.  So you should probably add this extension and have it refer to the '''c''' extension so that it is treated as a C/C++ extension (to get the syntax highlighting and symbol tagging to work correctly).
+
The '''c''' extension also covers other file extensions that are commonly used 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.  We also use another extension '''hrc''' to manage string resource identifiers.  So you should probably add this extension and have it refer to the '''c''' extension so that it is treated as a C/C++ extension (to get the syntax highlighting and symbol tagging to work correctly).
  
 
=== Brace style ===
 
=== Brace style ===

Revision as of 06:26, 8 January 2007

Although not open-source nor free as in beer, SlickEdit is a powerful commercial code editor with a built-in symbol tagging and quick code navigation features. 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 still 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 file extensions that are commonly used 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. We also use another extension hrc to manage string resource identifiers. So you should probably add this extension and have it refer to the c extension so that it is treated as a C/C++ extension (to get the syntax highlighting and symbol tagging to work correctly).

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