Skip to contentSkip to conversation

?off? ide/code editor under linux

Qemu-devel NyOS 4 participants 5 messages Aug 6, 2006

lore
Share & tools
lore

NyOS

author
#0 lore raw

Hi!

I think it might be a bit offtopic here, but I'm already on the list, and I'm interested in some experienced users' opinion. I can find ads on google, but not experience.

I'm looking for a good IDE (or just a good code editor) under linux.
My first try was kdevelop approx. 3 years ago (2.2.2 version). It was too complicated. 3.x.x is a bit unstable. Vi is unconfortable for me,
I prefer using pico and gnu nano, but it's too stupid for some tasks.

My coding style:
There's usually a headers.h file with global headers and global constants (e.g. stdio.h, #define-s) For a module called 'foo' there's a foo.c (or foo.cpp) and a foo.h (lowercase)
.h:
#ifndef _FOO_H //capitals!
#define _FOO_H //capitals!

class foo //c++
..
#endif

.c or .cpp:
#include "headers.h"
#include "foo.h"

class foo //c++
{

};

A bash script can create this (and I have bash scripts for creating new modules, adding new functions, etc..), but it'd be good to have an IDE that can create (according to a template file) these, inserting module name lowercase or uppercase at different places..

I don't need intellisense (it's good to have one but not necessary), just these simple things. (Maybe hotkeys for calling make, but not vital.) Syntax highlighting is good, tab replacing is bad (drives patch/diff crazy).

I've just checked kdevelop, and I could found only a $MODULE$ keyword in file templates (its help system knows only c++ templates), which inserts module name (in lowecase) in a very simple way (it doesn't understand #include "$MODULE$.h").

Another problem is if I use one system, then it probably has an own project format. So importing a bigger (not native) project (like QEmu) would be a nightmare.

But with smaller applications (currently nano) I can only see the whole project through a small window: one file at a time. Opening more terminal tabs resolve this, but makes things more complicated. (opening at least 5 tabs, 2 .c/cpp with their .h file, one for making and running application)

Once I had to develop an app. under win32, I've used context. That's a simple editor that knows syn hl., supports crlf/lf end of line, has tabs to edit more files at once, and has some customizable hotkeys. Not perfect, but good.

Oh, and I prefer black text background to prevent my eyes flowing out from their place, so customized colors would be nice.

So, what do You use? Or what should I try? Any ideas?

Nyos
ps:
Ok, to be more ontopic, it's a good solution to install and run context in a QEmu instance under win32, and mounting a samba share, but I think there must be some better ones.

--------------------------------------------------------------------
"Software is like sex: it's better when it's free." - Linus Torvalds "Software is like sex: it's better with a penguin." - unknown

#1 lore raw

In message: <[email protected]>
NyOS <[email protected]> writes:
: #ifndef _FOO_H //capitals!
: #define _FOO_H //capitals!

You sould avoid using _FOO_H for the define here. That's in the implementation space and strictly speaking off limits to programmers that merely use the system. FOO_H is better, and likely sufficiently unambiguous.

Warner

author
#2 lore raw
Quoted 11 lines · M. Warner Losh

In message: <[email protected]>
NyOS <[email protected]> writes:
: #ifndef _FOO_H //capitals!
: #define _FOO_H //capitals!

You sould avoid using _FOO_H for the define here. That's in the implementation space and strictly speaking off limits to programmers that merely use the system. FOO_H is better, and likely sufficiently unambiguous.

Warner

Ok, that's true.. corrected..
But defines have full capital names traditionally (as you wrote FOO_H and not foo_h).. Files/modules are lowercase..

AFAIK, even the most complex (I think) IDE I tried, kdevelop supports only a simple substitution, it cannot capitalize module name, neither allows to concatenate with "_H". (Or does it an undocumented way)

nyos@nyos:~$ cat bin/newmodule
#!/bin/bash

#newmodule foo
#creates foo.cpp and foo.h

if [ "$1" == "--help" ];then
echo "usage: newmodule <modulename>"
exit 0
fi

MODULENAME=$1
DEFINENAME=toupper $1
HFILE=${MODULENAME}.h
CPPFILE=${MODULENAME}.cpp
DIR=~/src/nyfiletemplates/
NEWCPP=${DIR}/cpp
NEWH=${DIR}/h

if [ -f ${CPPFILE} ]; then
mv -f ${CPPFILE} /tmp/${CPPFILE}.old
fi

if [ -f ${HFILE} ]; then
mv -f ${HFILE} /tmp/${HFILE}.old
fi

sed -e "s/newfile/${MODULENAME}/g" -e "s/NEWFILE/${DEFINENAME}/g" <${NEWCPP} >${CPPFILE} sed -e "s/newfile/${MODULENAME}/g" -e "s/NEWFILE/${DEFINENAME}/g" <${NEWH}

Quoted 1 line

${HFILE}

nyos@nyos:~/src/nyfiletemplates$ cat h
/*
  description of newfile
*/

#ifndef NEWFILE_H
#define NEWFILE_H

//newfile class
class newfile
{
protected:

    //attributes
  public:
    //default constructor of newfile
    newfile();
    //destructor of newfile
    ~newfile();

    //methods

};

#endif

nyos@nyos:~/src/nyfiletemplates$ cat cpp
#include "headers.h"
#include "newfile.h"

newfile::newfile()
{

}

newfile::~newfile()
{

}

//methods

Sorry for typos.. I've translated variable names and comments in this letter to English (and removed unnecessary parts)..
I think You can understand its point..
toupper makes uppercase letters (ok, it could be done with tr), sed substitutes.. ugly, but works.. I've got similar scripts for creating methods and putting in the code, adding attributes (and inserting default getter/setter methods).. But I'd like to get rid of them.. (Or at least call them a bit cultivated way, use a hotkey and give parameters on an X/curses form)

So? What is Your advise? I'm open for new programs.

Nyos

#3 lore raw
In reply to NyOS
Quoted 5 lines · NyOS

I'm looking for a good IDE (or just a good code editor) under linux. My first try was kdevelop approx. 3 years ago (2.2.2 version). It was too complicated. 3.x.x is a bit unstable.
Vi is unconfortable for me,
I prefer using pico and gnu nano, but it's too stupid for some tasks.

Good taste. Vi (at least the original version) is completely obsolete. gvim seems ok, but since I don't like modal interfaces, it is not for me. Emacs or XEmacs is the other big editor, and it comes with countless packages to improve the editing experience. However, development speed is quite glacial, so don't the expect the latest fashion any time soon.

Takling about kdevelop, I found it a bit lacking in advanced editing features, but otherwise it seems alright. Eclipse would be similar, but the performance can be an issue depending on your JVM.

Quoted 2 lines

There's usually a headers.h file with global headers and global constants (e.g. stdio.h, #define-s)

Think about some magic using cproto etc... to generate your header files from the source files. I find it very satisfying to have everything in one file instead of two.

Quoted 4 lines

A bash script can create this (and I have bash scripts for creating new modules, adding new functions, etc..), but it'd be good to have an IDE that can create (according to a template file) these, inserting module name lowercase or uppercase at different places.

I am not sure I would make this the deciding issue for chosing an IDE. It should take one search and replace to do this (Emacs can preserve case), or one call to your script.

Quoted 2 lines

Syntax highlighting is good, tab replacing is bad (drives patch/diff crazy).

Emacs also has very good reindentation support, which I use a lot. Tabs are preserved by default (and KDevelop can be configured to do so).

Quoted 3 lines

Ok, to be more ontopic, it's a good solution to install and run context in a QEmu instance under win32, and mounting a samba share, but I think there must be some better ones.

Hehe, I did that with a dos editor in the days of dosemu. But I would certainly look for a lightweight solution like wine: it just integrates a lot closer with the Linux environment.

Thomas

#4 lore raw
In reply to NyOS

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 11 lines · NyOS

Hi!

I think it might be a bit offtopic here, but I'm already on the list, and I'm interested in some experienced users' opinion.
I can find ads on google, but not experience.

I'm looking for a good IDE (or just a good code editor) under linux. My first try was kdevelop approx. 3 years ago (2.2.2 version). It was too complicated. 3.x.x is a bit unstable.
Vi is unconfortable for me,
I prefer using pico and gnu nano, but it's too stupid for some tasks.

kdevelop is quite nice, but has some bugs, and shortcomings. If you're looking just for an editor, I would recommend kate (which I use for daily work, whenever I don't need a big IDE). It can be extended with plugins and scripts, so maybe you could write a script to do the template stuff.
Also, AFAIK Gnome's gedit can be extended with Python scripts, which might be even better than the shell script / C++ plugin solution of kate.

Regards,
Oliver
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQFE1hb7TFOM6DcNJ6cRAu4QAJ9Xu2TKuri9Uv//p+3kj1zrLEFsQgCgjQnH y8FFrBhPJw4gFGk7E3YgCCc=
=Z+Bp
-----END PGP SIGNATURE-----