best C programming editor for Linux

best C programming editor for Linux

Post by gaius.petroni » Thu, 28 Feb 2002 16:38:46



i was trying to get a hold of 'Scriptum' but it seems that editor is
not available now (or was never fully developed)

i use gvim on Linux and it's good
However i'd like something better which is sensitive to indentations
of cut-and-pastes

for example

if i have a snippet
.............declaration
.............for (){
....................code
....................code
..............}

and i want to paste it into an if condition of a larger program that
is
indented much further inside,
............................if {
.................................other code
............................}

The paste ends up looking like this:
............................if
.............declaration
.............for (){
....................code
....................code
..............}
.................................other code
............................}

Anyone recommend an editor which feels like vi but which is more
sensitive to these syntax ?

Even better:
Can anyone recommend a code generator that will sweep through the code
and re-indent the source?  Then i could just re-open the output file
in vi and continue.

and TIA

 
 
 

best C programming editor for Linux

Post by Antti J?rvin » Thu, 28 Feb 2002 18:10:06



> Anyone recommend an editor which feels like vi but which is more
> sensitive to these syntax ?

Emacs does not feel like vi but in C-mode is quite sensitive to syntax.
Feels good.

Quote:> Can anyone recommend a code generator that will sweep through the code
> and re-indent the source?  Then i could just re-open the output file
> in vi and continue.

My linux box comes with indent (see "man indent"). With emacs you can also
do "M-x indent-region" to get a region of your C-code re-indented.

--

            "concerto for two *s and orchestra"

 
 
 

best C programming editor for Linux

Post by Donald McLachl » Thu, 28 Feb 2002 22:45:22



Quote:

> Even better:
> Can anyone recommend a code generator that will sweep through the code
> and re-indent the source?  Then i could just re-open the output file
> in vi and continue.

> and TIA

indent used to do that.  Not included on Solaris anymore. :-(  But I still have
and occassionlly use the old binary.  I just checked via goole.com and there
is a gnu verion available.

Don

--

Communications Research Centre / RNS    Tel     (613) 998-2845
3701 Carling Ave.,                      Fax     (613) 998-9648
Ottawa, Ontario
K2H 8S2
Canada

 
 
 

best C programming editor for Linux

Post by Mosh » Fri, 01 Mar 2002 00:56:37


gaius.petronius had nothing better to do than to say:

Quote:> i use gvim on Linux and it's good
> However i'd like something better which is sensitive to indentations
> of cut-and-pastes

You need to look up information on the following vim options:

set paste
set pastetoggle
set cindent
set smartindent
set formatoptions (I use croqt for this)

You will have a much easier time with these options enabled.

Additionally, if you want to indent a block of text, highlight it with
shift-v (visual line mode) and press n>> where n is the number of tabstops
you'd like to indent.

Or you can highlight the first column of a block of code, with visual
block mode (ctrl-v) and hit shift-I to insert space at the beginning, and
it will add that space to every line in your selection.

HTH.

Moshe

--
*** SPAM BLOCK: Remove bra before replying! ***
Moshe Jacobson :: http://runslinux.net :: moshe at runslinux dot net

 
 
 

best C programming editor for Linux

Post by Dean Fo » Fri, 08 Mar 2002 16:50:16




Quote:> Even better:
> Can anyone recommend a code generator that will sweep through the code
> and re-indent the source?  Then i could just re-open the output file
> in vi and continue.

Vim can do this. Just type this while in command mode:
1G=G
 
 
 

best C programming editor for Linux

Post by Harold Tomlinso » Thu, 14 Mar 2002 22:45:40





>>Even better:
>>Can anyone recommend a code generator that will sweep through the code
>>and re-indent the source?  Then i could just re-open the output file
>>in vi and continue.

>Vim can do this. Just type this while in command mode:
>1G=G

Why not just use emacs?  It gives you the indenting as you go along with
a host of other features.  (I honestly do not know how anyone could use
vi.)  If you wish to re-indent the file in emacs, select the entire file
(M-< ^-space M->) and indent (M-x indent-region).  

I know that sounds cryptic and emacs does have a lot of commands you can
use, but you can also just use a small set of them.  I have turned many
people onto the benefits of emacs by suggesting the following:  Get a
book on it, in the book there will be a quick reference chart.  Take
that chart and highlight the things you can do in vi, ignore everything
else.  It will take you no more than a day to learn to do everything you
can do in vi with emacs.  After one day, you will be no less productive
than you were with vi.  Then, as you find time and interest, add the
features that allow you to do what you want to do.  Features like:
    - knowing where you last edited and what files you were working on.  
    - running a command shell within the same window.
    - running finds and greps from within the same window.
    - easy cut and paste between files.
    - ability to comment out a section of code with a few keystrokes.
    - a calendar, schedule, and to-do list
    - integrated compiler.
    - integrated de*.
    - easy keyboard macros.
    - easy key mappings including binding to a macro.
    - ability to split the screen vertically, horizontally, and compare
two files or the same file side by side.
    - spell checker.
    - integrated info and man pages.
    - hex/binary editor.
    - edit multiple documents at the same time.
    - consistent interface between systems.
    - multi-platform availability.  It's available for everything from
winslop to VMS.

Of course, some things will be delivered to you without your needing to
know how.  Things like:
    - indenting your C, C++, or other documents.
    - matching braces so you know you completed it correctly.
    - syntax highlighting.
    - automatic loading of files with syntax errors and locating the error.
    - periodic saving of changes to documents
    - automatic creation of backup files.

The best editor I have seen was the Microsoft Visual Studio (not
available for Linux), the only other editor I like is emacs, it saves a
ton of time and effort.

HaroldT

--
Harold Tomlinson          http://www.veryComputer.com/

416-892-7191 (cell)                              416-892-9191 (fax)

 
 
 

best C programming editor for Linux

Post by Mosh » Thu, 14 Mar 2002 22:53:25


Harold Tomlinson had nothing better to do than to say:

Quote:> Why not just use emacs?

You're going to start a holy war. Most of the stuff you mentioned can be
done using vim. Furthermore, vim (or at *least* vi) is on far more systems
than emacs is. Emacs takes so much hard drive space that many sysadmins
deem it not worthwhile.

Moshe

--
*** SPAM BLOCK: Remove bra before replying! ***
Moshe Jacobson :: http://runslinux.net :: moshe at runslinux dot net

 
 
 

best C programming editor for Linux

Post by Harold Tomlinso » Fri, 15 Mar 2002 06:42:12


Robert:

  I think you missed the subject line.  Someone asked for opinions.  I'm
not starting a war, I'm just answering the question with my opinion.  I
will have to check out vim, though, if it really can do all that.

HaroldT




>use it - if anyone else thinks that emacs is fine for him/her, let him/her
>use it and keep your mouth shut :)

>Robert Spielmann

--
Harold Tomlinson          http://members.rogers.com/haroldt.creacom

416-892-7191 (cell)                              416-892-9191 (fax)
 
 
 

best C programming editor for Linux

Post by Robert Spielman » Fri, 15 Mar 2002 08:21:46




Quote:> Robert:

>   I think you missed the subject line.  Someone asked for opinions.
>   I'm
> not starting a war, I'm just answering the question with my opinion.  I
> will have to check out vim, though, if it really can do all that.

> HaroldT

Bonjour Harold,

I didnt mean to attack you, my posting was related to the stuff Moshe

if we discussed vi(m) vs. emacs. Your posting was fully okay, I had no
problem with that.

Robert

 
 
 

best C programming editor for Linux

Post by TheBriez » Fri, 15 Mar 2002 13:07:01


I use xemacs for all my programming needs, including java development on
windows. Yes xemacs is a fully functional Java IDE right out of the box,
without most the bloat of other IDE's. Its got other great features too
which I like, like editing remote files as though they were local,
customisable auto-indenting/syntax highlighting (and every other feature) to
suit your programming style, incremental search, the integrated shell means
you can easily search/compare program output etc. and a whole host of other
really great features.
The only vi feature I really do miss is the "." command. I know there "."
emulation packages out there, but i believe they also come with a noticable
performance penalty, in have to record all commands. Easy macros in emacs
helps, but is really more suited to more complex tasks.

All said, xemacs/emacs is an entire programming environment in itself, I
find vi more suited for quick edits and for simpler editing needs. Never
quite used Vim so I cannot comment on it.

'brieze




> > Robert:

> >   I think you missed the subject line.  Someone asked for opinions.
> >   I'm
> > not starting a war, I'm just answering the question with my opinion.  I
> > will have to check out vim, though, if it really can do all that.

> > HaroldT

> Bonjour Harold,

> I didnt mean to attack you, my posting was related to the stuff Moshe

> if we discussed vi(m) vs. emacs. Your posting was fully okay, I had no
> problem with that.

> Robert

 
 
 

best C programming editor for Linux

Post by Ryan Graha » Tue, 19 Mar 2002 09:41:53


look up indent.. it's a GNU tool designed specifically for this... there are
many options you can pass to it too... like -kr for the style used in the
K&R book, and many others.

~higman




> > Even better:
> > Can anyone recommend a code generator that will sweep through the code
> > and re-indent the source?  Then i could just re-open the output file
> > in vi and continue.

> Vim can do this. Just type this while in command mode:
> 1G=G

 
 
 

best C programming editor for Linux

Post by Paul D F » Tue, 19 Mar 2002 18:51:13






> >>Even better:
> >>Can anyone recommend a code generator that will sweep through the code
> >>and re-indent the source?  Then i could just re-open the output file
> >>in vi and continue.

> >Vim can do this. Just type this while in command mode:
> >1G=G

> Why not just use emacs?  It gives you the indenting as you go along with
> a host of other features.  (I honestly do not know how anyone could use
> vi.)  If you wish to re-indent the file in emacs, select the entire file
> (M-< ^-space M->) and indent (M-x indent-region).  

> I know that sounds cryptic and emacs does have a lot of commands you can
> use, but you can also just use a small set of them.  I have turned many
> people onto the benefits of emacs by suggesting the following:  Get a
> book on it, in the book there will be a quick reference chart.  Take
> that chart and highlight the things you can do in vi, ignore everything
> else.  It will take you no more than a day to learn to do everything you
> can do in vi with emacs.  After one day, you will be no less productive
> than you were with vi.  Then, as you find time and interest, add the
> features that allow you to do what you want to do.  Features like:
>     - knowing where you last edited and what files you were working on.  
>     - running a command shell within the same window.
>     - running finds and greps from within the same window.
>     - easy cut and paste between files.
>     - ability to comment out a section of code with a few keystrokes.
>     - a calendar, schedule, and to-do list
>     - integrated compiler.
>     - integrated de*.
>     - easy keyboard macros.
>     - easy key mappings including binding to a macro.
>     - ability to split the screen vertically, horizontally, and compare
> two files or the same file side by side.
>     - spell checker.
>     - integrated info and man pages.
>     - hex/binary editor.
>     - edit multiple documents at the same time.
>     - consistent interface between systems.
>     - multi-platform availability.  It's available for everything from
> winslop to VMS.

> Of course, some things will be delivered to you without your needing to
> know how.  Things like:
>     - indenting your C, C++, or other documents.
>     - matching braces so you know you completed it correctly.
>     - syntax highlighting.
>     - automatic loading of files with syntax errors and locating the error.
>     - periodic saving of changes to documents
>     - automatic creation of backup files.

> The best editor I have seen was the Microsoft Visual Studio (not
> available for Linux), the only other editor I like is emacs, it saves a
> ton of time and effort.

> HaroldT

If you like all of these things then take a look at CRiSP
(www.crisp.demon.co.uk) -- available on most platforms, Windows &
Linux included, and a good vi emulation. If you like MS Studio then
take a look at CRiSP. It can pretty much do more than MS.

But it is commercial.

 
 
 

best C programming editor for Linux

Post by Rasputi » Thu, 21 Mar 2002 01:26:00


In the last exciting episode of comp.unix.programmer,
Moshe said:

Quote:> Harold Tomlinson had nothing better to do than to say:
>> Why not just use emacs?

> You're going to start a holy war. Most of the stuff you mentioned can be
> done using vim. Furthermore, vim (or at *least* vi) is on far more systems
> than emacs is. Emacs takes so much hard drive space that many sysadmins
> deem it not worthwhile.

You make it sound like M$ - we're talking a few dozen Mb.

--
"We don't care.  We don't have to.  We're the Phone Company."
Rasputin :: Jack of All Trades - Master of Nuns ::

 
 
 

best C programming editor for Linux

Post by Harold Tomlinso » Tue, 02 Apr 2002 23:21:21




>If you like all of these things then take a look at CRiSP
>(www.crisp.demon.co.uk) -- available on most platforms, Windows &
>Linux included, and a good vi emulation. If you like MS Studio then
>take a look at CRiSP. It can pretty much do more than MS.

>But it is commercial.

  I should add that "free" is a good feature too.  But thanks for the
info.  It looks interesting enough that I will keep the bookmark so that
I can check it out when I have time.  Any idea of the cost?  They did
not put that on the web site.

  I've been looking at vim.  I must say I am surprised at the list of
functions, but I cannot some that are very important to me.  

  How does one create a shell window in vim?  That is, I want a window
in which I can run a command, perhaps cut from a shell script that I am
writing.  A shell window would also allow me to cut the results of a
command back into another window/file.  It also means that I could run a
command and save the entire session as a log file (both input and
output) using emacs' auto save.  It's handy for getting the syntax
correct for script before putting it into a file.  

  The other important one is to have make run from within the editor
and, when errors are found, open the offending file and locate the line
in question.  How is this done with vim?  

  Perhaps less important, but still very handy, is the ability to read a
directory listing within the editor.  This allows for changes to be made
to files, things to be moved about or deleted, or commands to be run on
files without remembering where all 400 files in your project are located.

  I also see no reference to CVS or RCS in the help for vim.  Are they
integrated?  Or do you have to exit the editor (or suspend) in order to
check in your changes?

--
Harold Tomlinson          http://members.rogers.com/haroldt.creacom

416-892-7191 (cell)                              416-892-9191 (fax)

 
 
 

best C programming editor for Linux

Post by Rich Tee » Wed, 03 Apr 2002 02:32:23



>   How does one create a shell window in vim?  That is, I want a window
> in which I can run a command, perhaps cut from a shell script that I am
> writing.  A shell window would also allow me to cut the results of a
> command back into another window/file.  It also means that I could run a
> command and save the entire session as a log file (both input and
> output) using emacs' auto save.  It's handy for getting the syntax
> correct for script before putting it into a file.

[ Snip ]

Heh, you don't want an editor - you want an IDE.  The two are
not synonymous...

--
Rich Teer

President,
Rite Online Inc.

Voice: +1 (250) 979-1638
URL: http://www.rite-online.net

 
 
 

1. Which GNU General Public License Editor are the best for C programming?

Dear Sir/Madam

I am fresh to Linux and Unix. I want to study the kernel source codes mostly
in C. I want to have an editor which accompany common tasks such as
different colors for special language syntax, project management, access to
compiler and debugger, and etc.

Could you recommend which GNU General Public License Editor are the best for
C programming?

Thanks for your attentions.

Looking forward to hearing from you.

Best regards
Richard

2. Writers wanted

3. browsers problem

4. Which GNU General Public License Editor are the best for C programming

5. ipchains newby question - ip mapping

6. Best html editor in Linux?

7. virt. to phys. (vtop) ???

8. Best HTML editor, cgi templates, for UNIX (linux) ?

9. Best sound RECORDER/EDITOR for Linux?

10. What's the best video editor/converter for Linux?

11. What is best HTML Editor for LINUX?

12. What is the best HTML editor on Linux?