Looking for a great Linux code editor that has auto-indent AND auto-outdent

-1

I code primarily in jQuery/JavaScript, and I'm looking for a text editor for Linux that has auto-indent and auto-outdent (seems to be tough to find that). Any suggestions? I've checked Gedit, Cream, vim, Bluefish. None of them seem to have this feature.

CaptSaltyJack

Posted 2011-04-22T17:17:05.480

Reputation: 1 515

Question was closed 2015-02-02T04:01:31.247

Answers

1

Geany has auto-outdent on close brace.

Ignacio Vazquez-Abrams

Posted 2011-04-22T17:17:05.480

Reputation: 100 516

Whoa, love it! Really nice editor, great features too. Thanks! – CaptSaltyJack – 2011-04-22T17:52:10.517

4

As far as I know, Vim does indent your code (and it also has a "smartindent" feature which might be equivalent to auto-outdenting. I've never tried it myself but you can do this in your ~/.vimrc

set autoindent
set smartindent

If not, Vim has hundreds of plugins which might get that accomplished.

n0pe

Posted 2011-04-22T17:17:05.480

Reputation: 14 506

Cool! Now, can I get Cream to use smartindent as well? Cream doesn't seem to do the auto-outdent – CaptSaltyJack – 2011-04-22T17:45:20.340

According to this: http://cream.sourceforge.net/faq.html Cream should be picking up on the ~/.vimrc file automatically. Unless, you've turned it off. Try going through your preferences and taking a look as I'm not 100% sure of this :)

– n0pe – 2011-04-22T17:50:02.813

2Nowadays Vim does in- and outdenting with indentation rules defined for every file type. These indent files can be found in $VIMRUNTIME/indent/<ft>.vim. To make it work, you have to place filetype indent on in your vimrc. I'd guess Cream has that already in place, though. (See :help filetype-indent-on.) – peth – 2011-04-22T17:54:19.427