jEdit Community - Resources for users of the jEdit Text Editor
Auto-Indent for parentheses and operators?
Submitted by Anonymous on Sunday, 12 September, 2004 - 22:08
Is there a way to get jEdit to auto-indent using certain characters on the previous line as a guide? E.g. not having to press tab or make leading spaces while typing:
if(a == b
   && a == c
   && b !=c)
  cout << "Oh my god, " << endl
       << "this makes no sense!" << endl
       << ((1 + 2 + 3
            + 4 + 5 + 6)
           / 20.0) << endl;
emacs does some of this in it's c++ mode: '<<' automatically aligns with the first '<<' on the previous line, and anything after an unmatched '(' auto-aligns with the character after that '('. Or maybe you have to press tab to prompt it, but then it automatically finds the correct place to put it.

jEdit seems cooler than emacs, though, so it would be nice if there was a way to get it to do this! It would save a lot of time for me...if it's not possible now, would this sort of thing be possible with a plugin?
Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
"Deep Indent"
by Anonymous on Fri, 11/03/2005 - 22:01
If you turn on "Deep Indent" while also using auto-indenting, jEdit will do this. However, I've yet to find a way to specify *which* characters to use for auto-aligning---I think it may be language-mode specific.

I use Python mode almost exclusively, which auto-aligns to open parens ( '(' characters) but nothing else. I probably use this for parens more than I woudl for any other single character, but it'd still be nice to have the option for '[' and '{'.

-- Lex (The registration system seems to be having issues... I think my username here is "lnemzer", but I'm currently unable to log in or to get my password emailed.)
User login
Browse archives
« November 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
 
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   101634
Context Free Art (*.cfdg)   0.31   46062
BBEdit scheme   1.0   18601
JBuilder scheme   .001   18502
ColdFusion scheme   1.0   18031
R Edit Mode - extensive version   0.1   17481
Advanced HTML edit mode   1.0   16213
Matlab Edit Mode   1.0   16075
jEdit XP icons   1.0   15236
XP icons for jEdit   1.1   14300