Easy alignment of multiple selections and multi-line selections

Overview

Sublime Alignment

A simple key-binding for aligning multi-line and multiple selections in Sublime Text 2.

Please see http://wbond.net/sublime_packages/alignment for install instructions, screenshots and documentation.

License

All of Sublime Alignment is licensed under the MIT license.

Copyright (c) 2011 Will Bond <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Comments
  • Alignment not available in Package Control

    Alignment not available in Package Control

    I tried this with: --OS X Mavericks & Sublime Text 3 --Windows 7 & a fresh install of ST3 --Fresh Win8 Install using brand new install of ST3

    "Alignment" does not appear in the list of available packages. =[

    opened by iDXs 8
  • Doesn't work with ruby 1.9 hash notation

    Doesn't work with ruby 1.9 hash notation

    Hi,

    Aligment works fine with Ruby 1.8 Hash notation but not with 1.9. Example :

    This works fine :

    {
      :display_label => "name",
      :value => "John Doe"
    }
    

    This does nothing :

    {
      display_label: "name",
      value: "John Doe"
    }
    
    opened by gdlx 6
  • Can't align commas?

    Can't align commas?

    I'm not sure what I'm doing wrong, but is there something that keeps it from aligning commas?

    I want to align: [ 1, '01_home.png', 'Home', 'The guest home page'], [ 2, '02_login.png', 'Login', 'The login form'],

    in an array on the commas. My only change to my config is:

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

    What am I missing?

    opened by DaveSanders 5
  • suggestion: CSS vendor prefix alignment

    suggestion: CSS vendor prefix alignment

    It'd be sweet if your plugin would change this:

    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    -ms-border-radius: 50%;
    -o-border-radius: 50%;
    border-radius: 50%;

    into this:

    -webkit-border-radius: 50%;
       -moz-border-radius: 50%;
        -ms-border-radius: 50%;
         -o-border-radius: 50%;
            border-radius: 50%;

    ...And change this:

    background: -webkit-linear-gradient(top, #fff, #eee);
    background: -moz-linear-gradient(top, #fff, #eee);
    background: -ms-linear-gradient(top, #fff, #eee);
    background: -o-linear-gradient(top, #fff, #eee);
    background: linear-gradient(top, #fff, #eee);

    into this:

    background: -webkit-linear-gradient(top, #fff, #eee);
    background:    -moz-linear-gradient(top, #fff, #eee);
    background:     -ms-linear-gradient(top, #fff, #eee);
    background:      -o-linear-gradient(top, #fff, #eee);
    background:         linear-gradient(top, #fff, #eee);
    opened by Daniel-Hug 4
  • not indenting properly

    not indenting properly

    I just installed the package using Package Control (which is awesome). However, when I do a multi select, it ends up putting the tabs (or spaces) at the end of the lines and doesn't actually line up the equals signs. This happened on both Windows and OSX. Any thoughts?

    opened by darkhouse 4
  • Key bindings not working when SublimeLinter is installed

    Key bindings not working when SublimeLinter is installed

    Alignment and SublimeLinter packages doesn't work together properly. (at least not under Sublime Text 3) They use both the same keybindings. When trying to override it with customer (user) keybinding, nothing happens.

    opened by rgruyters 3
  • Lack concept of context and aligns first align character in each line

    Lack concept of context and aligns first align character in each line

    I ran into an bug when trying to align the following PHP:

    $urlMap = array(
        '/old-url' => '/new-url-for-old-url',
        '/another-old-url' => '/new-url-for-other-old-url',
        '/older-url?page=cart' => '/cart',
        '/older-url?page=home' => '/',
        '/bad-url' => '/better-url'
    );
    

    Running sublime_alignment, modifies the block of code to look like this:

    $urlMap = array(
        '/old-url'         => '/new-url-for-old-url',
        '/another-old-url' => '/new-url-for-other-old-url',
        '/older-url?page   =cart' => '/cart',  // aligned to wrong char
        '/older-url?page   =home' => '/',  // aligned to wrong char
        '/bad-url'         => '/better-url'
    );
    

    What I expected:

    $urlMap = array(
        '/old-url'             => '/new-url-for-old-url',
        '/another-old-url'     => '/new-url-for-other-old-url',
        '/older-url?page=cart' => '/cart',
        '/older-url?page=home' => '/',
        '/bad-url'             => '/better-url'
    );
    

    The problem here, I presume, is that alignment has no knowledge that the first equals is within a string. I know that it would very difficult (if not impossible) to have it parse code in all of the languages with which it is compatible to determine whether an equals is actually an assignment operator that should be aligned to. However, I think it is pretty universal that characters surrounded by single or double quotes are strings. With this assumption, I would like to propose adding a rudimentary understanding of strings to sublime_alignment, so that it doesn't incorrectly align to characters within a string.

    Any thoughts?

    Thanks!

    opened by phpmycoder 3
  • How align compass include

    How align compass include

    how do I align from the first parenthesis?

    color: #636363; font-weight: 600; margin-bottom: 0; @include background-image (linear-gradient(top, #FDFDFD, #EAEAEA)); @include text-shadow (0 1px #FFF);

    opened by miguelsmuller 3
  • Auto alignment

    Auto alignment

    I don't know how possible this would be but it would great if aligned blocks could be monitored and then auto align if something changes. For example, if I align some code and get the following:

    $foo    = 1;
    $foobar = 2;
    

    then change $foo to $something_really_long then the block would automatically update to

    $something_really_long = 1;
    $foobar                = 2;
    

    without having to select and Ctrl + Alt + A.

    opened by alexwhitman 3
  • Package is in

    Package is in "MISSING" state on Package Control at the moment (can't install via that way)

    Hey there Will, hope you're well.

    I just re-installed Sublime and notice that I couldn't install Alignment. The current state on the Package Control website is MISSING.

    Would you kindly check this out please?

    Thanks heaps! Fotis

    opened by fgimian 2
  • Plugin doesn't work when I select the text.

    Plugin doesn't work when I select the text.

    Summary

    Plugin doesn't work when I select the text and run alignment command.

    Expected behavior

    Alignment when I select text

    Actual behavior

    Not alignment when I select text

    Steps to reproduce

    I checked on plain Sublime Text Portable without plugins.

    My JavaScript code:

    Tween.prototype = {
        constructor: Tween,
        init: function(elem, options, prop, end, easing, unit) {
        this.elem = elem;                                                                                
        this.prop = prop;                                                                                
        this.easing = easing || jQuery.easing._default;                    
        this.options = options;                                                                    
        this.start = this.now = this.cur();                                            
        this.end = end;                                                                                    
        this.unit = unit || (jQuery.cssNumber[prop] ? "" : "px");
        },                                                                                                              
        cur: function() {                                                                                
        var hooks = Tween.propHooks[this.prop];
    

    I allocate a text site, I press Ctrl+Alt+A, but nothing occurs:

    Not Alignment

    The console shows that at me everything is all right.

    key evt: control+alt+a
    command: alignment
    

    If I allocate CSS-code, the plugin too doesn't work.

    But if I clamp the Ctrl key and insert multiple cursors, the plugin works.

    Alignment

    Environment

    • Operating system and version:
      [√] Windows 10 Education
      • [ ] Mac OS ...
      • [ ] Linux ...
    • Sublime Text:
      • Build 3114
    opened by Kristinita 2
  • Alignment not appearing in Package Control in Sublime Text 4

    Alignment not appearing in Package Control in Sublime Text 4

    I'm setting up a new installation and upgraded to Sublime Text 4. When searching in Package Control, Alignment does not appear in the list of available packages.

    Is Alignment supported in Sublime Text 4?

    image

    opened by becomesaflame 1
  • Support for aligning with declaration words (let,var,const,etc.)

    Support for aligning with declaration words (let,var,const,etc.)

    This seems to solve the main problem I was having with this package for a while, being able to select all my vars and use the alignment to auto-align.

    The declaration words are customizable through the new declarations field in the settings file, by default those are the "var", "let", "const" ones.

    Added : to the list of defailt alignment characters as it is very useful for json formatting. The : will now also get an empty space in front and behind it as well.

    Can format a whole file correctly as well, but it's buggy with longer files. Just have to not select anything in the file to trigger that with the same shortcut.

    Includes fixes from some other PRs in the hope of getting this reviewed and merged in.

    Have tested it for a year+ without having any issues with my usual workflow.

    opened by sylido 0
  • Could you support function comments alignment?

    Could you support function comments alignment?

    Hi, I have installed a sumlime plugin called DocBlockr for better function comments, when I finished writing a function it will looks like this:

    /**
      * Get order list
      * @param  integer $user_id User unique id
      * @param  string $type Type of list data
      * @param  integer $page_size Per page rows
      * @param  integer $last_order_subscribe_id Last list row id
      * @param  integer $need_status_type_map If need return status type map
      * @return json string
      */
      public function getOrderSubscribeList(...) { }
    

    but its not pretty good looks like, I will manually pad spaces to make it looks like this:

    /**
      * Get order list
      * @param  integer $user_id                   User unique id
      * @param  string  $type                      Type of list data
      * @param  integer $page_size                 Per page rows
      * @param  integer $last_order_subscribe_id   Last list row id
      * @param  integer $need_status_type_map      If need return status type map
      * @return json string
      */
      public function getOrderSubscribeList(...) { }
    

    Hope it will possible to support function comments alignment, thank you!

    opened by clms2 0
  • Documentation link outdated. (missing link on wbond.net)

    Documentation link outdated. (missing link on wbond.net)

    opened by ccorneli 2
Owner
Will Bond
Software engineer at @culturerobotics, previously @sublimehq. Author of Package Control and occasional designer. Proud husband and father.
Will Bond
Taskpm - Run multi tasks by PHP multi process

php-pkg-template Run multi tasks by PHP multi process Install composer composer require phppkg/taskpm Usage github: use the template for quick create

PHPPkg 2 Dec 20, 2021
Run multiple websites using the same Laravel installation while keeping tenant specific data separated for fully independent multi-domain setups.

Tenancy for Laravel Enabling awesome Software as a Service with the Laravel framework. This is the successor of hyn/multi-tenant. Feel free to show su

Tenancy 1.1k Dec 30, 2022
Run multiple websites using the same Laravel installation while keeping tenant specific data separated for fully independent multi-domain setups, previously

Run multiple websites using the same Laravel installation while keeping tenant specific data separated for fully independent multi-domain setups, previously

Tenancy 2.4k Jan 3, 2023
Hashtopolis is a multi-platform client-server tool for distributing hashcat tasks to multiple computers.

Hashtopolis is a multi-platform client-server tool for distributing hashcat tasks to multiple computers. The main goals for Hashtopolis's development are portability, robustness, multi-user support, and multiple groups management.

Hashtopolis 1.1k Jan 4, 2023
A Laravel package that allows you to use multiple ".env" files in a precedent manner. Use ".env" files per domain (multi-tentant)!

Laravel Multi ENVs Use multiple .envs files and have a chain of precedence for the environment variables in these different .envs files. Use the .env

Allyson Silva 48 Dec 29, 2022
Log executed Laravel SQL queries and their line number and more

A lightweight laravel package for logging executed SQL queries, line number and more

Md.Harun-Ur-Rashid 31 Dec 21, 2022
Tiny hands is a Laravel multi-tenant boilerplate with SPA and i18n.

About Tiny Hands Tiny hands is a Laravel multi-tenant boilerplate with SPA and i18n using the following technology stack: Backend Laravel 8.0 API with

Bertrand Kintanar 12 Jun 23, 2022
A Multi User Chat Application With Laravel and Livewire

A Multi User Chat Application With Laravel and Livewire. where you can chat with multiple frinds at the same time. i build this with php Laravel and Livewire.

Tauseed 15 Oct 22, 2022
Automatic multi-tenancy for Laravel. No code changes needed.

Tenancy for Laravel — stancl/tenancy Automatic multi-tenancy for your Laravel app. You won't have to change a thing in your application's code. ✔️ No

Samuel Štancl 2.7k Jan 3, 2023
🧙‍♀️ Arcanist takes the pain out of building multi-step form wizards in Laravel.

Installation Arcanist requires PHP 8 and Laravel 8. composer require laravel-arcanist/arcanist Documentation You can find the full documentation here

Arcanist 378 Jan 3, 2023
Multi theme support for Laravel application

Multi theme support for Laravel application This Laravel package adds multi-theme support to your application. It also provides a simple authenticatio

QiroLab 287 Dec 29, 2022
A Laravel extension for using a laravel application on a multi domain setting

Laravel Multi Domain An extension for using Laravel in a multi domain setting Description This package allows a single Laravel installation to work wi

null 658 Jan 6, 2023
Laravel-Mix helper for projects with complex & multi assets.

Laravel-Mix helper for projects with complex & multi assets. ?? Getting started Since mix introduced in laravel 5.4 it is recommended to use this pack

Fandogh 27 Oct 4, 2022
Support multi theme for Laravel application

Very short description of the package This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention o

Ephraïm SEDDOR 1 Dec 1, 2021
Rinvex Tenantable is a contextually intelligent polymorphic Laravel package, for single db multi-tenancy.

Rinvex Tenants is a contextually intelligent polymorphic Laravel package, for single db multi-tenancy. You can completely isolate tenants data with ease using the same database, with full power and control over what data to be centrally shared, and what to be tenant related and therefore isolated from others.

Rinvex 80 Oct 21, 2022
An example of multi-domain/subdomain app in Laravel.

?? UPDATE A better example with online demo: https://github.com/laravel-101/multi-domain-laravel-app Multi-Domain Laravel App An example of multi-doma

DigitalWheat 204 Dec 27, 2022
Bring multi themes support to your Laravel application with a full-featured Themes Manager

Introduction hexadog/laravel-themes-manager is a Laravel package which was created to let you developing multi-themes Laravel application. Installatio

hexadog 86 Dec 15, 2022
Multi layout react laravel

multi-layout-react-laravel multi layout react-laravel is a repository for creating 1 integrated system, this repository uses react(laravel ui) version

null 2 Feb 13, 2022
A dynamic Laravel Livewire component for multi steps form

Livewire component that provides you with a wizard that supports multiple steps form while maintaining state.

Vildan Bina 233 Jan 4, 2023