Skip to main content
Aug 21, 2020 6:00 PM UTC
Question

Auto Formatting (Keyboard shortcuts or format on save)

Hi is there a way i can press a keyboard shortcut for autoformatting as the default setup requires two clicks and maybe its the way i have dreamweaver setup but the indentation of code is not very good in relation to html.

    This topic is closed to new replies. Start a new post to keep the conversation going.

    2 replies

    Jon Fritz
    Community Expert
    Community Expert
    Aug 21, 2020 7:04 PM UTC

    You can set your own keyboard shortcut for it under...

    1. Edit > Keyboard Shortcuts
    2. If you're not working with custom shortcuts yet, click the Duplicate Set (two squares icon) in the dialogue that comes up
    3. Select "Menu Commands" from the "Commands" dropdown menu
    4. Open the "Edit" list by clicking the > icon
    5. Scroll down to "Code" and open it by clicking its > icon
    6. Click "Apply Source Formatting" to highlight it
    7. Click the + icon next to "Shortcuts"
    8. In the "Press Key" field, pres the keyboard shortcut you want to use
    9. If there are no conflicts with currently set shortcuts, click the "Change" button
    10. Click "OK"

    From there on out, you can select your code and hit the keyboard shortcut you set to apply source formatting.

    Setting how your code behaves is a little longer process, and can be done on a per tag basis under Edit > Preferences > Code Format (set the tab sizes here) > Tag Libraries (set tabs, line breaks and more here). Apply Source Formatting uses the rules you set here to modify your code.

    Translate
    Aug 21, 2020 7:56 PM UTC

    Thanks ill try that

    Translate