qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] ?off? ide/code editor under linux
@ 2006-08-06  1:44 NyOS
  2006-08-06  3:52 ` M. Warner Losh
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: NyOS @ 2006-08-06  1:44 UTC (permalink / raw)
  To: qemu-devel@nongnu.org

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] ?off? ide/code editor under linux
  2006-08-06  1:44 [Qemu-devel] ?off? ide/code editor under linux NyOS
@ 2006-08-06  3:52 ` M. Warner Losh
  2006-08-06  5:55   ` NyOS
  2006-08-06 11:13 ` Thomas Steffen
  2006-08-06 16:21 ` Oliver Gerlich
  2 siblings, 1 reply; 5+ messages in thread
From: M. Warner Losh @ 2006-08-06  3:52 UTC (permalink / raw)
  To: qemu-devel, lista

In message: <op.tdt9smcut9pcbo@mail.chello.hu>
            NyOS <lista@nyos.homelinux.net> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] ?off? ide/code editor under linux
  2006-08-06  3:52 ` M. Warner Losh
@ 2006-08-06  5:55   ` NyOS
  0 siblings, 0 replies; 5+ messages in thread
From: NyOS @ 2006-08-06  5:55 UTC (permalink / raw)
  To: qemu-devel@nongnu.org

On Sun, 06 Aug 2006 05:52:46 +0200, M. Warner Losh <imp@bsdimp.com> wrote:

> In message: <op.tdt9smcut9pcbo@mail.chello.hu>
>             NyOS <lista@nyos.homelinux.net> 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}  
>${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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] ?off? ide/code editor under linux
  2006-08-06  1:44 [Qemu-devel] ?off? ide/code editor under linux NyOS
  2006-08-06  3:52 ` M. Warner Losh
@ 2006-08-06 11:13 ` Thomas Steffen
  2006-08-06 16:21 ` Oliver Gerlich
  2 siblings, 0 replies; 5+ messages in thread
From: Thomas Steffen @ 2006-08-06 11:13 UTC (permalink / raw)
  To: qemu-devel

On 8/6/06, NyOS <lista@nyos.homelinux.net> wrote:
> 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.

> 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.

> 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.

> 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).

> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] ?off? ide/code editor under linux
  2006-08-06  1:44 [Qemu-devel] ?off? ide/code editor under linux NyOS
  2006-08-06  3:52 ` M. Warner Losh
  2006-08-06 11:13 ` Thomas Steffen
@ 2006-08-06 16:21 ` Oliver Gerlich
  2 siblings, 0 replies; 5+ messages in thread
From: Oliver Gerlich @ 2006-08-06 16:21 UTC (permalink / raw)
  To: qemu-devel

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

NyOS schrieb:
> 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-----

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-08-06 16:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-06  1:44 [Qemu-devel] ?off? ide/code editor under linux NyOS
2006-08-06  3:52 ` M. Warner Losh
2006-08-06  5:55   ` NyOS
2006-08-06 11:13 ` Thomas Steffen
2006-08-06 16:21 ` Oliver Gerlich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).