interactive.vader 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886
  1. Include: include/setup.vader
  2. ###########################################################
  3. Given (space-separated columns):
  4. 1 22222 33 444 555 6666 7 888
  5. 11 222 3333 4 55 6666 77 888
  6. 111 22 333 444 55555 6666 7 88888
  7. 1111 2 33 444 555 66 777 8
  8. Do (left-align):
  9. vip
  10. \<Enter>
  11. *\<Space>
  12. Expect:
  13. 1 22222 33 444 555 6666 7 888
  14. 11 222 3333 4 55 6666 77 888
  15. 111 22 333 444 55555 6666 7 88888
  16. 1111 2 33 444 555 66 777 8
  17. Do (left-align / cursor position retained):
  18. vGww
  19. \<Enter>
  20. *\<Space>D
  21. Expect:
  22. 1 22222 33 444 555 6666 7 888
  23. 11 222 3333 4 55 6666 77 888
  24. 111 22 333 444 55555 6666 7 88888
  25. 1111 2
  26. Do (left-align using operator map):
  27. \<Space>Aip*\<Space>
  28. Expect:
  29. 1 22222 33 444 555 6666 7 888
  30. 11 222 3333 4 55 6666 77 888
  31. 111 22 333 444 55555 6666 7 88888
  32. 1111 2 33 444 555 66 777 8
  33. Do (right-align):
  34. vip
  35. \<Enter>\<Enter>
  36. *\<Space>
  37. Expect:
  38. 1 22222 33 444 555 6666 7 888
  39. 11 222 3333 4 55 6666 77 888
  40. 111 22 333 444 55555 6666 7 88888
  41. 1111 2 33 444 555 66 777 8
  42. Do (center-align):
  43. vip
  44. \<Enter>\<Enter>\<Enter>
  45. *\<Space>
  46. Expect:
  47. 1 22222 33 444 555 6666 7 888
  48. 11 222 3333 4 55 6666 77 888
  49. 111 22 333 444 55555 6666 7 88888
  50. 1111 2 33 444 555 66 777 8
  51. Given (comma-separated columns):
  52. a,,bbb
  53. aa,,bb
  54. aaa,,b
  55. aaaa,,
  56. aaa,b,
  57. aa,bb,
  58. a,bbb,
  59. Do (left-align):
  60. vip
  61. \<Enter>
  62. *,
  63. Expect:
  64. a, , bbb
  65. aa, , bb
  66. aaa, , b
  67. aaaa, ,
  68. aaa, b,
  69. aa, bb,
  70. a, bbb,
  71. Do (right-align):
  72. vip
  73. \<Enter>\<Enter>
  74. *,
  75. Expect:
  76. a, , bbb
  77. aa, , bb
  78. aaa, , b
  79. aaaa, ,
  80. aaa, b,
  81. aa, bb,
  82. a, bbb,
  83. Do (center-align):
  84. vip
  85. \<Enter>\<Enter>\<Enter>
  86. *,
  87. Expect:
  88. a, , bbb
  89. aa, , bb
  90. aaa, , b
  91. aaaa, ,
  92. aaa, b,
  93. aa, bb,
  94. a, bbb,
  95. ###########################################################
  96. Given (the beatles):
  97. Paul McCartney 1942
  98. George Harrison 1943mmdd
  99. Ringo Starr 1940mm
  100. Pete Best 1941
  101. Do (around first space):
  102. vip
  103. \<Enter>
  104. \<Space>
  105. Expect:
  106. Paul McCartney 1942
  107. George Harrison 1943mmdd
  108. Ringo Starr 1940mm
  109. Pete Best 1941
  110. Do (around second space):
  111. vip
  112. \<Enter>
  113. 2\<Space>
  114. Expect:
  115. Paul McCartney 1942
  116. George Harrison 1943mmdd
  117. Ringo Starr 1940mm
  118. Pete Best 1941
  119. Do (around all spaces):
  120. vip
  121. \<Enter>
  122. *\<Space>
  123. Expect:
  124. Paul McCartney 1942
  125. George Harrison 1943mmdd
  126. Ringo Starr 1940mm
  127. Pete Best 1941
  128. Do (right-align around all spaces):
  129. vip
  130. \<Enter>\<Enter>
  131. *\<Space>
  132. Expect:
  133. Paul McCartney 1942
  134. George Harrison 1943mmdd
  135. Ringo Starr 1940mm
  136. Pete Best 1941
  137. Do (center-align around all spaces):
  138. vip
  139. \<Enter>\<Enter>\<Enter>
  140. *\<Space>
  141. Expect:
  142. Paul McCartney 1942
  143. George Harrison 1943mmdd
  144. Ringo Starr 1940mm
  145. Pete Best 1941
  146. Do (center-align around the last space):
  147. vip
  148. \<Enter>\<Enter>\<Enter>
  149. -\<Space>
  150. Expect:
  151. Paul McCartney 1942
  152. George Harrison 1943mmdd
  153. Ringo Starr 1940mm
  154. Pete Best 1941
  155. Do (right-align around second space):
  156. vip
  157. \<Enter>\<Enter>
  158. 2\<Space>
  159. Expect:
  160. Paul McCartney 1942
  161. George Harrison 1943mmdd
  162. Ringo Starr 1940mm
  163. Pete Best 1941
  164. Do (left-right alternating alignment):
  165. vip
  166. \<Enter>
  167. **\<Space>
  168. Expect:
  169. Paul McCartney 1942
  170. George Harrison 1943mmdd
  171. Ringo Starr 1940mm
  172. Pete Best 1941
  173. Do (right-left alternating alignment):
  174. vip
  175. \<Enter>\<Enter>
  176. **\<Space>
  177. Expect:
  178. Paul McCartney 1942
  179. George Harrison 1943mmdd
  180. Ringo Starr 1940mm
  181. Pete Best 1941
  182. Do (with numeric left/right margin):
  183. vip
  184. \<Enter>
  185. *
  186. \<C-L>2\<Enter>
  187. \<Enter>
  188. \<C-R>5\<Enter>
  189. *
  190. \<Space>
  191. Expect:
  192. Paul McCartney 1942
  193. George Harrison 1943mmdd
  194. Ringo Starr 1940mm
  195. Pete Best 1941
  196. Do (with string left/right margin):
  197. vip
  198. \<Enter>
  199. \<C-L>lft\<Enter>
  200. \<C-R>rgt\<Enter>
  201. *\<Space>
  202. Expect:
  203. Paul lft rgtMcCartneylft rgt1942
  204. Georgelft rgtHarrison lft rgt1943mmdd
  205. Ringo lft rgtStarr lft rgt1940mm
  206. Pete lft rgtBest lft rgt1941
  207. Execute (with regular expression):
  208. 1,4EasyAlign*/../
  209. Expect:
  210. Pa ul Mc Ca rt ne y 19 42
  211. Ge or ge Ha rr is on 19 43 mm dd
  212. Ri ng o St ar r 19 40 mm
  213. Pe te Be st 19 41
  214. ###########################################################
  215. Given ruby (delimiters in comments and strings):
  216. xyz="abc=def"
  217. a=b#=c
  218. Do (align around all =):
  219. vip
  220. \<Enter>*=
  221. Expect ruby (are not aligned):
  222. xyz = "abc=def"
  223. a = b#=c
  224. ###########################################################
  225. Given javascript (json):
  226. var jdbc = {
  227. // JDBC driver for MySQL database:
  228. driver: "com.mysql.jdbc.Driver",
  229. /* JDBC URL for the connection (jdbc:mysql://HOSTNAME/DATABASE) */
  230. url: 'jdbc:mysql://localhost/test',
  231. database: "test",
  232. "user:pass":"r00t:pa55"
  233. };
  234. Do (around colons):
  235. vip\<Enter>*:
  236. Expect javascript:
  237. var jdbc = {
  238. // JDBC driver for MySQL database:
  239. driver: "com.mysql.jdbc.Driver",
  240. /* JDBC URL for the connection (jdbc:mysql://HOSTNAME/DATABASE) */
  241. url: 'jdbc:mysql://localhost/test',
  242. database: "test",
  243. "user:pass": "r00t:pa55"
  244. };
  245. Do (around colons, do not stick to left):
  246. vip\<Enter>*\<Right>:
  247. Expect javascript:
  248. var jdbc = {
  249. // JDBC driver for MySQL database:
  250. driver : "com.mysql.jdbc.Driver",
  251. /* JDBC URL for the connection (jdbc:mysql://HOSTNAME/DATABASE) */
  252. url : 'jdbc:mysql://localhost/test',
  253. database : "test",
  254. "user:pass" : "r00t:pa55"
  255. };
  256. Do (around first colon, do not ignore comments and strings):
  257. vip\<Enter>\<C-G>*:
  258. Expect javascript:
  259. var jdbc = {
  260. // JDBC driver for MySQL database:
  261. driver: "com.mysql.jdbc.Driver",
  262. /* JDBC URL for the connection (jdbc: mysql: //HOSTNAME/DATABASE) */
  263. url: 'jdbc: mysql: //localhost/test',
  264. database: "test",
  265. "user: pass": "r00t: pa55"
  266. };
  267. Do (do not ignore comments and strings, do not ignore unmatched):
  268. vip\<Enter>\<C-G>\<C-U>*:
  269. Expect javascript:
  270. var jdbc = {
  271. // JDBC driver for MySQL database:
  272. driver: "com.mysql.jdbc.Driver",
  273. /* JDBC URL for the connection (jdbc: mysql: //HOSTNAME/DATABASE) */
  274. url: 'jdbc: mysql: //localhost/test',
  275. database: "test",
  276. "user: pass": "r00t: pa55"
  277. };
  278. Execute (set g:easy_align_ignore_groups and g:easy_align_ignore_unmatched):
  279. let g:easy_align_ignore_unmatched = 0
  280. let g:easy_align_ignore_groups = []
  281. Do (do not ignore comments and strings, do not ignore unmatched using global vars):
  282. vip\<Enter>*:
  283. Expect javascript:
  284. var jdbc = {
  285. // JDBC driver for MySQL database:
  286. driver: "com.mysql.jdbc.Driver",
  287. /* JDBC URL for the connection (jdbc: mysql: //HOSTNAME/DATABASE) */
  288. url: 'jdbc: mysql: //localhost/test',
  289. database: "test",
  290. "user: pass": "r00t: pa55"
  291. };
  292. Execute (unset g:easy_align_ignore_groups and g:easy_align_ignore_unmatched):
  293. unlet g:easy_align_ignore_unmatched
  294. unlet g:easy_align_ignore_groups
  295. ###########################################################
  296. Given (table):
  297. | Option| Type | Default | Description |
  298. |--|--|--|--|
  299. | threads | Fixnum | 1 | number of threads in the thread pool |
  300. |queues |Fixnum | 1 | number of concurrent queues |
  301. |queue_size | Fixnum | 1000 | size of each queue |
  302. | interval | Numeric | 0 | dispatcher interval for batch processing |
  303. |batch | Boolean | false | enables batch processing mode |
  304. |batch_size | Fixnum | nil | number of maximum items to be assigned at once |
  305. |logger | Logger | nil | logger instance for debug logs |
  306. Do (around all |):
  307. vip\<Enter>*|
  308. Expect:
  309. | Option | Type | Default | Description |
  310. | -- | -- | -- | -- |
  311. | threads | Fixnum | 1 | number of threads in the thread pool |
  312. | queues | Fixnum | 1 | number of concurrent queues |
  313. | queue_size | Fixnum | 1000 | size of each queue |
  314. | interval | Numeric | 0 | dispatcher interval for batch processing |
  315. | batch | Boolean | false | enables batch processing mode |
  316. | batch_size | Fixnum | nil | number of maximum items to be assigned at once |
  317. | logger | Logger | nil | logger instance for debug logs |
  318. Do (around all |, and right-align 3rd and center-align the last):
  319. vip\<Enter>*|
  320. gv\<Enter>\<Enter>3|
  321. gv\<Enter>\<Enter>\<Enter>-|
  322. Expect:
  323. | Option | Type | Default | Description |
  324. | -- | -- | -- | -- |
  325. | threads | Fixnum | 1 | number of threads in the thread pool |
  326. | queues | Fixnum | 1 | number of concurrent queues |
  327. | queue_size | Fixnum | 1000 | size of each queue |
  328. | interval | Numeric | 0 | dispatcher interval for batch processing |
  329. | batch | Boolean | false | enables batch processing mode |
  330. | batch_size | Fixnum | nil | number of maximum items to be assigned at once |
  331. | logger | Logger | nil | logger instance for debug logs |
  332. Do (Left-right alternating alignment):
  333. vip\<Enter>**|
  334. Expect:
  335. | Option | Type | Default | Description |
  336. | -- | -- | -- | -- |
  337. | threads | Fixnum | 1 | number of threads in the thread pool |
  338. | queues | Fixnum | 1 | number of concurrent queues |
  339. | queue_size | Fixnum | 1000 | size of each queue |
  340. | interval | Numeric | 0 | dispatcher interval for batch processing |
  341. | batch | Boolean | false | enables batch processing mode |
  342. | batch_size | Fixnum | nil | number of maximum items to be assigned at once |
  343. | logger | Logger | nil | logger instance for debug logs |
  344. Do (Right-left alternating alignment):
  345. vip\<Enter>\<Enter>**|
  346. Expect:
  347. | Option | Type | Default | Description |
  348. | -- | -- | -- | -- |
  349. | threads | Fixnum | 1 | number of threads in the thread pool |
  350. | queues | Fixnum | 1 | number of concurrent queues |
  351. | queue_size | Fixnum | 1000 | size of each queue |
  352. | interval | Numeric | 0 | dispatcher interval for batch processing |
  353. | batch | Boolean | false | enables batch processing mode |
  354. | batch_size | Fixnum | nil | number of maximum items to be assigned at once |
  355. | logger | Logger | nil | logger instance for debug logs |
  356. Do (Right-left alternating alignment, indent: deep):
  357. vip\<Enter>\<Enter>**\<C-I>\<C-I>|
  358. Expect:
  359. | Option | Type | Default | Description |
  360. | -- | -- | -- | -- |
  361. | threads | Fixnum | 1 | number of threads in the thread pool |
  362. | queues | Fixnum | 1 | number of concurrent queues |
  363. | queue_size | Fixnum | 1000 | size of each queue |
  364. | interval | Numeric | 0 | dispatcher interval for batch processing |
  365. | batch | Boolean | false | enables batch processing mode |
  366. | batch_size | Fixnum | nil | number of maximum items to be assigned at once |
  367. | logger | Logger | nil | logger instance for debug logs |
  368. # Doesn't work. Why?
  369. # Do (Repeat the last command):
  370. # :%\<C-R>=g:easy_align_last_command\<Enter>\<Enter>
  371. Execute (Repeat the last command):
  372. Log g:easy_align_last_command
  373. execute '%'.g:easy_align_last_command
  374. Expect:
  375. | Option | Type | Default | Description |
  376. | -- | -- | -- | -- |
  377. | threads | Fixnum | 1 | number of threads in the thread pool |
  378. | queues | Fixnum | 1 | number of concurrent queues |
  379. | queue_size | Fixnum | 1000 | size of each queue |
  380. | interval | Numeric | 0 | dispatcher interval for batch processing |
  381. | batch | Boolean | false | enables batch processing mode |
  382. | batch_size | Fixnum | nil | number of maximum items to be assigned at once |
  383. | logger | Logger | nil | logger instance for debug logs |
  384. Do (around all | with no margin, right-align 2nd to last):
  385. vip\<Enter>\<C-L>0\<Enter>\<C-R>0\<Enter>*|
  386. vip\<Enter>\<Enter>\<C-L>0\<Enter>\<C-R>0\<Enter>-2|
  387. Expect:
  388. |Option |Type |Default|Description |
  389. |-- |-- | --|-- |
  390. |threads |Fixnum | 1|number of threads in the thread pool |
  391. |queues |Fixnum | 1|number of concurrent queues |
  392. |queue_size|Fixnum | 1000|size of each queue |
  393. |interval |Numeric| 0|dispatcher interval for batch processing |
  394. |batch |Boolean| false|enables batch processing mode |
  395. |batch_size|Fixnum | nil|number of maximum items to be assigned at once|
  396. |logger |Logger | nil|logger instance for debug logs |
  397. Do (live interactive mode):
  398. vip\<Space>\<Enter>
  399. |
  400. \<C-L>(\<Enter>
  401. \<C-R>)\<Enter>
  402. ***
  403. **
  404. \<BS>\<BS>\<BS>
  405. **|\<Enter>|
  406. Expect:
  407. |)Option (|) Type(|)Default(|) Description(|
  408. |)-- (|) --(|)-- (|) --(|
  409. |)threads (|) Fixnum(|)1 (|) number of threads in the thread pool(|
  410. |)queues (|) Fixnum(|)1 (|) number of concurrent queues(|
  411. |)queue_size(|) Fixnum(|)1000 (|) size of each queue(|
  412. |)interval (|)Numeric(|)0 (|) dispatcher interval for batch processing(|
  413. |)batch (|)Boolean(|)false (|) enables batch processing mode(|
  414. |)batch_size(|) Fixnum(|)nil (|)number of maximum items to be assigned at once(|
  415. |)logger (|) Logger(|)nil (|) logger instance for debug logs(|
  416. Do (Switching to live interactive mode):
  417. vip\<Enter>
  418. * Switch to live interactive mode
  419. \<C-P>
  420. |
  421. \<C-L><\<Enter>
  422. \<C-R>>\<Enter>
  423. ***
  424. **
  425. \<BS>\<BS>\<BS>
  426. **|\<Enter>|
  427. Expect:
  428. |>Option <|> Type<|>Default<|> Description<|
  429. |>-- <|> --<|>-- <|> --<|
  430. |>threads <|> Fixnum<|>1 <|> number of threads in the thread pool<|
  431. |>queues <|> Fixnum<|>1 <|> number of concurrent queues<|
  432. |>queue_size<|> Fixnum<|>1000 <|> size of each queue<|
  433. |>interval <|>Numeric<|>0 <|> dispatcher interval for batch processing<|
  434. |>batch <|>Boolean<|>false <|> enables batch processing mode<|
  435. |>batch_size<|> Fixnum<|>nil <|>number of maximum items to be assigned at once<|
  436. |>logger <|> Logger<|>nil <|> logger instance for debug logs<|
  437. Do (Toggling live interactive mode (delimiter entered)):
  438. vip\<Enter>
  439. * Enable live mode
  440. \<C-P>
  441. |*
  442. * Disable live mode
  443. \<C-P>
  444. gg2jdG
  445. Expect:
  446. | Option | Type | Default | Description |
  447. | -- | -- | -- | -- |
  448. Do (Toggling live interactive mode (delimiter not entered)):
  449. vip\<Enter>
  450. * Enable live mode
  451. \<C-P>
  452. \<Enter>
  453. * Disable live mode
  454. \<C-P>
  455. *|
  456. gg2jdG
  457. Expect:
  458. | Option | Type | Default | Description |
  459. | -- | -- | -- | -- |
  460. Do (live interactive mode!):
  461. vip\<Space>r\<Enter>
  462. |
  463. \<C-L>[\<Enter>
  464. \<C-R>]\<Enter>
  465. ***
  466. **
  467. \<BS>\<BS>\<BS>
  468. **
  469. \<C-I>\<C-I>
  470. \<C-X>|\<Enter>
  471. \<Enter>
  472. \<C-X>
  473. Expect:
  474. [|] Option[|]Type [|]Default[|]Description [|
  475. [|] --[|]-- [|] --[|]-- [|
  476. [|] threads[|]Fixnum [|] 1[|]number of threads in the thread pool [|
  477. [|] queues[|]Fixnum [|] 1[|]number of concurrent queues [|
  478. [|]queue_size[|]Fixnum [|] 1000[|]size of each queue [|
  479. [|] interval[|]Numeric[|] 0[|]dispatcher interval for batch processing [|
  480. [|] batch[|]Boolean[|] false[|]enables batch processing mode [|
  481. [|]batch_size[|]Fixnum [|] nil[|]number of maximum items to be assigned at once[|
  482. [|] logger[|]Logger [|] nil[|]logger instance for debug logs [|
  483. Execute (g:easy_align_last_command should be set):
  484. Assert exists('g:easy_align_last_command')
  485. unlet g:easy_align_last_command
  486. Do:
  487. vip\<Space>\<Enter>**|\<C-C>
  488. Execute (g:easy_align_last_command should not be set if interrupted):
  489. Assert !exists('g:easy_align_last_command')
  490. Do (g:easy_align_nth is not set (work with default value 1)):
  491. vip\<Enter>|
  492. Expect:
  493. | Option| Type | Default | Description |
  494. | --|--|--|--|
  495. | threads | Fixnum | 1 | number of threads in the thread pool |
  496. | queues |Fixnum | 1 | number of concurrent queues |
  497. | queue_size | Fixnum | 1000 | size of each queue |
  498. | interval | Numeric | 0 | dispatcher interval for batch processing |
  499. | batch | Boolean | false | enables batch processing mode |
  500. | batch_size | Fixnum | nil | number of maximum items to be assigned at once |
  501. | logger | Logger | nil | logger instance for debug logs |
  502. Execute (set g:easy_align_nth):
  503. let g:easy_align_nth = '2'
  504. Do (g:easy_align_nth is set as 2):
  505. vip\<Enter>|
  506. Expect:
  507. | Option | Type | Default | Description |
  508. |-- | --|--|--|
  509. | threads | Fixnum | 1 | number of threads in the thread pool |
  510. |queues | Fixnum | 1 | number of concurrent queues |
  511. |queue_size | Fixnum | 1000 | size of each queue |
  512. | interval | Numeric | 0 | dispatcher interval for batch processing |
  513. |batch | Boolean | false | enables batch processing mode |
  514. |batch_size | Fixnum | nil | number of maximum items to be assigned at once |
  515. |logger | Logger | nil | logger instance for debug logs |
  516. Execute (unset g:easy_align_nth):
  517. unlet g:easy_align_nth
  518. Execute (set g:easy_align_nth):
  519. let g:easy_align_nth = '*'
  520. Do (g:easy_align_nth is set as *):
  521. vip\<Enter>|
  522. Expect:
  523. | Option | Type | Default | Description |
  524. | -- | -- | -- | -- |
  525. | threads | Fixnum | 1 | number of threads in the thread pool |
  526. | queues | Fixnum | 1 | number of concurrent queues |
  527. | queue_size | Fixnum | 1000 | size of each queue |
  528. | interval | Numeric | 0 | dispatcher interval for batch processing |
  529. | batch | Boolean | false | enables batch processing mode |
  530. | batch_size | Fixnum | nil | number of maximum items to be assigned at once |
  531. | logger | Logger | nil | logger instance for debug logs |
  532. Execute (unset g:easy_align_nth):
  533. unlet g:easy_align_nth
  534. Execute (set g:easy_align_nth):
  535. let g:easy_align_nth = '**'
  536. Do (g:easy_align_nth is set as **):
  537. vip\<Enter>|
  538. Expect:
  539. | Option | Type | Default | Description |
  540. | -- | -- | -- | -- |
  541. | threads | Fixnum | 1 | number of threads in the thread pool |
  542. | queues | Fixnum | 1 | number of concurrent queues |
  543. | queue_size | Fixnum | 1000 | size of each queue |
  544. | interval | Numeric | 0 | dispatcher interval for batch processing |
  545. | batch | Boolean | false | enables batch processing mode |
  546. | batch_size | Fixnum | nil | number of maximum items to be assigned at once |
  547. | logger | Logger | nil | logger instance for debug logs |
  548. Execute (unset g:easy_align_nth):
  549. unlet g:easy_align_nth
  550. Execute (set g:easy_align_nth):
  551. let g:easy_align_nth = '-'
  552. Do (g:easy_align_nth is set as -):
  553. vip\<Enter>|
  554. Expect:
  555. | Option| Type | Default | Description |
  556. |--|--|--|-- |
  557. | threads | Fixnum | 1 | number of threads in the thread pool |
  558. |queues |Fixnum | 1 | number of concurrent queues |
  559. |queue_size | Fixnum | 1000 | size of each queue |
  560. | interval | Numeric | 0 | dispatcher interval for batch processing |
  561. |batch | Boolean | false | enables batch processing mode |
  562. |batch_size | Fixnum | nil | number of maximum items to be assigned at once |
  563. |logger | Logger | nil | logger instance for debug logs |
  564. Execute (unset g:easy_align_nth):
  565. unlet g:easy_align_nth
  566. Execute (set g:easy_align_nth):
  567. let g:easy_align_nth = '-2'
  568. Do (g:easy_align_nth is set as -2):
  569. vip\<Enter>|
  570. Expect:
  571. | Option| Type | Default | Description |
  572. |--|--|-- | --|
  573. | threads | Fixnum | 1 | number of threads in the thread pool |
  574. |queues |Fixnum | 1 | number of concurrent queues |
  575. |queue_size | Fixnum | 1000 | size of each queue |
  576. | interval | Numeric | 0 | dispatcher interval for batch processing |
  577. |batch | Boolean | false | enables batch processing mode |
  578. |batch_size | Fixnum | nil | number of maximum items to be assigned at once |
  579. |logger | Logger | nil | logger instance for debug logs |
  580. Execute (unset g:easy_align_nth):
  581. unlet g:easy_align_nth
  582. ###########################################################
  583. Given (comma-separated items):
  584. aaa, bb,c
  585. d,eeeeeee
  586. fffff, gggggggggg,
  587. h, , ii
  588. j,,k
  589. Do (around all commas):
  590. vip\<Enter>*,
  591. Expect:
  592. aaa, bb, c
  593. d, eeeeeee
  594. fffff, gggggggggg,
  595. h, , ii
  596. j, , k
  597. Do (around all commas, do not stick to left):
  598. vip\<Enter>\<Right>*,
  599. Expect:
  600. aaa , bb , c
  601. d , eeeeeee
  602. fffff , gggggggggg ,
  603. h , , ii
  604. j , , k
  605. Do (center-align around all commas):
  606. vip\<Enter>\<Enter>\<Enter>*,
  607. Expect:
  608. aaa, bb, c
  609. d, eeeeeee
  610. fffff, gggggggggg,
  611. h, , ii
  612. j, , k
  613. ###########################################################
  614. Given ruby (multi-line ruby Hash):
  615. options = { :caching => nil,
  616. :versions => 3,
  617. "cache=blocks" => false }.merge(options)
  618. Do (around the last =):
  619. vip\<Enter>-=
  620. Expect ruby:
  621. options = { :caching => nil,
  622. :versions => 3,
  623. "cache=blocks" => false }.merge(options)
  624. Do (partial alignment):
  625. f:
  626. \<C-V>jj3E
  627. \<Enter>\<Enter>=
  628. Expect ruby:
  629. options = { :caching => nil,
  630. :versions => 3,
  631. "cache=blocks" => false }.merge(options)
  632. ###########################################################
  633. Given c (C code with comments 1):
  634. /* a */ b = c
  635. aa >= bb
  636. // aaa = bbb = cccc
  637. /* aaaa = */ bbbb === cccc " = dddd = " = eeee
  638. aaaaa /* bbbbb */ == ccccc /* != eeeee = */ === fffff
  639. Do:
  640. vip\<Enter>*=
  641. Expect c:
  642. /* a */ b = c
  643. aa >= bb
  644. // aaa = bbb = cccc
  645. /* aaaa = */ bbbb === cccc " = dddd = " = eeee
  646. aaaaa /* bbbbb */ == ccccc /* != eeeee = */ === fffff
  647. Do:
  648. vip\<Enter>\<C-G>\<C-U>*=
  649. Expect c:
  650. /* a */ b = c
  651. aa >= bb
  652. // aaa = bbb = cccc
  653. /* aaaa = */ bbbb === cccc " = dddd = " = eeee
  654. aaaaa /* bbbbb */ == ccccc /* != eeeee = */ === fffff
  655. ###########################################################
  656. Given c (C code with comments 2):
  657. int a = 1;
  658. long b = 2;
  659. float c = 3;
  660. string d = 4;
  661. // this line should not get aligned
  662. long int e = 5;
  663. std::map f;
  664. std::map g; /* this? */
  665. short h /* how about this? */ = 6;
  666. string i = "asdf";
  667. Do (around =):
  668. vip\<Enter>=
  669. Expect c:
  670. int a = 1;
  671. long b = 2;
  672. float c = 3;
  673. string d = 4;
  674. // this line should not get aligned
  675. long int e = 5;
  676. std::map f;
  677. std::map g; /* this? */
  678. short h /* how about this? */ = 6;
  679. string i = "asdf";
  680. Do (right-align around =, comment lines are ignored):
  681. vip\<Enter>\<Enter>=
  682. Expect c:
  683. int a = 1;
  684. long b = 2;
  685. float c = 3;
  686. string d = 4;
  687. // this line should not get aligned
  688. long int e = 5;
  689. std::map f;
  690. std::map g; /* this? */
  691. short h /* how about this? */ = 6;
  692. string i = "asdf";
  693. Do (right-align around =, do not ignore comment lines):
  694. vip\<Enter>\<Enter>\<C-U>=
  695. Expect c:
  696. int a = 1;
  697. long b = 2;
  698. float c = 3;
  699. string d = 4;
  700. // this line should not get aligned
  701. long int e = 5;
  702. std::map f;
  703. std::map g; /* this? */
  704. short h /* how about this? */ = 6;
  705. string i = "asdf";
  706. ###########################################################
  707. Given ruby (= operators):
  708. a =
  709. a = 1
  710. bbbb .= 2
  711. ccccccc = 3
  712. ccccccccccccccc
  713. ddd = #
  714. eeee === eee = eee = eee=f
  715. fff = ggg += gg &&= gg
  716. g != hhhhhhhh == # 8
  717. i := 5
  718. i %= 5
  719. i *= 5
  720. j =~ 5
  721. j >= 5
  722. aa => 123
  723. aa <<= 123
  724. aa >>= 123
  725. bbb => 123
  726. c => 1233123
  727. d => 123
  728. dddddd &&= 123
  729. dddddd ||= 123
  730. dddddd /= 123
  731. gg <=> ee
  732. Do (1st =):
  733. vip\<Enter>=
  734. Expect ruby:
  735. a =
  736. a = 1
  737. bbbb .= 2
  738. ccccccc = 3
  739. ccccccccccccccc
  740. ddd = #
  741. eeee === eee = eee = eee=f
  742. fff = ggg += gg &&= gg
  743. g != hhhhhhhh == # 8
  744. i := 5
  745. i %= 5
  746. i *= 5
  747. j =~ 5
  748. j >= 5
  749. aa => 123
  750. aa <<= 123
  751. aa >>= 123
  752. bbb => 123
  753. c => 1233123
  754. d => 123
  755. dddddd &&= 123
  756. dddddd ||= 123
  757. dddddd /= 123
  758. gg <=> ee
  759. Do (LR =):
  760. vip\<Enter>**=
  761. Expect ruby:
  762. a =
  763. a = 1
  764. bbbb .= 2
  765. ccccccc = 3
  766. ccccccccccccccc
  767. ddd = #
  768. eeee === eee = eee = eee = f
  769. fff = ggg += gg &&= gg
  770. g != hhhhhhhh == # 8
  771. i := 5
  772. i %= 5
  773. i *= 5
  774. j =~ 5
  775. j >= 5
  776. aa => 123
  777. aa <<= 123
  778. aa >>= 123
  779. bbb => 123
  780. c => 1233123
  781. d => 123
  782. dddddd &&= 123
  783. dddddd ||= 123
  784. dddddd /= 123
  785. gg <=> ee
  786. Do (DEPRECATED: Alignment using mode_sequence, delimiter_align):
  787. vip\<Enter>\<C-O>\<Backspace>cr*\<Enter>\<C-D>=
  788. Expect ruby:
  789. a =
  790. a = 1
  791. bbbb .= 2
  792. ccccccc = 3
  793. ccccccccccccccc
  794. ddd = #
  795. eeee === eee = eee = eee = f
  796. fff = ggg += gg &&= gg
  797. g != hhhhhhhh == # 8
  798. i := 5
  799. i %= 5
  800. i *= 5
  801. j =~ 5
  802. j >= 5
  803. aa => 123
  804. aa <<= 123
  805. aa >>= 123
  806. bbb => 123
  807. c => 1233123
  808. d => 123
  809. dddddd &&= 123
  810. dddddd ||= 123
  811. dddddd /= 123
  812. gg <=> ee
  813. Do (Alignment using align, delimiter_align):
  814. vip\<Enter>\<C-A>\<Backspace>cr*\<Enter>\<C-D>=
  815. Expect ruby:
  816. a =
  817. a = 1
  818. bbbb .= 2
  819. ccccccc = 3
  820. ccccccccccccccc
  821. ddd = #
  822. eeee === eee = eee = eee = f
  823. fff = ggg += gg &&= gg
  824. g != hhhhhhhh == # 8
  825. i := 5
  826. i %= 5
  827. i *= 5
  828. j =~ 5
  829. j >= 5
  830. aa => 123
  831. aa <<= 123
  832. aa >>= 123
  833. bbb => 123
  834. c => 1233123
  835. d => 123
  836. dddddd &&= 123
  837. dddddd ||= 123
  838. dddddd /= 123
  839. gg <=> ee
  840. Do (DEPRECATED: mode_sequence starting from 2nd, delimiter_align = center):
  841. vip\<Enter>\<C-O>\<Backspace>rc**\<Enter>\<C-D>\<C-D>2=
  842. Expect ruby:
  843. a =
  844. a = 1
  845. bbbb .= 2
  846. ccccccc = 3
  847. ccccccccccccccc
  848. ddd = #
  849. eeee === eee = eee = eee = f
  850. fff = ggg += gg &&= gg
  851. g != hhhhhhhh == # 8
  852. i := 5
  853. i %= 5
  854. i *= 5
  855. j =~ 5
  856. j >= 5
  857. aa => 123
  858. aa <<= 123
  859. aa >>= 123
  860. bbb => 123
  861. c => 1233123
  862. d => 123
  863. dddddd &&= 123
  864. dddddd ||= 123
  865. dddddd /= 123
  866. gg <=> ee
  867. Do (align starting from 2nd, delimiter_align = center):
  868. vip\<Enter>\<C-A>\<Backspace>rc**\<Enter>\<C-D>\<C-D>2=
  869. Expect ruby:
  870. a =
  871. a = 1
  872. bbbb .= 2
  873. ccccccc = 3
  874. ccccccccccccccc
  875. ddd = #
  876. eeee === eee = eee = eee = f
  877. fff = ggg += gg &&= gg
  878. g != hhhhhhhh == # 8
  879. i := 5
  880. i %= 5
  881. i *= 5
  882. j =~ 5
  883. j >= 5
  884. aa => 123
  885. aa <<= 123
  886. aa >>= 123
  887. bbb => 123
  888. c => 1233123
  889. d => 123
  890. dddddd &&= 123
  891. dddddd ||= 123
  892. dddddd /= 123
  893. gg <=> ee
  894. Do (around all =s, do not ignore unmatched):
  895. vip\<Enter>\<C-U>
  896. \<C-L>0\<Enter>
  897. \<C-R>0\<Enter>
  898. \<C-D>\<C-D>
  899. *=
  900. Expect ruby:
  901. a =
  902. a = 1
  903. bbbb .= 2
  904. ccccccc = 3
  905. ccccccccccccccc
  906. ddd = #
  907. eeee ===eee = eee = eee=f
  908. fff = ggg +=gg &&=gg
  909. g != hhhhhhhh==# 8
  910. i := 5
  911. i %= 5
  912. i *= 5
  913. j =~ 5
  914. j >= 5
  915. aa => 123
  916. aa <<=123
  917. aa >>=123
  918. bbb => 123
  919. c => 1233123
  920. d => 123
  921. dddddd &&=123
  922. dddddd ||=123
  923. dddddd /= 123
  924. gg <=>ee
  925. Do (Center-align around 2nd =):
  926. vip\<Enter>\<Enter>\<Enter>2=
  927. Expect ruby:
  928. a =
  929. a = 1
  930. bbbb .= 2
  931. ccccccc = 3
  932. ccccccccccccccc
  933. ddd = #
  934. eeee === eee = eee = eee=f
  935. fff = ggg += gg &&= gg
  936. g != hhhhhhhh == # 8
  937. i := 5
  938. i %= 5
  939. i *= 5
  940. j =~ 5
  941. j >= 5
  942. aa => 123
  943. aa <<= 123
  944. aa >>= 123
  945. bbb => 123
  946. c => 1233123
  947. d => 123
  948. dddddd &&= 123
  949. dddddd ||= 123
  950. dddddd /= 123
  951. gg <=> ee
  952. ###########################################################
  953. Given ruby (Trailing ruby line comment):
  954. apple = 1 # comment not aligned
  955. apricot = 'DAD' + 'F#AD'
  956. banana = 'Gros Michel' ## comment 2
  957. Do (around the last spaces):
  958. vip\<Enter>-\<Space>
  959. Expect ruby:
  960. apple = 1 # comment not aligned
  961. apricot = 'DAD' + 'F#AD'
  962. banana = 'Gros Michel' ## comment 2
  963. Do (using # rule):
  964. vip\<Enter>\<C-U>#
  965. Expect ruby:
  966. apple = 1 # comment not aligned
  967. apricot = 'DAD' + 'F#AD'
  968. banana = 'Gros Michel' ## comment 2
  969. Do (using regular expression):
  970. vip\<Enter>=
  971. gv\<Enter>
  972. \<C-U>\<C-G>\<C-G>
  973. \<C-D>
  974. \<C-X>#\+\<Enter>
  975. Expect ruby:
  976. apple = 1 # comment not aligned
  977. apricot = 'DAD' + 'F#AD'
  978. banana = 'Gros Michel' ## comment 2
  979. ###########################################################
  980. Given (method chain):
  981. my_object
  982. .method1.chain
  983. .second_method.call
  984. .third.call
  985. .method_4.execute
  986. Do (around all .):
  987. vip\<Enter>*.
  988. Expect:
  989. my_object
  990. .method1 .chain
  991. .second_method.call
  992. .third .call
  993. .method_4 .execute
  994. Do (around all . with deep indentation):
  995. vip\<Enter>\<C-I>\<C-I>*.
  996. Expect:
  997. my_object
  998. .method1 .chain
  999. .second_method.call
  1000. .third .call
  1001. .method_4 .execute
  1002. Execute (set g:easy_align_indentation):
  1003. let g:easy_align_indentation = 'd'
  1004. Do (around all . with deep indentation):
  1005. vip\<Enter>*.
  1006. Expect:
  1007. my_object
  1008. .method1 .chain
  1009. .second_method.call
  1010. .third .call
  1011. .method_4 .execute
  1012. Execute (unset g:easy_align_indentation):
  1013. unlet g:easy_align_indentation
  1014. Do (right-align around all .):
  1015. vip\<Enter>\<Enter>*.
  1016. Expect:
  1017. my_object
  1018. . method1. chain
  1019. .second_method. call
  1020. . third. call
  1021. . method_4.execute
  1022. ###########################################################
  1023. Execute (define d rule):
  1024. let g:easy_align_delimiters.d =
  1025. \ { 'pattern': '\s\+\(\S\+\s*[;=]\)\@=', 'left_margin': 0, 'right_margin': 0 }
  1026. Given c (complex var dec):
  1027. const char* str = "Hello";
  1028. int64_t count = 1 + 2;
  1029. static double pi = 3.14;
  1030. static std::map<std::string, float>* scores = pointer;
  1031. Do (using d rule):
  1032. vip\<Enter>d
  1033. gv\<Enter>=
  1034. Expect c:
  1035. const char* str = "Hello";
  1036. int64_t count = 1 + 2;
  1037. static double pi = 3.14;
  1038. static std::map<std::string, float>* scores = pointer;
  1039. ###########################################################
  1040. Given (indented code):
  1041. apple = 1
  1042. banana = 2
  1043. cake = 3
  1044. daisy = 4
  1045. eggplant = 5
  1046. Do:
  1047. vip\<Enter>=
  1048. Expect:
  1049. apple = 1
  1050. banana = 2
  1051. cake = 3
  1052. daisy = 4
  1053. eggplant = 5
  1054. Do (shallow indentation):
  1055. vip\<Enter>\<C-I>=
  1056. Expect:
  1057. apple = 1
  1058. banana = 2
  1059. cake = 3
  1060. daisy = 4
  1061. eggplant = 5
  1062. Do (deep indentation):
  1063. vip\<Enter>\<C-I>\<C-I>=
  1064. Expect:
  1065. apple = 1
  1066. banana = 2
  1067. cake = 3
  1068. daisy = 4
  1069. eggplant = 5
  1070. Do (no indentation):
  1071. vip\<Enter>\<C-I>\<C-I>\<C-I>=
  1072. Expect:
  1073. apple = 1
  1074. banana = 2
  1075. cake = 3
  1076. daisy = 4
  1077. eggplant = 5
  1078. Do (right-align, shallow indentation):
  1079. vip\<Enter>\<Enter>\<C-I>=
  1080. Expect:
  1081. apple = 1
  1082. banana = 2
  1083. cake = 3
  1084. daisy = 4
  1085. eggplant = 5
  1086. Do (center-align, shallow indentation):
  1087. vip\<Enter>\<Enter>\<Enter>\<C-I>=
  1088. Expect:
  1089. apple = 1
  1090. banana = 2
  1091. cake = 3
  1092. daisy = 4
  1093. eggplant = 5
  1094. Do (right-align, deep indentation):
  1095. vip\<Enter>\<Enter>\<C-I>\<C-I>=
  1096. Expect:
  1097. apple = 1
  1098. banana = 2
  1099. cake = 3
  1100. daisy = 4
  1101. eggplant = 5
  1102. Do (center-align, deep indentation):
  1103. vip\<Enter>\<Enter>\<Enter>\<C-I>\<C-I>=
  1104. Expect:
  1105. apple = 1
  1106. banana = 2
  1107. cake = 3
  1108. daisy = 4
  1109. eggplant = 5
  1110. Do (right-align, no indentation):
  1111. vip\<Enter>\<Enter>\<C-I>\<C-I>\<C-I>=
  1112. ###########################################################
  1113. Expect:
  1114. apple = 1
  1115. banana = 2
  1116. cake = 3
  1117. daisy = 4
  1118. eggplant = 5
  1119. Given (Center-align cases):
  1120. aaaa = 123456778901234567890 =
  1121. cccccccccccccc = 12345678 =
  1122. aaaa = 123456778901234567890 =
  1123. bbbbbb = 4
  1124. cccccccccccccccccc = 12345678 =
  1125. aaaa = 123456778901234567890 =
  1126. cccccccccccccccccc = 12345678 =
  1127. aaaaa = 123456778901234567890 =
  1128. cc = 12345678 =
  1129. aaaaa = 123456778901234567890 =
  1130. bbbbbbbbbb = 12345 =
  1131. aaaaa = 123456778901234567890 =
  1132. cccccccccccccccccc = 123 =
  1133. aaaaa = 123456778901234567890 =
  1134. cccccccccccccccccc = 12345678 =
  1135. aaaaa = 12345 =
  1136. bbbbbbbbbb = 123456778901234567890 =
  1137. aaaaa = 12345
  1138. bbbbbbbbbb = 123456778901234567890
  1139. Do:
  1140. vip\<Enter>\<Enter>\<Enter>=
  1141. }jvip\<Enter>\<Enter>\<Enter>=
  1142. }jvip\<Enter>\<Enter>\<Enter>=
  1143. }jvip\<Enter>\<Enter>\<Enter>=
  1144. }jvip\<Enter>\<Enter>\<Enter>2=
  1145. }jvip\<Enter>\<Enter>\<Enter>2=
  1146. }jvip\<Enter>\<Enter>\<Enter>2=
  1147. }jvip\<Enter>\<Enter>\<Enter>2=
  1148. }jvip\<Enter>\<Enter>\<Enter>2=
  1149. Expect:
  1150. aaaa = 123456778901234567890 =
  1151. cccccccccccccc = 12345678 =
  1152. aaaa = 123456778901234567890 =
  1153. bbbbbb = 4
  1154. cccccccccccccccccc = 12345678 =
  1155. aaaa = 123456778901234567890 =
  1156. cccccccccccccccccc = 12345678 =
  1157. aaaaa = 123456778901234567890 =
  1158. cc = 12345678 =
  1159. aaaaa = 123456778901234567890 =
  1160. bbbbbbbbbb = 12345 =
  1161. aaaaa = 123456778901234567890 =
  1162. cccccccccccccccccc = 123 =
  1163. aaaaa = 123456778901234567890 =
  1164. cccccccccccccccccc = 12345678 =
  1165. aaaaa = 12345 =
  1166. bbbbbbbbbb = 123456778901234567890 =
  1167. aaaaa = 12345
  1168. bbbbbbbbbb = 123456778901234567890
  1169. ###########################################################
  1170. Given (long delimiter):
  1171. ...-.-----
  1172. ..--..----
  1173. .---...---
  1174. ----....--
  1175. .---.....-
  1176. ..--......
  1177. ...-.....-
  1178. Do:
  1179. vip\<Enter>*\<C-X>-\+\<Enter>
  1180. Expect:
  1181. ... - . -----
  1182. .. -- .. ----
  1183. . --- ... ---
  1184. ---- .... --
  1185. . --- ..... -
  1186. .. -- ......
  1187. ... - ..... -
  1188. Do:
  1189. vip\<Enter>*\<C-D>\<C-X>-\+\<Enter>
  1190. Expect:
  1191. ... - . -----
  1192. .. -- .. ----
  1193. . --- ... ---
  1194. ---- .... --
  1195. . --- ..... -
  1196. .. -- ......
  1197. ... - ..... -
  1198. Do:
  1199. vip\<Enter>*\<C-D>\<C-D>\<C-X>-\+\<Enter>
  1200. Expect:
  1201. ... - . -----
  1202. .. -- .. ----
  1203. . --- ... ---
  1204. ---- .... --
  1205. . --- ..... -
  1206. .. -- ......
  1207. ... - ..... -
  1208. Execute (set g:easy_align_delimiter_align):
  1209. let g:easy_align_delimiter_align = 'c'
  1210. Do:
  1211. vip\<Enter>*\<C-X>-\+\<Enter>
  1212. Expect:
  1213. ... - . -----
  1214. .. -- .. ----
  1215. . --- ... ---
  1216. ---- .... --
  1217. . --- ..... -
  1218. .. -- ......
  1219. ... - ..... -
  1220. Execute (unset g:easy_align_delimiter_align):
  1221. unlet g:easy_align_delimiter_align
  1222. ###########################################################
  1223. Execute (set g:easy_align_interactive_modes):
  1224. let g:easy_align_interactive_modes = ['r', 'c']
  1225. let g:easy_align_bang_interactive_modes = ['c', 'l']
  1226. Given (Test g:easy_align_interactive_modes):
  1227. a = 1
  1228. bb = 2
  1229. ccc = 3
  1230. Do:
  1231. vip\<Enter>=
  1232. Expect:
  1233. a = 1
  1234. bb = 2
  1235. ccc = 3
  1236. Do:
  1237. vip\<Enter>\<Enter>=
  1238. Expect:
  1239. a = 1
  1240. bb = 2
  1241. ccc = 3
  1242. Do:
  1243. vipr\<Enter>=
  1244. Expect:
  1245. a = 1
  1246. bb = 2
  1247. ccc = 3
  1248. Do:
  1249. vipr\<Enter>\<Enter>=
  1250. Expect:
  1251. a = 1
  1252. bb = 2
  1253. ccc = 3
  1254. Do:
  1255. vipr\<Enter>\<Enter>\<Enter>=
  1256. Expect:
  1257. a = 1
  1258. bb = 2
  1259. ccc = 3
  1260. Execute (unset g:easy_align_interactive_modes):
  1261. unlet g:easy_align_interactive_modes
  1262. unlet g:easy_align_bang_interactive_modes
  1263. ###########################################################
  1264. Given (Test ignore_unmatched behavior):
  1265. a = b = c
  1266. aabba = bbbbb
  1267. Do (left-align):
  1268. vip\<Enter>*=
  1269. Expect:
  1270. a = b = c
  1271. aabba = bbbbb
  1272. Do (left-align, no ignore_unmatched):
  1273. vip\<Enter>\<C-U>*=
  1274. Expect:
  1275. a = b = c
  1276. aabba = bbbbb
  1277. Do (right-align):
  1278. vip\<Enter>\<Enter>*=
  1279. Expect:
  1280. a = b = c
  1281. aabba = bbbbb
  1282. Do (right-align, explicit ignore_unmatched):
  1283. vip\<Enter>\<Enter>\<C-U>\<C-U>*=
  1284. Expect:
  1285. a = b = c
  1286. aabba = bbbbb
  1287. Do (center-align):
  1288. vip\<Enter>\<Enter>\<Enter>*=
  1289. Expect:
  1290. a = b = c
  1291. aabba = bbbbb
  1292. Do (center-align):
  1293. vip\<Enter>\<C-U>\<Enter>\<Enter>\<C-U>*=
  1294. Expect:
  1295. a = b = c
  1296. aabba = bbbbb
  1297. ###########################################################
  1298. Given (test filter option):
  1299. aaa=aaa=aaa
  1300. aaaaa=aaaaa=aaaaa
  1301. aaaaaaa=aaaaaaa=aaaaaaab
  1302. bbbbb=bbbbb=bbbbb
  1303. aaa=aaa=aaa
  1304. Do (g/a/):
  1305. vip\<Enter>
  1306. \<C-F>g/a/\<Enter>
  1307. *=
  1308. Expect:
  1309. aaa = aaa = aaa
  1310. aaaaa = aaaaa = aaaaa
  1311. aaaaaaa = aaaaaaa = aaaaaaab
  1312. bbbbb=bbbbb=bbbbb
  1313. aaa = aaa = aaa
  1314. Do (g/a - you can omit the trailing /):
  1315. vip\<Enter>
  1316. \<C-F>g/a\<Enter>
  1317. *=
  1318. Expect:
  1319. aaa = aaa = aaa
  1320. aaaaa = aaaaa = aaaaa
  1321. aaaaaaa = aaaaaaa = aaaaaaab
  1322. bbbbb=bbbbb=bbbbb
  1323. aaa = aaa = aaa
  1324. Do (v/b/):
  1325. vip\<Enter>
  1326. \<C-F>v/b/\<Enter>
  1327. *=
  1328. Expect:
  1329. aaa = aaa = aaa
  1330. aaaaa = aaaaa = aaaaa
  1331. aaaaaaa=aaaaaaa=aaaaaaab
  1332. bbbbb=bbbbb=bbbbb
  1333. aaa = aaa = aaa
  1334. Do (invalid filter expression):
  1335. vip\<Enter>
  1336. \<C-F>haha\<Enter>
  1337. *=
  1338. Expect:
  1339. aaa = aaa = aaa
  1340. aaaaa = aaaaa = aaaaa
  1341. aaaaaaa = aaaaaaa = aaaaaaab
  1342. bbbbb = bbbbb = bbbbb
  1343. aaa = aaa = aaa
  1344. Execute (g-filter in shorthand notation):
  1345. %EasyAlign*=g/a/
  1346. Expect:
  1347. aaa = aaa = aaa
  1348. aaaaa = aaaaa = aaaaa
  1349. aaaaaaa = aaaaaaa = aaaaaaab
  1350. bbbbb=bbbbb=bbbbb
  1351. aaa = aaa = aaa
  1352. Execute (v-filter in shorthand notation):
  1353. %EasyAlign*=v/b/
  1354. Expect:
  1355. aaa = aaa = aaa
  1356. aaaaa = aaaaa = aaaaa
  1357. aaaaaaa=aaaaaaa=aaaaaaab
  1358. bbbbb=bbbbb=bbbbb
  1359. aaa = aaa = aaa
  1360. Execute (filter in dictionary format):
  1361. %EasyAlign*={'filter': 'v/b/'}
  1362. Expect:
  1363. aaa = aaa = aaa
  1364. aaaaa = aaaaa = aaaaa
  1365. aaaaaaa=aaaaaaa=aaaaaaab
  1366. bbbbb=bbbbb=bbbbb
  1367. aaa = aaa = aaa
  1368. Given clojure (filter with blockwise-visual mode):
  1369. (let [a 1
  1370. bbb 2
  1371. ccccc (range
  1372. 10 20)]
  1373. (prn [a bbb ccccc]))
  1374. Do (filter with blockwise-visual mode):
  1375. f[
  1376. vi[
  1377. \<C-V>
  1378. \<Enter>
  1379. \<C-F>g/^\S\<Enter>
  1380. \<Space>
  1381. Expect clojure:
  1382. (let [a 1
  1383. bbb 2
  1384. ccccc (range
  1385. 10 20)]
  1386. (prn [a bbb ccccc]))
  1387. Given clojure:
  1388. {:user {:plugins [[cider/cider-nrepl "0.9.1"]
  1389. [lein-kibit "0.0.8"]
  1390. [lein-licenses "0.1.1"]
  1391. [lein-marginalia "0.8.0"] ; lein marg
  1392. [codox "0.8.13"] ; lein doc
  1393. [com.jakemccrary/lein-test-refresh "0.10.0"] ; lein test-refresh
  1394. [lein-pprint "1.1.2"]
  1395. [lein-exec "0.3.5"]
  1396. [jonase/eastwood "0.2.1"]]
  1397. :dependencies [[slamhound "1.5.5"]]
  1398. :aliases {"slamhound" ["run" "-m" "slam.hound"]}
  1399. :signing {:gpg-key "FEF9C627"}}}
  1400. Do (Virtual column should be used in blockwise-visual mode):
  1401. :set ve=block\<Enter>
  1402. f[
  1403. vi[
  1404. \<C-V>
  1405. $20l
  1406. \<Enter>\<Space>
  1407. Expect clojure:
  1408. {:user {:plugins [[cider/cider-nrepl "0.9.1"]
  1409. [lein-kibit "0.0.8"]
  1410. [lein-licenses "0.1.1"]
  1411. [lein-marginalia "0.8.0"] ; lein marg
  1412. [codox "0.8.13"] ; lein doc
  1413. [com.jakemccrary/lein-test-refresh "0.10.0"] ; lein test-refresh
  1414. [lein-pprint "1.1.2"]
  1415. [lein-exec "0.3.5"]
  1416. [jonase/eastwood "0.2.1"]]
  1417. :dependencies [[slamhound "1.5.5"]]
  1418. :aliases {"slamhound" ["run" "-m" "slam.hound"]}
  1419. :signing {:gpg-key "FEF9C627"}}}
  1420. Then:
  1421. set ve=
  1422. ###########################################################
  1423. Given (hard-tab indentation (#19)):
  1424. a=1=3
  1425. bbb=2=4
  1426. ccccc=4=5
  1427. fff=4=6
  1428. Do (Left alignment):
  1429. vip\<Enter>=
  1430. Expect:
  1431. a = 1=3
  1432. bbb = 2=4
  1433. ccccc = 4=5
  1434. fff = 4=6
  1435. Do (Right alignment):
  1436. vip\<Enter>\<Enter>=
  1437. Expect:
  1438. a = 1=3
  1439. bbb = 2=4
  1440. ccccc = 4=5
  1441. fff = 4=6
  1442. Do (Center alignment):
  1443. vip\<Enter>\<Enter>\<Enter>=
  1444. Expect:
  1445. a = 1=3
  1446. bbb = 2=4
  1447. ccccc = 4=5
  1448. fff = 4=6
  1449. Do (Left alignment with shallow indentation):
  1450. vip\<Enter>\<C-I>=
  1451. Expect:
  1452. a = 1=3
  1453. bbb = 2=4
  1454. ccccc = 4=5
  1455. fff = 4=6
  1456. Do (Center alignment with deep indentation):
  1457. vip\<Enter>\<Enter>\<Enter>\<C-I>\<C-I>=
  1458. Expect:
  1459. a = 1=3
  1460. bbb = 2=4
  1461. ccccc = 4=5
  1462. fff = 4=6
  1463. Given (hard-tab indentation - dictionary (#19)):
  1464. ddict={'homePage':'360452',
  1465. 'key':'TEST',
  1466. 'name':'DocumentationAPITestingSpace',
  1467. 'type':'global',
  1468. 'url':'http://localhost:8090/display/TEST'}
  1469. Do (Right alignment):
  1470. vip\<Enter>\<Enter>:
  1471. Expect:
  1472. ddict={'homePage': '360452',
  1473. 'key': 'TEST',
  1474. 'name': 'DocumentationAPITestingSpace',
  1475. 'type': 'global',
  1476. 'url': 'http://localhost:8090/display/TEST'}
  1477. ###########################################################
  1478. Given (Two paragraphs (requires vim-repeat)):
  1479. a = 1
  1480. bb = 2
  1481. ccc = 3
  1482. dddd = 4
  1483. d = 1
  1484. cc = 2
  1485. bbb = 3
  1486. aaaa = 4
  1487. _____ = 5
  1488. Do (Align and repeat):
  1489. \<Space>Aip\<Enter>=
  1490. 6G
  1491. .
  1492. Expect:
  1493. a = 1
  1494. bb = 2
  1495. ccc = 3
  1496. dddd = 4
  1497. d = 1
  1498. cc = 2
  1499. bbb = 3
  1500. aaaa = 4
  1501. _____ = 5
  1502. Do (Visual-mode operator is also repeatable):
  1503. vip\<Enter>\<Enter>=
  1504. 6G
  1505. .
  1506. Expect:
  1507. a = 1
  1508. bb = 2
  1509. ccc = 3
  1510. dddd = 4
  1511. d = 1
  1512. cc = 2
  1513. bbb = 3
  1514. aaaa = 4
  1515. _____ = 5
  1516. Do (Repeatable in visual mode):
  1517. 2GvG\<Space>.
  1518. Expect:
  1519. a = 1
  1520. bb = 2
  1521. ccc = 3
  1522. dddd = 4
  1523. d = 1
  1524. cc = 2
  1525. bbb = 3
  1526. aaaa = 4
  1527. _____ = 5
  1528. Given:
  1529. :: a : 1
  1530. :: bb : 2
  1531. :: ccc : 3
  1532. :: dd : 4
  1533. :: e : 5
  1534. :: :: a:1
  1535. :: :: b :2
  1536. :: :: ccc : 3
  1537. :: :: dd : 4
  1538. :: :: e : 5
  1539. :: :: f : 6
  1540. Do (Blockwise-visual-operator is also repeatable):
  1541. fa
  1542. \<C-V>
  1543. f1
  1544. 4j
  1545. \<Enter>:
  1546. 7G0
  1547. fa
  1548. .
  1549. Expect:
  1550. :: a: 1
  1551. :: bb: 2
  1552. :: ccc: 3
  1553. :: dd: 4
  1554. :: e: 5
  1555. :: :: a: 1
  1556. :: :: b: 2
  1557. :: :: ccc: 3
  1558. :: :: dd: 4
  1559. :: :: e: 5
  1560. :: :: f : 6
  1561. ###########################################################
  1562. Include: include/teardown.vader