Skip to main content
csgaraglino
Known Participant
March 1, 2018
Answered

Auto Indenting - stop the madness!

  • March 1, 2018
  • 1 reply
  • 2433 views

How do I turn on the feature that is auto-indenting my code?

If I start a line with <div class="my-class"> and hit enter, it automatically indents my code.

If:

<body>

</body>

Exists and I hit enter after <body> I get:

<body>

      </body>

Not cool!!!

DW does not know how to properly indent code - I would rather do it myself!

So how do I turn that off?

    This topic has been closed for replies.
    Correct answer Jon Fritz

    This is what I used in CC2017 to turn it off (I've since gone back to CC2015). It should probably be the same for CC2018 (just replace 2017 with 2018 in the steps)...


    1. On a PC, go to C: > Users > your user name >  AppData (make sure hidden files are turned on if you don't see this folder) > Roaming > Adobe > Dreamweaver CC 2017 > your language > Configuration > Brackets > brackets.json

    1a. On a Mac, this "should" be... (I don't have a Mac)

      a. do a search for  ~/Library/Application Support (make sure the ~ is there)

      b. hit Go

      c. next, go to Adobe > Dreamweaver CC 2017 > your language > Configuration > Brackets > brackets.json

    2. (make a back-up first so you can go back if you goof) Open the file in something other than DW

    3. Find the setting for Smart Indent and change it from true to false...

    "smartIndent" : false

    3. Save and open DW

    1 reply

    Jon Fritz
    Community Expert
    Jon FritzCommunity ExpertCorrect answer
    Community Expert
    March 1, 2018

    This is what I used in CC2017 to turn it off (I've since gone back to CC2015). It should probably be the same for CC2018 (just replace 2017 with 2018 in the steps)...


    1. On a PC, go to C: > Users > your user name >  AppData (make sure hidden files are turned on if you don't see this folder) > Roaming > Adobe > Dreamweaver CC 2017 > your language > Configuration > Brackets > brackets.json

    1a. On a Mac, this "should" be... (I don't have a Mac)

      a. do a search for  ~/Library/Application Support (make sure the ~ is there)

      b. hit Go

      c. next, go to Adobe > Dreamweaver CC 2017 > your language > Configuration > Brackets > brackets.json

    2. (make a back-up first so you can go back if you goof) Open the file in something other than DW

    3. Find the setting for Smart Indent and change it from true to false...

    "smartIndent" : false

    3. Save and open DW

    csgaraglino
    Known Participant
    March 1, 2018

    Perfect, thanks!

    Participating Frequently
    May 13, 2018

    The other option is to use the built in way to achieve this (it's so rare these days to actually find the correct options available to change things to the way I prefer to code, that I was shocked that this actually existed myself, but it does, and is probably easier than the method suggested - at least on DW 2018.1)

    • View
    • Code View Options
    • Click Auto-Indent

    I totally agree with you regards the default auto-indent settings, they don't seem 'smart' at all. However, it seems that it may be possible to actually set them up correctly (to your liking) by using:

    • Edit
    • Preferences
    • Code Format
    • Advanced Formatting - click on 'Tag Libraries'

    Personally I found this a bit of a pain to use... and am surprised that such simple things as NOT indenting a closing </div>  past the opening <div> aren't set as default already... and like you just switched off Auto Indent completely, so I could just get on and code, but I just thought I'd let you know that there were some extra options that might help.

    Good luck.