Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » How to use the TAB key to indent a line of code?
How to use the TAB key to indent a line of code? [message #161749] Fri, 28 May 2004 11:02 Go to next message
Eclipse UserFriend
Originally posted by: metfan.nowhere.com

I mean, for example, in Jbuilder, there's a feature called
'smart indent', that is, no matter where you put the curson,
when you press the TAB key, the whole line which the curson
is on will be indented, and then no matter how many TAB you
press again, there's no effect anymore. In Eclipse, if the
curson is ahead of the first letter of a line, and you press
TAB, the line will be indented, if you press TAB again, the
line will be indented to the right again, this is not what I
want. And if you put the curson inside the line of code, for
example, inside a variable name, and press TAB, a '\t' will be
inserted into the variable name, that is not what I want again.

Did I make myself clear?
So how to make the TAB key behaviour in Eclipse the same as
the TAB key behaviour in JBuilder? Thanks very much.
Re: How to use the TAB key to indent a line of code? [message #161917 is a reply to message #161749] Sat, 29 May 2004 10:20 Go to previous messageGo to next message
Eclipse UserFriend
just select the whole line (e.g. press home, shift+down) before pressing
tab

metfan wrote:

> I mean, for example, in Jbuilder, there's a feature called
> 'smart indent', that is, no matter where you put the curson,
> when you press the TAB key, the whole line which the curson
> is on will be indented, and then no matter how many TAB you
> press again, there's no effect anymore. In Eclipse, if the
> curson is ahead of the first letter of a line, and you press
> TAB, the line will be indented, if you press TAB again, the
> line will be indented to the right again, this is not what I
> want. And if you put the curson inside the line of code, for
> example, inside a variable name, and press TAB, a 't' will be
> inserted into the variable name, that is not what I want again.

> Did I make myself clear?
> So how to make the TAB key behaviour in Eclipse the same as
> the TAB key behaviour in JBuilder? Thanks very much.
Re: How to use the TAB key to indent a line of code? [message #162005 is a reply to message #161749] Sun, 30 May 2004 19:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bytor2001.comcast.net

metfan wrote:
>
> I mean, for example, in Jbuilder, there's a feature called
> 'smart indent', that is, no matter where you put the curson,
> when you press the TAB key, the whole line which the curson
> is on will be indented, and then no matter how many TAB you
> press again, there's no effect anymore.

In Emacs/XEmacs, java-mode (and most other language modes) does
precisely the same thing. It drives me nuts. I switch between
XEmacs and Eclipse constantly so I am constantly running into
differences like this...

-xbytor
Re: How to use the TAB key to indent a line of code? [message #162011 is a reply to message #161917] Sun, 30 May 2004 19:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bytor2001.comcast.net

Jens Odborg wrote:

> just select the whole line (e.g. press home, shift+down) before pressing
> tab
>

Is this an M9 thing because I just tried this in 2.1.3 with no luck.
BTW, is there anyway to have Eclipse re-indent an entire file?
In XEmacs, I select the entire contents of the file and hit TAB and
it automagically reformats the entire file.

Come to think of it, I'd like to do this to an arbitrary set of source
files.

-xbytor
>
Re: How to use the TAB key to indent a line of code? [message #162052 is a reply to message #162011] Sun, 30 May 2004 21:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: smesh.openrules.com

xbytor wrote:
> In XEmacs, I select the entire contents of the file and hit TAB and
> it automagically reformats the entire file.

What's wrong with Shift+Ctrl+F?

--
Sam Mesh - http://openrules.com
Re: How to use the TAB key to indent a line of code? [message #162093 is a reply to message #162052] Mon, 31 May 2004 04:52 Go to previous messageGo to next message
Eclipse UserFriend
xbytor,

that's what I do. I write most of my code to a single line and press
Ctrl+Shift+F every now and then.

Anyway, regarding your question. Did you try Ctrl+Shift+I? That
should do what you want.

Is xbytor your first or last name? ;-)

Cheers,
Mariano

Sam Mesh wrote:

> xbytor wrote:
>
>> In XEmacs, I select the entire contents of the file and hit TAB and
>> it automagically reformats the entire file.
>
>
> What's wrong with Shift+Ctrl+F?
>
> --
> Sam Mesh - http://openrules.com
Re: How to use the TAB key to indent a line of code? [message #162158 is a reply to message #162093] Mon, 31 May 2004 20:23 Go to previous message
Eclipse UserFriend
Originally posted by: bytor2001.comcast.net

Okay, Okay. I did find that shortly after I posted.
I promise I'll RTFM before I post again.

thanks,
-xbytor

Mariano Kamp wrote:
> xbytor,
>
> that's what I do. I write most of my code to a single line and press
> Ctrl+Shift+F every now and then.
>
> Anyway, regarding your question. Did you try Ctrl+Shift+I? That should
> do what you want.
>
> Is xbytor your first or last name? ;-)

Just a handle. Kinda like 'Cher' and other
mono-nonymous people...

>
> Cheers,
> Mariano
>
> Sam Mesh wrote:
>
>> xbytor wrote:
>>
>>> In XEmacs, I select the entire contents of the file and hit TAB and
>>> it automagically reformats the entire file.
>>
>>
>>
>> What's wrong with Shift+Ctrl+F?
>>
>> --
>> Sam Mesh - http://openrules.com
Previous Topic:getting a resource from java (Markers)
Next Topic:can not add a breakpoint in Eclipse
Goto Forum:
  


Current Time: Thu Jul 17 00:51:05 EDT 2025

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

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

Back to the top