jEdit Community - Resources for users of the jEdit Text Editor
Auto-tab
Submitted by rbrown on Thursday, 8 April, 2004 - 09:07
I've just moved to jedit from Textpad. I've been trying to find something that runs under Linux that is close enough to Textpad that I can use it. jedit appears to do most of the things that I want, however there is one thing that is really annoying me in the way that jedit works. Note: I'm using jedit primarily to develop in PHP.

Basically, it's the auto-tabbing functionality. My style of tabbing is to use tabs for indentation and spaces for alignment. For example, if I'm writing a line that declares an array with some elements, I want to put each element of the array onto a seperate line to make the code more readable. I want the elements to align vertically for easy reading. Each of these lines is tabbed to the same level as the first line, and then aligned from there with spaces. This means that anyone can view the code with their preferred tab size and everything still lines up as originally intended. If spaces or tabes are used to both align and indent, one of these conditions is not met (if you only use spaces people can't view the code in their favoured tab size: if you only use tabs things don't align in tab sizes other than the one used by the author).

Anyway, the upshot is that I end up with lines that start with a number of tabs followed by a number of spaces. The problem is that in jedit when I press return to start a new line, jedit converts most of the spaces into tabs, meaning I have to delete them and add the spaces I want manually. To make matters worse, if I press tab jedit does it again, and created the extra tabs that I don't want. Textpad would simply repeat the same tabbing as the previous line, which is exactly what I want.

I've looked through the options of jedit and can find no option to turn this off. Does anyone know if one, and if not how hard would it be to add one?

Oh, I'm using jedit 4.1 final.

Thanks a lot!
Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
soft tabs
by paulflory on Sun, 11/04/2004 - 04:56
Check out soft tabs, in buffer options (in Utilities menu).

I always use this -- tabs are composed of spaces. Platform-neutral.


-Paul
 
Not what I'm after...
by Anonymous on Sun, 11/04/2004 - 07:36
Platform neutral, but not user-neutral. See my original post: the problem with using just spaces is that it forces everyone else to view the file in your favoured tab size. This is not what I want. I use a 4-space tab size, and I want colleagues who prefer 8 and 2 (yes, some do) space tabs to be able to read my source as comfortably as they read their own.

On this criteria, soft tabs fails, unfortunately.

And to recap, using just tabs fails because viewing the file with a different tab setting jacks with the alignment. The way I do it is the only way to satisfy both problems, and jedit is making it difficult for me to maintain that style of formatting.
 
spaces converted to tabs on autoindent problem
by Anonymous on Fri, 13/05/2005 - 00:35
I'm just wondering if there was a workaround or solution the jedit issue mentioned in this thread. (upon hitting return in non-soft tab mode, any spaces that follow tab indentation and match the current tab width will be transformed by jedit into tabs for the indented new line).

Is there some macro that can precede 'Enter' to exactly duplicate the spaces present rather than automatically transform them (those that match the tab setting) into tabs? I'm not sure how other editors handle this so perhaps jedit is doing what everyone else does.

Alternatively I could just move to softabs, but there is some flexibility to hard tabs that is useful where I work. I'm aware of the space vs. tabs religious wars.
User login
Browse archives
« August 2024  
MoTuWeThFrSaSu
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
Poll
Are you interested in language packs for jEdit?
Yes, and I could help maintain translations
26%
Yes, I'd like to have translations
32%
Indifferent
35%
No, that'd be bad (please comment)
7%
Total votes: 1093
Syndication
file   ver   dls
German Localization light   4.4.2.1   95567
Context Free Art (*.cfdg)   0.31   46060
BBEdit scheme   1.0   18599
JBuilder scheme   .001   18500
ColdFusion scheme   1.0   18029
R Edit Mode - extensive version   0.1   17478
Advanced HTML edit mode   1.0   16211
Matlab Edit Mode   1.0   16073
jEdit XP icons   1.0   15234
XP icons for jEdit   1.1   14298