Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Please help!! Indentation vs. Tabs problem!
Please help!! Indentation vs. Tabs problem! [message #161485] Fri, 06 January 2006 20:02 Go to next message
Eclipse UserFriend
Originally posted by: jutes.rogers.com

Hi Eclipse Community,

Eclipse is my favourite IDE on Windows and I am now using Linux at work
and decided to continue using Eclipse.

I am having a terribly hard time trying to set up tabs and indentation in
Eclipse...

Here's what I am *trying* to do:

Each indentation level is 4 spaces. I.e. two indentations equals a single
tab.
In VI this would be accomplished with: ":set tabstop=8 hardtabs=8
shiftwidth=4"

I am trying to get this working in Eclipse and I can't for the life of me
get it to work. I need to display tabs as 8 spaces, but I need some sort
of keyboard shortcut (eg Ctrl-T) to "indent" i.e. add 4 spaces.

Can someone PLEASE help! Thanks so much.

Mike Jutan
Re: Please help!! Indentation vs. Tabs problem! [message #164979 is a reply to message #161485] Thu, 02 March 2006 11:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jamesm.filmlight.ltd.uk

Mike Jutan wrote:
> Hi Eclipse Community,
>
> Eclipse is my favourite IDE on Windows and I am now using Linux at work
> and decided to continue using Eclipse.
>
> I am having a terribly hard time trying to set up tabs and indentation
> in Eclipse...
>
> Here's what I am *trying* to do:
>
> Each indentation level is 4 spaces. I.e. two indentations equals a
> single tab.
> In VI this would be accomplished with: ":set tabstop=8 hardtabs=8
> shiftwidth=4"
>
> I am trying to get this working in Eclipse and I can't for the life of
> me get it to work. I need to display tabs as 8 spaces, but I need some
> sort of keyboard shortcut (eg Ctrl-T) to "indent" i.e. add 4 spaces.
>
> Can someone PLEASE help! Thanks so much.
>
> Mike Jutan

I have the same problem. Our source files have tabs=8spaces, but I only
want to indent 4 spaces.

It's a real nuisance. I wish someone had spent some more time on the CDT
editor fixing the indentation behaviour. All the rest of the
functionality is irrelevant if we can't control the basics like this!

I'm very tempted to make a patch to the CDT's text editor myself.

--
Kind regards,
James Milne
FilmLight Ltd
Re: Please help!! Indentation vs. Tabs problem! [message #165021 is a reply to message #164979] Fri, 03 March 2006 03:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: arne.anka.ginguppin.de

what's wrong with preferences->general->text editors: displayed tab width
[] and ctrl+i?


On Thu, 02 Mar 2006 17:52:19 +0100, James Milne <jamesm@filmlight.ltd.uk>
wrote:

> Mike Jutan wrote:
>> Hi Eclipse Community,
>> Eclipse is my favourite IDE on Windows and I am now using Linux at
>> work and decided to continue using Eclipse.
>> I am having a terribly hard time trying to set up tabs and indentation
>> in Eclipse...
>> Here's what I am *trying* to do:
>> Each indentation level is 4 spaces. I.e. two indentations equals a
>> single tab.
>> In VI this would be accomplished with: ":set tabstop=8 hardtabs=8
>> shiftwidth=4"
>> I am trying to get this working in Eclipse and I can't for the life of
>> me get it to work. I need to display tabs as 8 spaces, but I need some
>> sort of keyboard shortcut (eg Ctrl-T) to "indent" i.e. add 4 spaces.
>> Can someone PLEASE help! Thanks so much.
>> Mike Jutan
>
> I have the same problem. Our source files have tabs=8spaces, but I only
> want to indent 4 spaces.
>
> It's a real nuisance. I wish someone had spent some more time on the CDT
> editor fixing the indentation behaviour. All the rest of the
> functionality is irrelevant if we can't control the basics like this!
>
> I'm very tempted to make a patch to the CDT's text editor myself.
>
> --
> Kind regards,
> James Milne
> FilmLight Ltd
Re: Please help!! Indentation vs. Tabs problem! [message #165059 is a reply to message #165021] Fri, 03 March 2006 04:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jamesm.filmlight.ltd.uk

arne anka wrote:
> what's wrong with preferences->general->text editors: displayed tab
> width [] and ctrl+i?

The C++ editor automatically indents when you hit return after a brace, ie:

void myFunction(void)
{
<autoIndent>int blah;
}

The problem is that the indent size is not separate from the tab size. I
want to indent 4 spaces, but for historical purposes in my source code,
I want it to treat the tab character as 8 spaces.

When I hit the Tab key, I also want the editor to perform an indent and
insert 4 spaces, rather than insert a tab character which ends up being
8 spaces.

--
Kind regards,
James Milne
FilmLight Ltd.
Re: Please help!! Indentation vs. Tabs problem! [message #165119 is a reply to message #165059] Fri, 03 March 2006 09:57 Go to previous message
Eclipse UserFriend
Originally posted by: arne.anka.ginguppin.de

i understand. but a) i'm afraid we have to wait until somebody implements
the jdt-auto-formatting for the cdt and b) i don't think your case will
ever be solved -- having two different tab-sizes (and indent imo uses tab
as measure) is not a very common problem, i think.

On Fri, 03 Mar 2006 10:10:57 +0100, James Milne <jamesm@filmlight.ltd.uk>
wrote:

> arne anka wrote:
>> what's wrong with preferences->general->text editors: displayed tab
>> width [] and ctrl+i?
>
> The C++ editor automatically indents when you hit return after a brace,
> ie:
>
> void myFunction(void)
> {
> <autoIndent>int blah;
> }
>
> The problem is that the indent size is not separate from the tab size. I
> want to indent 4 spaces, but for historical purposes in my source code,
> I want it to treat the tab character as 8 spaces.
>
> When I hit the Tab key, I also want the editor to perform an indent and
> insert 4 spaces, rather than insert a tab character which ends up being
> 8 spaces.
>
> --
> Kind regards,
> James Milne
> FilmLight Ltd.
Previous Topic:problems installing plugins with Eclipse 3.1.2 on Linux FC4: core.resources missing
Next Topic:visual editor for C++
Goto Forum:
  


Current Time: Sat May 10 14:18:38 EDT 2025

Powered by FUDForum. Page generated in 0.03120 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top