Page MenuHomePhabricator

ECoding / Scite
Updated 1,927 Days AgoPublic

NOTE: UPDATE-ME, This is just a STUB take from old page, needs improving. See Ecoding before using SciTE.

SciTE is a very powerful editor, and with some small arrangements you can make it even more useful for your coding sessions with the EFL, adding autocomplete and calltip (with the help on the parameters of functions) and syntax highlighting.

C source code

Indentation

NOTE: UPDATE-ME, EFL-Coding Style is more than just indent=3. See Ecoding

Here's a brief list of indentation setting:

#set the indentation level at 3 spaces
indent.size=3
#strips trailing white spaces while saving 
strip.trailing.spaces=1

Autocomplete and calltips

Scite provides two kinds of autocomplete feature, one that, after pressing Ctrl+Enter, shows a list of words (found in the current file) that start with the character(s) before the cursor, and one based on a file named "API file". Once you set one or more API files, the keybinding Ctrl+Enter work in the same way, while the keybinding Ctrl+I show a list of words found in the file API starting with the characters before the cursor. Moreover, after typed the "(" character the calltip appears, showing a help for the function; the calltip can be invoked by placing the cursor inside the characters "(" and ")" that follows a function call and pressing Ctrl+Shift+Space.

Syntax highlight

Scite provides a basic syntax highlight for C/C++ keywords using the "keywordclass.cpp" variable in cpp.properties file, and sets "keywords2.$(file.patterns.cpp)" for user-defined keywords, and "keywords3.$(file.patterns.cpp)" for Doxygen keywords; the visual styles are set by "style.cpp.16" for keywords2 and "style.cpp.17" for keywords3. The highlight for EFL keywords can be done adding a words list to "keywords4.$(file.patterns.cpp)", and setting up visual style by "style.cpp.19".

How to build API files and keywords list

In order to build your API file you need ctags and tags2api.py; you also need api2func.py if you want to generate a keywords list for syntax highlight. Here's the sequence to build a tag file for each E library:

ctags -f imlib2.tags --excmd=number --c-types=pcdgstue /opt/e17/include/Imlib2.h
ctags -f eet.tags --excmd=number --c-types=pcdgstue /opt/e17/include/Eet.h
ctags -f evas.tags --excmd=number --c-types=pcdgstue /opt/e17/include/Evas*
ctags -f ecore.tags --excmd=number --c-types=pcdgstue /opt/e17/include/Ecore*
ctags -f edje.tags --excmd=number --c-types=pcdgstue /opt/e17/include/Edje*
ctags -f embryo.tags --excmd=number --c-types=pcdgstue /opt/e17/include/Embryo.h
ctags -f epsilon.tags --excmd=number --c-types=pcdgstue /opt/e17/include/Epsilon*
ctags -f ewl.tags --excmd=number --c-types=pcdgstue /opt/e17/include/ewl/*.h
ctags -f etk.tags --excmd=number --c-types=pcdgstue /opt/e17/include/Etk_Engine_Ecore_Evas* /opt/e17/include/etk/*.h
ctags -f emotion.tags --excmd=number --c-types=pcdgstue /opt/e17/include/Emotion.h
ctags -f engrave.tags --excmd=number --c-types=pcdgstue /opt/e17/include/engrave/*.h
ctags -f efreet.tags --excmd=number --c-types=pcdgstue /opt/e17/include/efreet/*.h

Here's an example to build a API file for ETK:

python tags2api.py etk.tags > etk.api

Having API files, you can copy them into a folder of your choice (to keep my system clean I chose a .scite/api folder tree on my homedir)

And here's an example to build a keyword list for highlight:

python api2func.py etk.api > etk_func.txt

Now we are ready to configure Scite to use API and keywords. Scite provides four properties file used to change settings:

  1. SciTE.properties: present in the same directory as the file being edited;
  2. SciTEDirectory.properties: present in the same or in a parent directory as the file being edited (not enabled by default);
  3. ~/.SciTEUser.properties: present in your homedir;
  4. SciTEGlobal.properties: present in system-wide place (Ubuntu -> /usr/share/scite)

Settings in SciTE.properties overrides those in SciTEDirectory.properties which overrrides those in .SciTEUser.properties which overrides those in SciTEGlobal.properties: you really have the full control of your editor! Using eet's source tree as example, you can have a "SciTE.properties" into libs/eet/src/lib that contains:

  1. Use Eet API file api.*.c=$(SciteUserHome)/.scite/api/eet.api
  2. Eet keywords keywords4.$(file.patterns.cpp)= eet_open eet_close < others here >

About keywords, you have to copy the content of eet_func.txt (build before) after "keywords4.$(file.patterns.cpp)=". In this way, you can use only Eet coding stuffs if you're editing a source file into libs/eet/src/lib. To change other settings like fonts, visual styles, or other non project-specific settings you can edit .SciTEUser.properties instead of SciTEGlobal.properties, to avoid to overwrite SciTEGlobal.properties if you upgrade your Scite installation.

EDC (Edje) source code

TODO

Imported from https://trac.enlightenment.org/e/wiki/ECoding/SciTE
History:
1 barbieri 2010-11-10 12:06:36

Last Author
beber
Last Edited
Sep 4 2013, 5:11 AM
Projects
None
Subscribers
None