Cruisehu
Cruisehu

Reputation: 343

sublime alignment doesn't work

When I use the sublime text 2, I install the sublime alignment, but the ctrl+alt+a doesn't work.See the screenshots below for more details.

Before

After

Upvotes: 10

Views: 14893

Answers (9)

Orici
Orici

Reputation: 431

In ST3 / Windows

Key bombination: Ctrl + Alt + A

In the plugin user config file:

{
    "alignment_space_chars": [
        "=", 
        "=>",
        ":"
    ],
}

To open this configuration file: Preferentes/Package Settings/Alignment/Settings - User

Upvotes: 0

Evgenia Karunus
Evgenia Karunus

Reputation: 11202

Try { "keys": ["alt+a"], "command": "alignment" } binding.

I'm on Sublime 3.
For whatever reason default { "keys": ["ctrl+alt+a"], "command": "alignment" } that's automatically included on Alingment package install didn't work for me. I did try searching for conflicting keys, nothing found.
But { "keys": ["alt+a"], "command": "alignment" } did work, now that's what I'm using.

Upvotes: 4

Mordor
Mordor

Reputation: 485

Go to Preferences > Package Settings > Alingment > Key Bindings (default) and make sure that there is this code:

[
    { "keys": ["ctrl+alt+a"], "command": "alignment" }
]

Also check all the other key bindings for your other installed packages if there are some conflicts between key bindings (sometimes the same shortcut is used by more than one package).

Upvotes: 10

gomaxnn
gomaxnn

Reputation: 121

I had the same issue with Alignment plugin.

Follow these steps:

  1. Open the preferences file for Sublime Alignment:

    • Windows: Preferences > Package Settings > Alignment > Settings - User
    • Linux: Preferences > Package Settings > Alignment > Settings - User
    • Mac OS X: Sublime Text 2 > Preferences > Package Settings > Alignment > Settings - User
  2. The file should be empty. Put the following in it:



    {
        // The mid-line characters to align in a multi-line selection, changing
        // this to an empty array will disable mid-line alignment
        "alignment_chars": [
            "=", ":"
        ]
    }

  1. Save & close the preference file. By default, Sublime Alignment works with "=". Now it works with "=" and with ":". You may also add any other symbols.

Upvotes: 12

Maxdow
Maxdow

Reputation: 1006

In Preferences > Package Settings > Alignment > Settings – User add :

    "alignment_chars": ["=", ":"]

Upvotes: 1

Dan L
Dan L

Reputation: 4439

Are you sure you're using Sublime Text 2 and not Sublime Text 3? I ask because I had moved to ST3 and the "alignment" package doesn't work for ST3. I had to use the "AlignTab" package for ST3 to achieve this functionality. Should be able to check in the menu: Sublime Text -> About Sublime Text -> your build number should start with 2 or 3.

Probably isn't your issue, but sometimes it's the simple things that get us!

Upvotes: 5

Amit Patil
Amit Patil

Reputation: 3067

Open sublime text, and go to Preferences>Browse Packages and find Alignment plugin folder, Inside that folder create a new file "php.sublime-settings" and add below lines to it

{
   "alignment_chars": ["=", "=>"]
}

Upvotes: 5

JLugao
JLugao

Reputation: 346

You are using a font that has different sizes for characters and spaces. You want a font that has equal sizes for both characters and spaces. Those fonts are called monospaced. I had the same issue with the "Ubuntu" font, once I setted it to "Ubuntu Mono" it worked just fine. I am pretty sure that there are a lot of monospaced fonts out there.

go to preferences > Settings - User and edit the code there, save and you are done.

mine looks like this:

{
    "font_face"        : "ubuntu mono" , 
    "font_size"        : 15            , 
}

Upvotes: 12

sirmania
sirmania

Reputation: 11

Go to Preferences > Key Bindings (default) and comment out line 564 to 568 like this:

    // { "keys": ["super+alt+a"], "command": "toggle_preserve_case", "context":
//  [
//      { "key": "setting.is_widget", "operator": "equal", "operand": true }
//  ]
// },

Upvotes: 1

Related Questions