jEdit Community - Resources for users of the jEdit Text Editor
turning off auto indent (or some features)
Submitted by eric_mahurin on Wednesday, 13 April, 2005 - 13:50
How do I turn off auto-indent? Or better yet just stop it reindenting a line after the fact (except when there is nothing on the line to begin with).

Specifically, I'm coding in ruby right now which only occasionally uses {}, but almost invariably does something I don't want as soon as I type "{". I don't ever want it to reindent a line when I type "{". I do want it to indent on lines a "{". I do want it to unindent on an empty line when I type "}".

If I can't get good behavior, I would rather just turn off auto-indent.

I just downloaded 4.3pre2 and am still having indent problems (as I always have, but it is more pronouced in Ruby code).
Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
more power to the user over auto indenting feature.
by DanielKabs on Thu, 30/03/2006 - 07:45
Hi there,

also wasn't happy with auto indent and tried to switch it of by removing the "Shortcuts" (see "Global Options") for "Insert Newline and Indent" and "Insert Tab and Indent".

Still, jEdit indents automatically, e.g. in c++ mode try to enter { on two following lines. The second { will be automatically indented.

I'd like to have more control over the auto-indenting feature.
 
help! Auto Indenting is controlling my editor...
by DanielKabs on Mon, 03/04/2006 - 10:31
In "c" mode, jEdit is auto-indenting when typing ":" for labeled elements in struct initializers. Obviously the indenting level is aligned with the preceeding line even when that line should be the last one on that indenting level. Mh, but how could jedit know that?

Anyway, I think there should be a way to disable the intelligence that governs auto-indenting Smiling
I would also be interested in
by Anonymous on Fri, 29/04/2005 - 07:27
I would also be interested in this, because I write PHP and would like change the auto indent to work with the closing curly bracket like this (_ = space):

if ($x > 0) {
_____echo "blaablaa";
_____echo "blaablaa";
_____}

So that the closing curly bracket is also indented (maybe not the "standard" way but I prefer it. Any help appreciated (iisakki[at]yahoo.com)!
 
There must be a way to disable auto indenting
by DanielKabs on Tue, 30/01/2007 - 12:09
It's been almost a year since I posted my comment. I'm still struggling with auto indenting. I have disabled all keyboard shortcuts that do indenting but I did not find a way to disable auto indenting when typing "{" or ":".

Please, how can I disable auto indenting completely?

jEdit 4.3.pre7
 
Disabling autoindenting
by jhaefner on Thu, 01/02/2007 - 17:34
This has to be done in mode files.  Do the following:
(NOTE: since the following contains xml code and this crazy webpage filters these out, I've deleted all of the angle brackets ("less than" and "greater than" symbols ...)


1. find your system-level mode files.  For 4.3pre4, mine are located in:
/usr/local/share/jedit/4.3pre4/modes
2. copy the file for c modes to your local modes directory (local versions take precedence over system versions):
cp /usr/local/share/jedit/4.3pre4/modes ~/.jedit/modes

3. edit this local file:
jedit ~/.jedit/modes/c.xml

by commenting out the offending autoindent lines:

	!-- Auto indent --

	PROPERTY NAME="indentOpenBrackets" VALUE="{" /
	PROPERTY NAME="indentCloseBrackets" VALUE="}" /


to stop the really obnoxious indenting of ":" comment out or delete this line:

	PROPERTY NAME="electricKeys" VALUE=":" /

4. edit the *local* modes catalog file, e.g.
jedit ~/.jedit/modes/catalog
by inserting these lines

MODE NAME="c"			FILE="c.xml"
				FILE_NAME_GLOB="*.c" /
where you have to insert a "less than" symbol at the start of the first line and a "greater than" symbol at the end of the second line.

5. restart jedit and you should have non-indenting c mode

6. if you type something like:

         foo();
hello:

you will see that "hello:" is not indented (a good thing), but it will be colored according to your global syntax highlighting coloration because c mode still thinks this is a label (albeit not indented). SO, if you don't want this, edit your local c.xml file, search for "LABEL" and comment out the block of lines

        MARK_PREVIOUS AT_WHITESPACE_END="TRUE"
            EXCLUDE_MATCH="TRUE"
            TYPE="LABEL":/MARK_PREVIOUS

That's it; it works for me.

-Jim


 
YES...that does the trick
by DanielKabs on Mon, 05/02/2007 - 09:33
Thanks Jim, you saved my day, you are my hero! Finally I got rid of this indenting mechanism. Smiling


Addendum to step 4:

For all modes files (e.g. c.xml) in my local folder ~/.jedit/modes, I found the appropriate line in the system-wide catalog file and copied them to the local catalog file.
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