HOWTO configure Scite to work as an IDE under linux

Linux specific questions.
Fausti
Posts: 32
Joined: Sep 26, 2005 21:33

HOWTO configure Scite to work as an IDE under linux

Post by Fausti »

While we are still waiting for a linux version of FBIde (with all features from the latest win32 version) I think I found something to fill the gap ;)

SciTE (http://www.scintilla.org/SciTE.html)

Some nice Features:

* Syntaxhighlighter for FreeBASIC
* Autocompletion from a API definition with comments for every entry or from the current loaded source files (even without the API definition file it's really usefull)
* Compiler and Consoleoutput like in QB
* Jumping from a compiler error message to the line in code
* F5 compiles your source if necessary and starts your prog/game

After installing it (using your package manager (KPackage, Synaptics, rpm, dpkg, ...) or compiling it (I didn't need to explain that here?) we should look into the config files (you should be root or running scite with sudo):

1. Options->Open Global Options File

2. look for "open.filter=\"

3. add "$(filter.freebasic)\" (you will see what I mean)

4. look for "menu.language=\"

5. add "FreeBASIC|bas||\"

6. now, look for "#import freebasic" and uncomment this line -> "import freebasic"

7. ok, save and close this file (and restart scite)

8. Options->Edit Properties->Open freebasic.properties

9. before "# keywords must be all lowercase" we add the following:

Code: Select all

command.compile.*.bas=fbc $(FileNameExt)
command.build.*.bas=fbc $(FileNameExt)
command.go.*.bas=$(FileDir)/$(FileName)
command.go.needs.*.bas=fbc $(FileDir)/$(FileName)
10. save the file and close scite

I hope it was understandable/usefull and if someone have nice additions/corrections to these steps I would like to read them ;)
Sisophon2001
Posts: 1706
Joined: May 27, 2005 6:34
Location: Cambodia, Thailand, Lao, Ireland etc.
Contact:

Post by Sisophon2001 »

Hi Fausti

I use SciTE for both FreeBASIC and C source code under Linux, but I modified the vb syntax definitions to use FB keywords. Your description above talks about
now, look for "#import freebasic" and uncomment this line -> "import freebasic"
This to me implies that a FreeBASIC definition file is now included with the editor? That would be nice.

Looking down through your notes, I can see two differences in how we set things up. I configured the build option to look for a makefile instead, and I never used an API definition file. I set up compile and go the same as you.

I also modified the configuration files so it maximizes on startup, and displays open files in tabs.

It is a nice editor, especially for a windows refugee like me who finds some of the pre-installed Linux editors very strange.

Garvan
v1ctor
Site Admin
Posts: 3804
Joined: May 27, 2005 8:08
Location: SP / Bra[s]il
Contact:

Post by v1ctor »

Yeah, by the Scintilla changelog they added support for FB, i dunno how complete it is though, or if just the VB syntax-highlighter was adapted.
elcalen
Posts: 116
Joined: Oct 09, 2005 23:52
Location: Finland
Contact:

Post by elcalen »

Funny thing, I was looking at the FB options file, and the keyword list (in my version anyway) seems to be missing ABS through ANY (from the alphapetical list in the wiki)... Just add them to the top of the list, and you should be fine... Other than that, the keyword list looks pretty complete. I admit I didn't have a very thorough look at it though...

One little bug I noticed: if a single keyword at the beginning of a line has a colon after it, the highlighter takes it to be a label... (For example: "CLS: PRINT" etc...)

And what's with the green comments? Comments are meant to be grey. ;) And in italics. I guess I can change the colour easily enough, but what about italics? I'm just too lazy to find out myself, and still not sure whether I'll be using this or some other editor... ;)
DrV
Site Admin
Posts: 2116
Joined: May 27, 2005 18:39
Location: Midwestern USA
Contact:

Post by DrV »

Old VB hackers know that comments are meant to be green. :)
Fausti
Posts: 32
Joined: Sep 26, 2005 21:33

Post by Fausti »

Ok, open the freebasic properties and search for "style.freebasic.1", now change it to:

Code: Select all

style.freebasic.1=fore:#D3D3D3,$(font.code.comment.line),italics
And after restarting scite you should have grey, italic comments ;)

This after "keywords2.$..." remove all lines and paste this:

Code: Select all

split.vertical=0
line.margin.visible=1
line.margin.width=3+
position.width=-1

WHITE=#FFFFFF
BLACK=#000000
NAVAL=#191970
GREY=#808080
LGREY=#D3D3D3
DGREY=#696969
RED=#FF0000
YELLOW=#FFFF00
MAGENTA=#FF00FF
CYAN=#00FFFF
GREEN=#008000

caret.fore=#FFFFFF

# FB styles
# Default
style.freebasic.*=back:$(NAVAL)
style.freebasic.0=fore:$(WHITE)
# Comment
style.freebasic.1=fore:$(LGREY),$(font.code.comment.line),italics
# Number
style.freebasic.2=fore:$(MAGENTA)
# Keyword1
style.freebasic.3=fore:$(WHITE),bold
# String
style.freebasic.4=fore:$(CYAN)
# Preprocessor
style.freebasic.5=fore:$(GREEN)
# Operator
style.freebasic.6=fore:$(WHITE)
# Identifier
style.freebasic.7=fore:$(YELLOW)
# Date
# style.freebasic.8=$(colour.error)
# StringEOL
# style.freebasic.9=$(colour.error)
# Keyword2: seems to be for Freebasic preprocessors
style.freebasic.10=fore:$(GREEN)
# Keyword3
#style.freebasic.11=fore:$(RED)
# Keyword4
#style.freebasic.12=$(colour.keyword)
# Constant
# style.freebasic.13=$(colour.error)
# Asm
# style.freebasic.14=$(colour.error)
# Label
style.freebasic.15=$fore:$(YELLOW)
# Error
style.freebasic.16=fore:$(RED),back:$(YELLOW)
# HexNumber
style.freebasic.17=fore;$(MAGENTA)
# BinNumber
style.freebasic.18=fore:$(MAGENTA)

style.freebasic.32=$(font.base),back:$(NAVAL),fore:$(WHITE)
style.freebasic.33=fore:$(WHITE),back:$(GREY)
style.freebasic.34=fore:$(BLACK),back:$(WHITE),bold
style.freebasic.35=fore:$(RED),back:$(WHITE),bold

Now, it should look more familiar ;)

P.S. If the colors should look really ugly, try replacing the $(...) parts with the real colorvalue aka #RRGGBB
D.J.Peters
Posts: 8642
Joined: May 28, 2005 3:28
Contact:

Post by D.J.Peters »

What makes SciTE better than other Editor's?
I use Kate and compile my curent sources with [F5] and run the executable with [F9]
Kate can hide function/sub's and has an projektfile ("*.bas and "*.bi")
and the useful shell access too.

Or can you debug (gdb) with SciTE ?

Joshy
Image
Fausti
Posts: 32
Joined: Sep 26, 2005 21:33

Post by Fausti »

Nice arguments ;) But...

* I'm sure Kate uses more system resources

* Can Kate run under windoze (without using the cygwin stuff, or other tricks)?

* Why should I download and install Qt + KDE Stuff only to get an editor?

* Scite has shell access

* give me some time and scite will show you all your subs/functions like in fbide ;) (the ctags part is ready, it only lacks the scripting part)

* a plugin for using gdb from scite is in the works

* ...

I know Kate, and if I had KDE+QT installed, I would use it. But I'm using gnome and don't even think of installing KDE (it's to similiar to Windoze, too big and fat ;) (Please, no discusion: KDE vs. GNOME *lol*)

I made this thread to say: here is a nice editor you can try it if you haven't found one fitting your needs. But I never said it's the best, or don't use Kate/Gedit/KDevelop/...

Scite fits my needs for a good editor, Kate fits your needs.

Peace :)
D.J.Peters
Posts: 8642
Joined: May 28, 2005 3:28
Contact:

Post by D.J.Peters »

Thanx for your answer.
I will wait for the debug plugin and give it an try.

Joshy
elcalen
Posts: 116
Joined: Oct 09, 2005 23:52
Location: Finland
Contact:

Post by elcalen »

Personally I use neither KDE nor Gnome, so I'm always interested in good, lightweight editors that are independent of such cumbersome systems...
Keeling
Posts: 148
Joined: May 27, 2005 15:03
Location: USA
Contact:

Post by Keeling »

I've started to use SciTE under Fedora (core 3) and its not bad! But a simple question; is it possible to get it to run the program in a terminal window (as opposed to it showing the output in the bottom window)?
arenth
Posts: 511
Joined: Aug 30, 2005 6:22

Post by arenth »

I always used nedit in linux... pspad in windows. I like em both, simple (ok nedit isnt simple but its fun:P) fast powerful etc etc.
Steve
Posts: 16
Joined: Feb 26, 2006 23:33
Location: Atlanta, GA

Post by Steve »

v1ctor wrote:Yeah, by the Scintilla changelog they added support for FB, i dunno how complete it is though, or if just the VB syntax-highlighter was adapted.
I don't see any mention of FB in the ScitE and Scintilla Web sites, nor is there a '#import freebasic' line in the SciTE (version 1.64) global options file. Could you post the FB highlighter file (or a link to it) so I don't have to hack the VB one? Or maybe I should just wait for FBIDE 0.5.

SciTE looks good, and I may use it to edit assembler code for a pseudomachine I'm playing with. The idea is to design and debug a minimal computer as a FreeBASIC program, then try to actually build it in hardware. The project was inspired by Jack Crenshaw's compiler tutorial, when I observed what a small subset of the 68000 was used by his KISS compiler. So far, I have the simulator and an assembler for it. A nice IDE for the assembler should speed up the testing of the instruction set, and customizing SciTE looks a whole lot easier than writing one from scratch.
VirusScanner
Posts: 775
Joined: Jul 01, 2005 18:45

Post by VirusScanner »

There is an FB lexer, I've used SciTE under windows. But in linux my copy doesn't seem to have the config file, which I'll be copying over shortly.

Scintilla does also have an asm lexer, the only editor I've found supporting it well. It's more of nasm/masm syntax though, GNU as isn't really supported too well.
Steve
Posts: 16
Joined: Feb 26, 2006 23:33
Location: Atlanta, GA

Post by Steve »

VirusScanner wrote:There is an FB lexer, I've used SciTE under windows. But in linux my copy doesn't seem to have the config file, which I'll be copying over shortly.

Scintilla does also have an asm lexer, the only editor I've found supporting it well. It's more of nasm/masm syntax though, GNU as isn't really supported too well.
I found the freebasic.properties file. The version of SciTE in the Ubuntu repository wasn't the latest. Installing the new version (my first successful compile-and-install) and making the edits mentioned up-thread didn't help, though. I still see no FB-specific highlighting, and I can't compile from the editor. I must have something misconfigured. Selecting the VB properties gives some syntax coloring, so SciTE itself is working. Maybe if I go through freebasic.properties and vb.properties line by line in parallel windows...

I'll probably get this working just before FBIDE 0.4 is released.
Post Reply