Skip to content

Support running as a command #26

@arp242

Description

@arp242

Right now the only way to invoke this plugin is to use mappings (gl and gL by default). Because I don't align things very often, this is somewhat hard to memorize, and using a command which accepts a range is more useful (e.g. :LionLeft or :AlignLeft), similar to :Tabularize.

Any thoughts on this? Because everything is defined as a script-local function with s: adding this isn't so easy. I tried adding a command with :normal, and ended up with:

command! -range -nargs=1 AlignLeft  exe "normal gvgl<args>"
command! -range -nargs=1 AlignRight exe "normal gvgL<args>"

But this isn't ideal as e.g. 50,100:AlignLeft , won't work, and you need to use AlignLeft \" instead of just :AlignLeft ". Not sure how to do it better though.

Personally I think it would be useful to at least facilitate/document this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions