Include: include/setup.vader ########################################################### Given (space-separated columns): 1 22222 33 444 555 6666 7 888 11 222 3333 4 55 6666 77 888 111 22 333 444 55555 6666 7 88888 1111 2 33 444 555 66 777 8 Do (left-align): vip \ *\ Expect: 1 22222 33 444 555 6666 7 888 11 222 3333 4 55 6666 77 888 111 22 333 444 55555 6666 7 88888 1111 2 33 444 555 66 777 8 Do (left-align / cursor position retained): vGww \ *\D Expect: 1 22222 33 444 555 6666 7 888 11 222 3333 4 55 6666 77 888 111 22 333 444 55555 6666 7 88888 1111 2 Do (left-align using operator map): \Aip*\ Expect: 1 22222 33 444 555 6666 7 888 11 222 3333 4 55 6666 77 888 111 22 333 444 55555 6666 7 88888 1111 2 33 444 555 66 777 8 Do (right-align): vip \\ *\ Expect: 1 22222 33 444 555 6666 7 888 11 222 3333 4 55 6666 77 888 111 22 333 444 55555 6666 7 88888 1111 2 33 444 555 66 777 8 Do (center-align): vip \\\ *\ Expect: 1 22222 33 444 555 6666 7 888 11 222 3333 4 55 6666 77 888 111 22 333 444 55555 6666 7 88888 1111 2 33 444 555 66 777 8 Given (comma-separated columns): a,,bbb aa,,bb aaa,,b aaaa,, aaa,b, aa,bb, a,bbb, Do (left-align): vip \ *, Expect: a, , bbb aa, , bb aaa, , b aaaa, , aaa, b, aa, bb, a, bbb, Do (right-align): vip \\ *, Expect: a, , bbb aa, , bb aaa, , b aaaa, , aaa, b, aa, bb, a, bbb, Do (center-align): vip \\\ *, Expect: a, , bbb aa, , bb aaa, , b aaaa, , aaa, b, aa, bb, a, bbb, ########################################################### Given (the beatles): Paul McCartney 1942 George Harrison 1943mmdd Ringo Starr 1940mm Pete Best 1941 Do (around first space): vip \ \ Expect: Paul McCartney 1942 George Harrison 1943mmdd Ringo Starr 1940mm Pete Best 1941 Do (around second space): vip \ 2\ Expect: Paul McCartney 1942 George Harrison 1943mmdd Ringo Starr 1940mm Pete Best 1941 Do (around all spaces): vip \ *\ Expect: Paul McCartney 1942 George Harrison 1943mmdd Ringo Starr 1940mm Pete Best 1941 Do (right-align around all spaces): vip \\ *\ Expect: Paul McCartney 1942 George Harrison 1943mmdd Ringo Starr 1940mm Pete Best 1941 Do (center-align around all spaces): vip \\\ *\ Expect: Paul McCartney 1942 George Harrison 1943mmdd Ringo Starr 1940mm Pete Best 1941 Do (center-align around the last space): vip \\\ -\ Expect: Paul McCartney 1942 George Harrison 1943mmdd Ringo Starr 1940mm Pete Best 1941 Do (right-align around second space): vip \\ 2\ Expect: Paul McCartney 1942 George Harrison 1943mmdd Ringo Starr 1940mm Pete Best 1941 Do (left-right alternating alignment): vip \ **\ Expect: Paul McCartney 1942 George Harrison 1943mmdd Ringo Starr 1940mm Pete Best 1941 Do (right-left alternating alignment): vip \\ **\ Expect: Paul McCartney 1942 George Harrison 1943mmdd Ringo Starr 1940mm Pete Best 1941 Do (with numeric left/right margin): vip \ * \2\ \ \5\ * \ Expect: Paul McCartney 1942 George Harrison 1943mmdd Ringo Starr 1940mm Pete Best 1941 Do (with string left/right margin): vip \ \lft\ \rgt\ *\ Expect: Paul lft rgtMcCartneylft rgt1942 Georgelft rgtHarrison lft rgt1943mmdd Ringo lft rgtStarr lft rgt1940mm Pete lft rgtBest lft rgt1941 Execute (with regular expression): 1,4EasyAlign*/../ Expect: Pa ul Mc Ca rt ne y 19 42 Ge or ge Ha rr is on 19 43 mm dd Ri ng o St ar r 19 40 mm Pe te Be st 19 41 ########################################################### Given ruby (delimiters in comments and strings): xyz="abc=def" a=b#=c Do (align around all =): vip \*= Expect ruby (are not aligned): xyz = "abc=def" a = b#=c ########################################################### Given javascript (json): var jdbc = { // JDBC driver for MySQL database: driver: "com.mysql.jdbc.Driver", /* JDBC URL for the connection (jdbc:mysql://HOSTNAME/DATABASE) */ url: 'jdbc:mysql://localhost/test', database: "test", "user:pass":"r00t:pa55" }; Do (around colons): vip\*: Expect javascript: var jdbc = { // JDBC driver for MySQL database: driver: "com.mysql.jdbc.Driver", /* JDBC URL for the connection (jdbc:mysql://HOSTNAME/DATABASE) */ url: 'jdbc:mysql://localhost/test', database: "test", "user:pass": "r00t:pa55" }; Do (around colons, do not stick to left): vip\*\: Expect javascript: var jdbc = { // JDBC driver for MySQL database: driver : "com.mysql.jdbc.Driver", /* JDBC URL for the connection (jdbc:mysql://HOSTNAME/DATABASE) */ url : 'jdbc:mysql://localhost/test', database : "test", "user:pass" : "r00t:pa55" }; Do (around first colon, do not ignore comments and strings): vip\\*: Expect javascript: var jdbc = { // JDBC driver for MySQL database: driver: "com.mysql.jdbc.Driver", /* JDBC URL for the connection (jdbc: mysql: //HOSTNAME/DATABASE) */ url: 'jdbc: mysql: //localhost/test', database: "test", "user: pass": "r00t: pa55" }; Do (do not ignore comments and strings, do not ignore unmatched): vip\\\*: Expect javascript: var jdbc = { // JDBC driver for MySQL database: driver: "com.mysql.jdbc.Driver", /* JDBC URL for the connection (jdbc: mysql: //HOSTNAME/DATABASE) */ url: 'jdbc: mysql: //localhost/test', database: "test", "user: pass": "r00t: pa55" }; Execute (set g:easy_align_ignore_groups and g:easy_align_ignore_unmatched): let g:easy_align_ignore_unmatched = 0 let g:easy_align_ignore_groups = [] Do (do not ignore comments and strings, do not ignore unmatched using global vars): vip\*: Expect javascript: var jdbc = { // JDBC driver for MySQL database: driver: "com.mysql.jdbc.Driver", /* JDBC URL for the connection (jdbc: mysql: //HOSTNAME/DATABASE) */ url: 'jdbc: mysql: //localhost/test', database: "test", "user: pass": "r00t: pa55" }; Execute (unset g:easy_align_ignore_groups and g:easy_align_ignore_unmatched): unlet g:easy_align_ignore_unmatched unlet g:easy_align_ignore_groups ########################################################### Given (table): | Option| Type | Default | Description | |--|--|--|--| | threads | Fixnum | 1 | number of threads in the thread pool | |queues |Fixnum | 1 | number of concurrent queues | |queue_size | Fixnum | 1000 | size of each queue | | interval | Numeric | 0 | dispatcher interval for batch processing | |batch | Boolean | false | enables batch processing mode | |batch_size | Fixnum | nil | number of maximum items to be assigned at once | |logger | Logger | nil | logger instance for debug logs | Do (around all |): vip\*| Expect: | Option | Type | Default | Description | | -- | -- | -- | -- | | threads | Fixnum | 1 | number of threads in the thread pool | | queues | Fixnum | 1 | number of concurrent queues | | queue_size | Fixnum | 1000 | size of each queue | | interval | Numeric | 0 | dispatcher interval for batch processing | | batch | Boolean | false | enables batch processing mode | | batch_size | Fixnum | nil | number of maximum items to be assigned at once | | logger | Logger | nil | logger instance for debug logs | Do (around all |, and right-align 3rd and center-align the last): vip\*| gv\\3| gv\\\-| Expect: | Option | Type | Default | Description | | -- | -- | -- | -- | | threads | Fixnum | 1 | number of threads in the thread pool | | queues | Fixnum | 1 | number of concurrent queues | | queue_size | Fixnum | 1000 | size of each queue | | interval | Numeric | 0 | dispatcher interval for batch processing | | batch | Boolean | false | enables batch processing mode | | batch_size | Fixnum | nil | number of maximum items to be assigned at once | | logger | Logger | nil | logger instance for debug logs | Do (Left-right alternating alignment): vip\**| Expect: | Option | Type | Default | Description | | -- | -- | -- | -- | | threads | Fixnum | 1 | number of threads in the thread pool | | queues | Fixnum | 1 | number of concurrent queues | | queue_size | Fixnum | 1000 | size of each queue | | interval | Numeric | 0 | dispatcher interval for batch processing | | batch | Boolean | false | enables batch processing mode | | batch_size | Fixnum | nil | number of maximum items to be assigned at once | | logger | Logger | nil | logger instance for debug logs | Do (Right-left alternating alignment): vip\\**| Expect: | Option | Type | Default | Description | | -- | -- | -- | -- | | threads | Fixnum | 1 | number of threads in the thread pool | | queues | Fixnum | 1 | number of concurrent queues | | queue_size | Fixnum | 1000 | size of each queue | | interval | Numeric | 0 | dispatcher interval for batch processing | | batch | Boolean | false | enables batch processing mode | | batch_size | Fixnum | nil | number of maximum items to be assigned at once | | logger | Logger | nil | logger instance for debug logs | Do (Right-left alternating alignment, indent: deep): vip\\**\\| Expect: | Option | Type | Default | Description | | -- | -- | -- | -- | | threads | Fixnum | 1 | number of threads in the thread pool | | queues | Fixnum | 1 | number of concurrent queues | | queue_size | Fixnum | 1000 | size of each queue | | interval | Numeric | 0 | dispatcher interval for batch processing | | batch | Boolean | false | enables batch processing mode | | batch_size | Fixnum | nil | number of maximum items to be assigned at once | | logger | Logger | nil | logger instance for debug logs | # Doesn't work. Why? # Do (Repeat the last command): # :%\=g:easy_align_last_command\\ Execute (Repeat the last command): Log g:easy_align_last_command execute '%'.g:easy_align_last_command Expect: | Option | Type | Default | Description | | -- | -- | -- | -- | | threads | Fixnum | 1 | number of threads in the thread pool | | queues | Fixnum | 1 | number of concurrent queues | | queue_size | Fixnum | 1000 | size of each queue | | interval | Numeric | 0 | dispatcher interval for batch processing | | batch | Boolean | false | enables batch processing mode | | batch_size | Fixnum | nil | number of maximum items to be assigned at once | | logger | Logger | nil | logger instance for debug logs | Do (around all | with no margin, right-align 2nd to last): vip\\0\\0\*| vip\\\0\\0\-2| Expect: |Option |Type |Default|Description | |-- |-- | --|-- | |threads |Fixnum | 1|number of threads in the thread pool | |queues |Fixnum | 1|number of concurrent queues | |queue_size|Fixnum | 1000|size of each queue | |interval |Numeric| 0|dispatcher interval for batch processing | |batch |Boolean| false|enables batch processing mode | |batch_size|Fixnum | nil|number of maximum items to be assigned at once| |logger |Logger | nil|logger instance for debug logs | Do (live interactive mode): vip\\ | \(\ \)\ *** ** \\\ **|\| Expect: |)Option (|) Type(|)Default(|) Description(| |)-- (|) --(|)-- (|) --(| |)threads (|) Fixnum(|)1 (|) number of threads in the thread pool(| |)queues (|) Fixnum(|)1 (|) number of concurrent queues(| |)queue_size(|) Fixnum(|)1000 (|) size of each queue(| |)interval (|)Numeric(|)0 (|) dispatcher interval for batch processing(| |)batch (|)Boolean(|)false (|) enables batch processing mode(| |)batch_size(|) Fixnum(|)nil (|)number of maximum items to be assigned at once(| |)logger (|) Logger(|)nil (|) logger instance for debug logs(| Do (Switching to live interactive mode): vip\ * Switch to live interactive mode \ | \<\ \>\ *** ** \\\ **|\| Expect: |>Option <|> Type<|>Default<|> Description<| |>-- <|> --<|>-- <|> --<| |>threads <|> Fixnum<|>1 <|> number of threads in the thread pool<| |>queues <|> Fixnum<|>1 <|> number of concurrent queues<| |>queue_size<|> Fixnum<|>1000 <|> size of each queue<| |>interval <|>Numeric<|>0 <|> dispatcher interval for batch processing<| |>batch <|>Boolean<|>false <|> enables batch processing mode<| |>batch_size<|> Fixnum<|>nil <|>number of maximum items to be assigned at once<| |>logger <|> Logger<|>nil <|> logger instance for debug logs<| Do (Toggling live interactive mode (delimiter entered)): vip\ * Enable live mode \ |* * Disable live mode \ gg2jdG Expect: | Option | Type | Default | Description | | -- | -- | -- | -- | Do (Toggling live interactive mode (delimiter not entered)): vip\ * Enable live mode \ \ * Disable live mode \ *| gg2jdG Expect: | Option | Type | Default | Description | | -- | -- | -- | -- | Do (live interactive mode!): vip\r\ | \[\ \]\ *** ** \\\ ** \\ \|\ \ \ Expect: [|] Option[|]Type [|]Default[|]Description [| [|] --[|]-- [|] --[|]-- [| [|] threads[|]Fixnum [|] 1[|]number of threads in the thread pool [| [|] queues[|]Fixnum [|] 1[|]number of concurrent queues [| [|]queue_size[|]Fixnum [|] 1000[|]size of each queue [| [|] interval[|]Numeric[|] 0[|]dispatcher interval for batch processing [| [|] batch[|]Boolean[|] false[|]enables batch processing mode [| [|]batch_size[|]Fixnum [|] nil[|]number of maximum items to be assigned at once[| [|] logger[|]Logger [|] nil[|]logger instance for debug logs [| Execute (g:easy_align_last_command should be set): Assert exists('g:easy_align_last_command') unlet g:easy_align_last_command Do: vip\\**|\ Execute (g:easy_align_last_command should not be set if interrupted): Assert !exists('g:easy_align_last_command') Do (g:easy_align_nth is not set (work with default value 1)): vip\| Expect: | Option| Type | Default | Description | | --|--|--|--| | threads | Fixnum | 1 | number of threads in the thread pool | | queues |Fixnum | 1 | number of concurrent queues | | queue_size | Fixnum | 1000 | size of each queue | | interval | Numeric | 0 | dispatcher interval for batch processing | | batch | Boolean | false | enables batch processing mode | | batch_size | Fixnum | nil | number of maximum items to be assigned at once | | logger | Logger | nil | logger instance for debug logs | Execute (set g:easy_align_nth): let g:easy_align_nth = '2' Do (g:easy_align_nth is set as 2): vip\| Expect: | Option | Type | Default | Description | |-- | --|--|--| | threads | Fixnum | 1 | number of threads in the thread pool | |queues | Fixnum | 1 | number of concurrent queues | |queue_size | Fixnum | 1000 | size of each queue | | interval | Numeric | 0 | dispatcher interval for batch processing | |batch | Boolean | false | enables batch processing mode | |batch_size | Fixnum | nil | number of maximum items to be assigned at once | |logger | Logger | nil | logger instance for debug logs | Execute (unset g:easy_align_nth): unlet g:easy_align_nth Execute (set g:easy_align_nth): let g:easy_align_nth = '*' Do (g:easy_align_nth is set as *): vip\| Expect: | Option | Type | Default | Description | | -- | -- | -- | -- | | threads | Fixnum | 1 | number of threads in the thread pool | | queues | Fixnum | 1 | number of concurrent queues | | queue_size | Fixnum | 1000 | size of each queue | | interval | Numeric | 0 | dispatcher interval for batch processing | | batch | Boolean | false | enables batch processing mode | | batch_size | Fixnum | nil | number of maximum items to be assigned at once | | logger | Logger | nil | logger instance for debug logs | Execute (unset g:easy_align_nth): unlet g:easy_align_nth Execute (set g:easy_align_nth): let g:easy_align_nth = '**' Do (g:easy_align_nth is set as **): vip\| Expect: | Option | Type | Default | Description | | -- | -- | -- | -- | | threads | Fixnum | 1 | number of threads in the thread pool | | queues | Fixnum | 1 | number of concurrent queues | | queue_size | Fixnum | 1000 | size of each queue | | interval | Numeric | 0 | dispatcher interval for batch processing | | batch | Boolean | false | enables batch processing mode | | batch_size | Fixnum | nil | number of maximum items to be assigned at once | | logger | Logger | nil | logger instance for debug logs | Execute (unset g:easy_align_nth): unlet g:easy_align_nth Execute (set g:easy_align_nth): let g:easy_align_nth = '-' Do (g:easy_align_nth is set as -): vip\| Expect: | Option| Type | Default | Description | |--|--|--|-- | | threads | Fixnum | 1 | number of threads in the thread pool | |queues |Fixnum | 1 | number of concurrent queues | |queue_size | Fixnum | 1000 | size of each queue | | interval | Numeric | 0 | dispatcher interval for batch processing | |batch | Boolean | false | enables batch processing mode | |batch_size | Fixnum | nil | number of maximum items to be assigned at once | |logger | Logger | nil | logger instance for debug logs | Execute (unset g:easy_align_nth): unlet g:easy_align_nth Execute (set g:easy_align_nth): let g:easy_align_nth = '-2' Do (g:easy_align_nth is set as -2): vip\| Expect: | Option| Type | Default | Description | |--|--|-- | --| | threads | Fixnum | 1 | number of threads in the thread pool | |queues |Fixnum | 1 | number of concurrent queues | |queue_size | Fixnum | 1000 | size of each queue | | interval | Numeric | 0 | dispatcher interval for batch processing | |batch | Boolean | false | enables batch processing mode | |batch_size | Fixnum | nil | number of maximum items to be assigned at once | |logger | Logger | nil | logger instance for debug logs | Execute (unset g:easy_align_nth): unlet g:easy_align_nth ########################################################### Given (comma-separated items): aaa, bb,c d,eeeeeee fffff, gggggggggg, h, , ii j,,k Do (around all commas): vip\*, Expect: aaa, bb, c d, eeeeeee fffff, gggggggggg, h, , ii j, , k Do (around all commas, do not stick to left): vip\\*, Expect: aaa , bb , c d , eeeeeee fffff , gggggggggg , h , , ii j , , k Do (center-align around all commas): vip\\\*, Expect: aaa, bb, c d, eeeeeee fffff, gggggggggg, h, , ii j, , k ########################################################### Given ruby (multi-line ruby Hash): options = { :caching => nil, :versions => 3, "cache=blocks" => false }.merge(options) Do (around the last =): vip\-= Expect ruby: options = { :caching => nil, :versions => 3, "cache=blocks" => false }.merge(options) Do (partial alignment): f: \jj3E \\= Expect ruby: options = { :caching => nil, :versions => 3, "cache=blocks" => false }.merge(options) ########################################################### Given c (C code with comments 1): /* a */ b = c aa >= bb // aaa = bbb = cccc /* aaaa = */ bbbb === cccc " = dddd = " = eeee aaaaa /* bbbbb */ == ccccc /* != eeeee = */ === fffff Do: vip\*= Expect c: /* a */ b = c aa >= bb // aaa = bbb = cccc /* aaaa = */ bbbb === cccc " = dddd = " = eeee aaaaa /* bbbbb */ == ccccc /* != eeeee = */ === fffff Do: vip\\\*= Expect c: /* a */ b = c aa >= bb // aaa = bbb = cccc /* aaaa = */ bbbb === cccc " = dddd = " = eeee aaaaa /* bbbbb */ == ccccc /* != eeeee = */ === fffff ########################################################### Given c (C code with comments 2): int a = 1; long b = 2; float c = 3; string d = 4; // this line should not get aligned long int e = 5; std::map f; std::map g; /* this? */ short h /* how about this? */ = 6; string i = "asdf"; Do (around =): vip\= Expect c: int a = 1; long b = 2; float c = 3; string d = 4; // this line should not get aligned long int e = 5; std::map f; std::map g; /* this? */ short h /* how about this? */ = 6; string i = "asdf"; Do (right-align around =, comment lines are ignored): vip\\= Expect c: int a = 1; long b = 2; float c = 3; string d = 4; // this line should not get aligned long int e = 5; std::map f; std::map g; /* this? */ short h /* how about this? */ = 6; string i = "asdf"; Do (right-align around =, do not ignore comment lines): vip\\\= Expect c: int a = 1; long b = 2; float c = 3; string d = 4; // this line should not get aligned long int e = 5; std::map f; std::map g; /* this? */ short h /* how about this? */ = 6; string i = "asdf"; ########################################################### Given ruby (= operators): a = a = 1 bbbb .= 2 ccccccc = 3 ccccccccccccccc ddd = # eeee === eee = eee = eee=f fff = ggg += gg &&= gg g != hhhhhhhh == # 8 i := 5 i %= 5 i *= 5 j =~ 5 j >= 5 aa => 123 aa <<= 123 aa >>= 123 bbb => 123 c => 1233123 d => 123 dddddd &&= 123 dddddd ||= 123 dddddd /= 123 gg <=> ee Do (1st =): vip\= Expect ruby: a = a = 1 bbbb .= 2 ccccccc = 3 ccccccccccccccc ddd = # eeee === eee = eee = eee=f fff = ggg += gg &&= gg g != hhhhhhhh == # 8 i := 5 i %= 5 i *= 5 j =~ 5 j >= 5 aa => 123 aa <<= 123 aa >>= 123 bbb => 123 c => 1233123 d => 123 dddddd &&= 123 dddddd ||= 123 dddddd /= 123 gg <=> ee Do (LR =): vip\**= Expect ruby: a = a = 1 bbbb .= 2 ccccccc = 3 ccccccccccccccc ddd = # eeee === eee = eee = eee = f fff = ggg += gg &&= gg g != hhhhhhhh == # 8 i := 5 i %= 5 i *= 5 j =~ 5 j >= 5 aa => 123 aa <<= 123 aa >>= 123 bbb => 123 c => 1233123 d => 123 dddddd &&= 123 dddddd ||= 123 dddddd /= 123 gg <=> ee Do (DEPRECATED: Alignment using mode_sequence, delimiter_align): vip\\\cr*\\= Expect ruby: a = a = 1 bbbb .= 2 ccccccc = 3 ccccccccccccccc ddd = # eeee === eee = eee = eee = f fff = ggg += gg &&= gg g != hhhhhhhh == # 8 i := 5 i %= 5 i *= 5 j =~ 5 j >= 5 aa => 123 aa <<= 123 aa >>= 123 bbb => 123 c => 1233123 d => 123 dddddd &&= 123 dddddd ||= 123 dddddd /= 123 gg <=> ee Do (Alignment using align, delimiter_align): vip\\\cr*\\= Expect ruby: a = a = 1 bbbb .= 2 ccccccc = 3 ccccccccccccccc ddd = # eeee === eee = eee = eee = f fff = ggg += gg &&= gg g != hhhhhhhh == # 8 i := 5 i %= 5 i *= 5 j =~ 5 j >= 5 aa => 123 aa <<= 123 aa >>= 123 bbb => 123 c => 1233123 d => 123 dddddd &&= 123 dddddd ||= 123 dddddd /= 123 gg <=> ee Do (DEPRECATED: mode_sequence starting from 2nd, delimiter_align = center): vip\\\rc**\\\2= Expect ruby: a = a = 1 bbbb .= 2 ccccccc = 3 ccccccccccccccc ddd = # eeee === eee = eee = eee = f fff = ggg += gg &&= gg g != hhhhhhhh == # 8 i := 5 i %= 5 i *= 5 j =~ 5 j >= 5 aa => 123 aa <<= 123 aa >>= 123 bbb => 123 c => 1233123 d => 123 dddddd &&= 123 dddddd ||= 123 dddddd /= 123 gg <=> ee Do (align starting from 2nd, delimiter_align = center): vip\\\rc**\\\2= Expect ruby: a = a = 1 bbbb .= 2 ccccccc = 3 ccccccccccccccc ddd = # eeee === eee = eee = eee = f fff = ggg += gg &&= gg g != hhhhhhhh == # 8 i := 5 i %= 5 i *= 5 j =~ 5 j >= 5 aa => 123 aa <<= 123 aa >>= 123 bbb => 123 c => 1233123 d => 123 dddddd &&= 123 dddddd ||= 123 dddddd /= 123 gg <=> ee Do (around all =s, do not ignore unmatched): vip\\ \0\ \0\ \\ *= Expect ruby: a = a = 1 bbbb .= 2 ccccccc = 3 ccccccccccccccc ddd = # eeee ===eee = eee = eee=f fff = ggg +=gg &&=gg g != hhhhhhhh==# 8 i := 5 i %= 5 i *= 5 j =~ 5 j >= 5 aa => 123 aa <<=123 aa >>=123 bbb => 123 c => 1233123 d => 123 dddddd &&=123 dddddd ||=123 dddddd /= 123 gg <=>ee Do (Center-align around 2nd =): vip\\\2= Expect ruby: a = a = 1 bbbb .= 2 ccccccc = 3 ccccccccccccccc ddd = # eeee === eee = eee = eee=f fff = ggg += gg &&= gg g != hhhhhhhh == # 8 i := 5 i %= 5 i *= 5 j =~ 5 j >= 5 aa => 123 aa <<= 123 aa >>= 123 bbb => 123 c => 1233123 d => 123 dddddd &&= 123 dddddd ||= 123 dddddd /= 123 gg <=> ee ########################################################### Given ruby (Trailing ruby line comment): apple = 1 # comment not aligned apricot = 'DAD' + 'F#AD' banana = 'Gros Michel' ## comment 2 Do (around the last spaces): vip\-\ Expect ruby: apple = 1 # comment not aligned apricot = 'DAD' + 'F#AD' banana = 'Gros Michel' ## comment 2 Do (using # rule): vip\\# Expect ruby: apple = 1 # comment not aligned apricot = 'DAD' + 'F#AD' banana = 'Gros Michel' ## comment 2 Do (using regular expression): vip\= gv\ \\\ \ \#\+\ Expect ruby: apple = 1 # comment not aligned apricot = 'DAD' + 'F#AD' banana = 'Gros Michel' ## comment 2 ########################################################### Given (method chain): my_object .method1.chain .second_method.call .third.call .method_4.execute Do (around all .): vip\*. Expect: my_object .method1 .chain .second_method.call .third .call .method_4 .execute Do (around all . with deep indentation): vip\\\*. Expect: my_object .method1 .chain .second_method.call .third .call .method_4 .execute Execute (set g:easy_align_indentation): let g:easy_align_indentation = 'd' Do (around all . with deep indentation): vip\*. Expect: my_object .method1 .chain .second_method.call .third .call .method_4 .execute Execute (unset g:easy_align_indentation): unlet g:easy_align_indentation Do (right-align around all .): vip\\*. Expect: my_object . method1. chain .second_method. call . third. call . method_4.execute ########################################################### Execute (define d rule): let g:easy_align_delimiters.d = \ { 'pattern': '\s\+\(\S\+\s*[;=]\)\@=', 'left_margin': 0, 'right_margin': 0 } Given c (complex var dec): const char* str = "Hello"; int64_t count = 1 + 2; static double pi = 3.14; static std::map* scores = pointer; Do (using d rule): vip\d gv\= Expect c: const char* str = "Hello"; int64_t count = 1 + 2; static double pi = 3.14; static std::map* scores = pointer; ########################################################### Given (indented code): apple = 1 banana = 2 cake = 3 daisy = 4 eggplant = 5 Do: vip\= Expect: apple = 1 banana = 2 cake = 3 daisy = 4 eggplant = 5 Do (shallow indentation): vip\\= Expect: apple = 1 banana = 2 cake = 3 daisy = 4 eggplant = 5 Do (deep indentation): vip\\\= Expect: apple = 1 banana = 2 cake = 3 daisy = 4 eggplant = 5 Do (no indentation): vip\\\\= Expect: apple = 1 banana = 2 cake = 3 daisy = 4 eggplant = 5 Do (right-align, shallow indentation): vip\\\= Expect: apple = 1 banana = 2 cake = 3 daisy = 4 eggplant = 5 Do (center-align, shallow indentation): vip\\\\= Expect: apple = 1 banana = 2 cake = 3 daisy = 4 eggplant = 5 Do (right-align, deep indentation): vip\\\\= Expect: apple = 1 banana = 2 cake = 3 daisy = 4 eggplant = 5 Do (center-align, deep indentation): vip\\\\\= Expect: apple = 1 banana = 2 cake = 3 daisy = 4 eggplant = 5 Do (right-align, no indentation): vip\\\\\= ########################################################### Expect: apple = 1 banana = 2 cake = 3 daisy = 4 eggplant = 5 Given (Center-align cases): aaaa = 123456778901234567890 = cccccccccccccc = 12345678 = aaaa = 123456778901234567890 = bbbbbb = 4 cccccccccccccccccc = 12345678 = aaaa = 123456778901234567890 = cccccccccccccccccc = 12345678 = aaaaa = 123456778901234567890 = cc = 12345678 = aaaaa = 123456778901234567890 = bbbbbbbbbb = 12345 = aaaaa = 123456778901234567890 = cccccccccccccccccc = 123 = aaaaa = 123456778901234567890 = cccccccccccccccccc = 12345678 = aaaaa = 12345 = bbbbbbbbbb = 123456778901234567890 = aaaaa = 12345 bbbbbbbbbb = 123456778901234567890 Do: vip\\\= }jvip\\\= }jvip\\\= }jvip\\\= }jvip\\\2= }jvip\\\2= }jvip\\\2= }jvip\\\2= }jvip\\\2= Expect: aaaa = 123456778901234567890 = cccccccccccccc = 12345678 = aaaa = 123456778901234567890 = bbbbbb = 4 cccccccccccccccccc = 12345678 = aaaa = 123456778901234567890 = cccccccccccccccccc = 12345678 = aaaaa = 123456778901234567890 = cc = 12345678 = aaaaa = 123456778901234567890 = bbbbbbbbbb = 12345 = aaaaa = 123456778901234567890 = cccccccccccccccccc = 123 = aaaaa = 123456778901234567890 = cccccccccccccccccc = 12345678 = aaaaa = 12345 = bbbbbbbbbb = 123456778901234567890 = aaaaa = 12345 bbbbbbbbbb = 123456778901234567890 ########################################################### Given (long delimiter): ...-.----- ..--..---- .---...--- ----....-- .---.....- ..--...... ...-.....- Do: vip\*\-\+\ Expect: ... - . ----- .. -- .. ---- . --- ... --- ---- .... -- . --- ..... - .. -- ...... ... - ..... - Do: vip\*\\-\+\ Expect: ... - . ----- .. -- .. ---- . --- ... --- ---- .... -- . --- ..... - .. -- ...... ... - ..... - Do: vip\*\\\-\+\ Expect: ... - . ----- .. -- .. ---- . --- ... --- ---- .... -- . --- ..... - .. -- ...... ... - ..... - Execute (set g:easy_align_delimiter_align): let g:easy_align_delimiter_align = 'c' Do: vip\*\-\+\ Expect: ... - . ----- .. -- .. ---- . --- ... --- ---- .... -- . --- ..... - .. -- ...... ... - ..... - Execute (unset g:easy_align_delimiter_align): unlet g:easy_align_delimiter_align ########################################################### Execute (set g:easy_align_interactive_modes): let g:easy_align_interactive_modes = ['r', 'c'] let g:easy_align_bang_interactive_modes = ['c', 'l'] Given (Test g:easy_align_interactive_modes): a = 1 bb = 2 ccc = 3 Do: vip\= Expect: a = 1 bb = 2 ccc = 3 Do: vip\\= Expect: a = 1 bb = 2 ccc = 3 Do: vipr\= Expect: a = 1 bb = 2 ccc = 3 Do: vipr\\= Expect: a = 1 bb = 2 ccc = 3 Do: vipr\\\= Expect: a = 1 bb = 2 ccc = 3 Execute (unset g:easy_align_interactive_modes): unlet g:easy_align_interactive_modes unlet g:easy_align_bang_interactive_modes ########################################################### Given (Test ignore_unmatched behavior): a = b = c aabba = bbbbb Do (left-align): vip\*= Expect: a = b = c aabba = bbbbb Do (left-align, no ignore_unmatched): vip\\*= Expect: a = b = c aabba = bbbbb Do (right-align): vip\\*= Expect: a = b = c aabba = bbbbb Do (right-align, explicit ignore_unmatched): vip\\\\*= Expect: a = b = c aabba = bbbbb Do (center-align): vip\\\*= Expect: a = b = c aabba = bbbbb Do (center-align): vip\\\\\*= Expect: a = b = c aabba = bbbbb ########################################################### Given (test filter option): aaa=aaa=aaa aaaaa=aaaaa=aaaaa aaaaaaa=aaaaaaa=aaaaaaab bbbbb=bbbbb=bbbbb aaa=aaa=aaa Do (g/a/): vip\ \g/a/\ *= Expect: aaa = aaa = aaa aaaaa = aaaaa = aaaaa aaaaaaa = aaaaaaa = aaaaaaab bbbbb=bbbbb=bbbbb aaa = aaa = aaa Do (g/a - you can omit the trailing /): vip\ \g/a\ *= Expect: aaa = aaa = aaa aaaaa = aaaaa = aaaaa aaaaaaa = aaaaaaa = aaaaaaab bbbbb=bbbbb=bbbbb aaa = aaa = aaa Do (v/b/): vip\ \v/b/\ *= Expect: aaa = aaa = aaa aaaaa = aaaaa = aaaaa aaaaaaa=aaaaaaa=aaaaaaab bbbbb=bbbbb=bbbbb aaa = aaa = aaa Do (invalid filter expression): vip\ \haha\ *= Expect: aaa = aaa = aaa aaaaa = aaaaa = aaaaa aaaaaaa = aaaaaaa = aaaaaaab bbbbb = bbbbb = bbbbb aaa = aaa = aaa Execute (g-filter in shorthand notation): %EasyAlign*=g/a/ Expect: aaa = aaa = aaa aaaaa = aaaaa = aaaaa aaaaaaa = aaaaaaa = aaaaaaab bbbbb=bbbbb=bbbbb aaa = aaa = aaa Execute (v-filter in shorthand notation): %EasyAlign*=v/b/ Expect: aaa = aaa = aaa aaaaa = aaaaa = aaaaa aaaaaaa=aaaaaaa=aaaaaaab bbbbb=bbbbb=bbbbb aaa = aaa = aaa Execute (filter in dictionary format): %EasyAlign*={'filter': 'v/b/'} Expect: aaa = aaa = aaa aaaaa = aaaaa = aaaaa aaaaaaa=aaaaaaa=aaaaaaab bbbbb=bbbbb=bbbbb aaa = aaa = aaa Given clojure (filter with blockwise-visual mode): (let [a 1 bbb 2 ccccc (range 10 20)] (prn [a bbb ccccc])) Do (filter with blockwise-visual mode): f[ vi[ \ \ \g/^\S\ \ Expect clojure: (let [a 1 bbb 2 ccccc (range 10 20)] (prn [a bbb ccccc])) Given clojure: {:user {:plugins [[cider/cider-nrepl "0.9.1"] [lein-kibit "0.0.8"] [lein-licenses "0.1.1"] [lein-marginalia "0.8.0"] ; lein marg [codox "0.8.13"] ; lein doc [com.jakemccrary/lein-test-refresh "0.10.0"] ; lein test-refresh [lein-pprint "1.1.2"] [lein-exec "0.3.5"] [jonase/eastwood "0.2.1"]] :dependencies [[slamhound "1.5.5"]] :aliases {"slamhound" ["run" "-m" "slam.hound"]} :signing {:gpg-key "FEF9C627"}}} Do (Virtual column should be used in blockwise-visual mode): :set ve=block\ f[ vi[ \ $20l \\ Expect clojure: {:user {:plugins [[cider/cider-nrepl "0.9.1"] [lein-kibit "0.0.8"] [lein-licenses "0.1.1"] [lein-marginalia "0.8.0"] ; lein marg [codox "0.8.13"] ; lein doc [com.jakemccrary/lein-test-refresh "0.10.0"] ; lein test-refresh [lein-pprint "1.1.2"] [lein-exec "0.3.5"] [jonase/eastwood "0.2.1"]] :dependencies [[slamhound "1.5.5"]] :aliases {"slamhound" ["run" "-m" "slam.hound"]} :signing {:gpg-key "FEF9C627"}}} Then: set ve= ########################################################### Given (hard-tab indentation (#19)): a=1=3 bbb=2=4 ccccc=4=5 fff=4=6 Do (Left alignment): vip\= Expect: a = 1=3 bbb = 2=4 ccccc = 4=5 fff = 4=6 Do (Right alignment): vip\\= Expect: a = 1=3 bbb = 2=4 ccccc = 4=5 fff = 4=6 Do (Center alignment): vip\\\= Expect: a = 1=3 bbb = 2=4 ccccc = 4=5 fff = 4=6 Do (Left alignment with shallow indentation): vip\\= Expect: a = 1=3 bbb = 2=4 ccccc = 4=5 fff = 4=6 Do (Center alignment with deep indentation): vip\\\\\= Expect: a = 1=3 bbb = 2=4 ccccc = 4=5 fff = 4=6 Given (hard-tab indentation - dictionary (#19)): ddict={'homePage':'360452', 'key':'TEST', 'name':'DocumentationAPITestingSpace', 'type':'global', 'url':'http://localhost:8090/display/TEST'} Do (Right alignment): vip\\: Expect: ddict={'homePage': '360452', 'key': 'TEST', 'name': 'DocumentationAPITestingSpace', 'type': 'global', 'url': 'http://localhost:8090/display/TEST'} ########################################################### Given (Two paragraphs (requires vim-repeat)): a = 1 bb = 2 ccc = 3 dddd = 4 d = 1 cc = 2 bbb = 3 aaaa = 4 _____ = 5 Do (Align and repeat): \Aip\= 6G . Expect: a = 1 bb = 2 ccc = 3 dddd = 4 d = 1 cc = 2 bbb = 3 aaaa = 4 _____ = 5 Do (Visual-mode operator is also repeatable): vip\\= 6G . Expect: a = 1 bb = 2 ccc = 3 dddd = 4 d = 1 cc = 2 bbb = 3 aaaa = 4 _____ = 5 Do (Repeatable in visual mode): 2GvG\. Expect: a = 1 bb = 2 ccc = 3 dddd = 4 d = 1 cc = 2 bbb = 3 aaaa = 4 _____ = 5 Given: :: a : 1 :: bb : 2 :: ccc : 3 :: dd : 4 :: e : 5 :: :: a:1 :: :: b :2 :: :: ccc : 3 :: :: dd : 4 :: :: e : 5 :: :: f : 6 Do (Blockwise-visual-operator is also repeatable): fa \ f1 4j \: 7G0 fa . Expect: :: a: 1 :: bb: 2 :: ccc: 3 :: dd: 4 :: e: 5 :: :: a: 1 :: :: b: 2 :: :: ccc: 3 :: :: dd: 4 :: :: e: 5 :: :: f : 6 ########################################################### Include: include/teardown.vader