All Projects → randy3k → Aligntab

randy3k / Aligntab

Licence: mit
An alignment plugin for Sublime Text using regular expression

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Aligntab

Gitgutter
A Sublime Text 2/3 plugin to see git diff in gutter
Stars: ✭ 3,888 (+536.33%)
Mutual labels:  sublime-text
Processing Sublime
A Sublime Text package for the programming language Processing
Stars: ✭ 447 (-26.84%)
Mutual labels:  sublime-text
Sublime Monokai Extended
Extends Monokai from Soda with additional syntax highlighting for Markdown, LESS, HTML, Handlebars and more.
Stars: ✭ 505 (-17.35%)
Mutual labels:  sublime-text
Sublime zk
A SublimeText3 package featuring ID based wiki style links, and #tags, intended for zettelkasten method users. Loaded with tons of features like inline image display, sophisticated tag search, note transclusion features, support for note templates, bibliography support, support for multiple panes, etc. to make working in your Zettelkasten a joy 😄.
Stars: ✭ 408 (-33.22%)
Mutual labels:  sublime-text
Themer
themer is inspired by trevordmiller/nova and chriskempson/base16.
Stars: ✭ 4,483 (+633.72%)
Mutual labels:  sublime-text
Head Pose Estimation
Real-time head pose estimation built with OpenCV and dlib
Stars: ✭ 467 (-23.57%)
Mutual labels:  alignment
Ayu
🎨🖌 Modern Sublime Text theme
Stars: ✭ 3,933 (+543.7%)
Mutual labels:  sublime-text
Javascriptenhancements
JavaScript Enhancements is a plugin for Sublime Text 3. It offers not only a smart javascript autocomplete but also a lot of features about creating, developing and managing javascript projects (real-time errors, code refactoring, etc.).
Stars: ✭ 592 (-3.11%)
Mutual labels:  sublime-text
Mmseqs2
MMseqs2: ultra fast and sensitive search and clustering suite
Stars: ✭ 441 (-27.82%)
Mutual labels:  alignment
Git Peek
git repo to local editor instantly
Stars: ✭ 485 (-20.62%)
Mutual labels:  sublime-text
Wtdbg2
Redbean: A fuzzy Bruijn graph approach to long noisy reads assembly
Stars: ✭ 408 (-33.22%)
Mutual labels:  alignment
Alass
"Automatic Language-Agnostic Subtitle Synchronization"
Stars: ✭ 421 (-31.1%)
Mutual labels:  alignment
Face Landmark
caffe 68 points face-landmark
Stars: ✭ 474 (-22.42%)
Mutual labels:  alignment
Sublime Rails Snippets
Sublime Text snippets for the latest Ruby and Rails versions
Stars: ✭ 406 (-33.55%)
Mutual labels:  sublime-text
Ffsubsync
Automagically synchronize subtitles with video.
Stars: ✭ 5,167 (+745.66%)
Mutual labels:  alignment
Laravel Blade
This package adds syntax definitions for the Laravel Blade engine.
Stars: ✭ 395 (-35.35%)
Mutual labels:  sublime-text
Prnet
Joint 3D Face Reconstruction and Dense Alignment with Position Map Regression Network (ECCV 2018)
Stars: ✭ 4,479 (+633.06%)
Mutual labels:  alignment
Sublime text
Issue tracker for Sublime Text
Stars: ✭ 602 (-1.47%)
Mutual labels:  sublime-text
Sublimecodeintel
💡 Full-featured code intelligence and smart autocomplete for Sublime Text
Stars: ✭ 5,050 (+726.51%)
Mutual labels:  sublime-text
Sublime Jsfmt
jsfmt plugin for Sublime Text
Stars: ✭ 480 (-21.44%)
Mutual labels:  sublime-text

AlignTab

Build Status Build status Coverage Status

The most flexible alignment plugin for Sublime Text 3. This plugin is inspired by the excellent VIM plugin, tabular.

ST2 support is deprecated but however, it is still possible to install AlignTab on ST2 via Package Control.

Features

  • Align using regular expression
  • Custom spacing, padding and justification.
  • Smart detection for alignment if no lines are selected
  • Multiple cursors support
  • Table mode and Live preview mode

Getting started

  • If you only want simple and quick alignment, the predefined alignment will help.

More complicated usage

  • Open AlignTab in Command Palette C+Shift+p and enter the input in the form of <regex>/<option>.
  • To learn more about regular expression, visit here and here.
  • The option controls column justification, padding and maximum number of splits. A general syntax of options is ([rlc][0-9]*)*(f[0-9]*)?.
  • The numbers after r, c or l determine how many spaces will be added after columns and the number after f controls how many matches will be made based <regex>.
  • For example, c2r3f1 means
    • first column is centered followed by 2 spaces
    • second column is right-flushed followed by 3 spaces
    • only the first match is used
  • If the number after [rlc] is omitted, 1 space will be added after each column.
  • If the number after f is omitted, only the first match will be used.
  • The entire option could be omitted (i.e., input only the regular expression). In that case, default option, l1f0 will be used. It means:
    • All columns are left-justified.
    • A space is added after each column.
    • All matched delimiters are aligned.

More about regex and options

  • Use non-capturing parenthese (?:regex) instread of capturing parenthese.
  • Delimiter is also treated as a column.
    • For example, =/rcl means the the column before = will be right-justifed and the column after = will be left-justified. And = will be centered (however, it doesn't matter as = is of length 1).
  • The option for alignment cycles through the columns.
    • For example, regex/rl means all odd columns will be right-justified and all even columns will be left-justified.
  • The symbol * repeats the preceeding justification flags.
    • For example r*3 equals rrr, and (cr3)*2 equals cr3cr3.
  • (Experimental) Besides r, c and l, there is a new u flag which stands for "unjustified".

Live Preview Mode

Table Mode

Hit ESC or use the command AlignTab: Exit Table Mode to exit table mode.

Installation

Package Control

Examples

Some simple examples. You can also contribute your examples there.

Keybinds

If you are interested in getting a keybind for live preview mode, add the following in your user keybinds file.

 {
   "keys": ["super+shift+a"], "command": "align_tab",
   "args" : {"live_preview" : true}
 }

For frequent patterns, you can consider the following in your user keybinds file. Change the keybind and the user_input for your purpose.

 //align =
  {
    "keys": ["super+shift+a"], "command": "align_tab",
    "args" : {"user_input" : "=/f"}
  }

or syntex specific keybind.

  // latex align keybind, to align & and \\, but not \&
    {
    	"keys": ["super+shift+a"], "command": "align_tab",
        "args" : {"user_input" : "(?<!\\\\)&|\\\\\\\\"},
        "context":[
            { "key": "selector", "operator": "equal", "operand": "text.tex.latex" }
        ]
    }

Named patterns

To make it easier to remember complex patterns, you can save them in a dictionary in the settings file. To edit the patterns, launch Preferences: AlignTab Settings. Use the name as key and the regex as value. For examples,

"named_patterns": {
    "eq" : "=/f",
    // right hand side could also be an array of inputs
    "ifthen" : ["=/f", "\\?/f", ":/f"]
}

You then just use the name instead of the pattern in the input field.

Custom Context Menu

To define new item in the context menu, launch Preferences: AlignTab Context Menu and add, for example

[
   {"caption" : "-"},
    {
      "id": "aligntab",
      "caption": "AlignTab",
      "children": [
          {
          "caption" : "{",
          "command" : "align_tab",
          "args"    : {"user_input" : "\\{"}
          }
      ]
  }
]

CJK Support

AlignTab supoorts CJK characters, but you have to choose a correct font face and font size. To my knowledge, MinCho works on all Chinese, Japanese and Korean.

License

AlignTab is licensed under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].