File: convert_all.vader

package info (click to toggle)
vim-link-vim 2.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 524 kB
  • sloc: python: 66; makefile: 30
file content (494 lines) | stat: -rw-r--r-- 14,641 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
Before:
  unlet! g:link_heading
  unlet! b:link_heading
  unlet! b:link_heading_before
  unlet! b:link_skip_line
After:
  unlet! g:link_heading
  unlet! b:link_heading
  unlet! b:link_heading_before
  unlet! b:link_skip_line

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Given mail:
  www.bar.com
  Fluke furl ftp://ftp.bar.net scuttle coffer
  file://path/to/file.txt hang the jib spyglass driver crack Jennys tea cup.
  Quarterdeck run a http://www.bar.com
  rig Jolly Roger https://bar.org gangway http://192.0.2.1 no prey,
  no pay pirate quarter log http://subdomain.bar.com
  schooner draft https://bar.travel
  http://bar.very123longtld
  Scurvy Admiral of the Black spirits clipper http://www.ba-r.com Nipperkin
  http://bar.com:8080 Jolly Roger matey hulk aye
  http://bar.com/baz
  booty provost killick bounty http://bar.com/index.html
  http://www.parameters.org/page2014.html?utm_source=facebook&utm_medium=eventlinkonwall&utm_term=trapshoot&utm_content=calendar_event_on_wall&utm_campaign=trapshoot2014
  bar
  bar.com
  Line containing something resembling an inline link: command! -buffer -range=% -bar TagLinks silent keeppatterns <line1>,<line2>substitute#\v%(\[[^\]]+\]\(\s*)@<!\zs<https?://([^.]+)\S+#[\1](\0)#giep
Execute (Convert all URLs in a mail buffer):
  let b:link_heading = 'Links:'
  LinkConvertAll

Expect mail:
  www.bar.com
  Fluke furl [0] scuttle coffer
  [1] hang the jib spyglass driver crack Jennys tea cup.
  Quarterdeck run a [2]
  rig Jolly Roger [3] gangway [4] no prey,
  no pay pirate quarter log [5]
  schooner draft [6]
  [7]
  Scurvy Admiral of the Black spirits clipper [8] Nipperkin
  [9] Jolly Roger matey hulk aye
  [10]
  booty provost killick bounty [11]
  [12]
  bar
  bar.com
  Line containing something resembling an inline link: command! -buffer -range=% -bar TagLinks silent keeppatterns <line1>,<line2>substitute#\v%(\[[^\]]+\]\(\s*)@<!\zs<https?://([^.]+)\S+#[\1](\0)#giep

  Links:

  [0]: ftp://ftp.bar.net
  [1]: file://path/to/file.txt
  [2]: http://www.bar.com
  [3]: https://bar.org
  [4]: http://192.0.2.1
  [5]: http://subdomain.bar.com
  [6]: https://bar.travel
  [7]: http://bar.very123longtld
  [8]: http://www.ba-r.com
  [9]: http://bar.com:8080
  [10]: http://bar.com/baz
  [11]: http://bar.com/index.html
  [12]: http://www.parameters.org/page2014.html?utm_source=facebook&utm_medium=eventlinkonwall&utm_term=trapshoot&utm_content=calendar_event_on_wall&utm_campaign=trapshoot2014

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Given gitcommit:
  Update README.md with project documentation links

  This commit updates the README.md file to include links to various project
  documentation resources. The documentation includes:

  1. Project Wiki: https://github.com/example/project/wiki
  2. API Documentation: https://api.example.com/docs
  3. User Guide: https://docs.example.com/user-guide
  4. Developer Documentation: https://docs.example.com/developer-guide

  Each link provides access to specific documentation sections relevant to
  different stakeholders involved in the project. This update ensures that
  stakeholders can easily access the necessary documentation directly from the
  project's README file.

  # Please enter the commit message for your changes. Lines starting
  # with '#' will be ignored, and an empty message aborts the commit.
  #
  # On branch main
  # Changes to be committed:
  #	modified:   README.md
  #
Execute (Convert all URLs in a gitcommit buffer, reposition reference section):
  let b:link_heading = 'Links:'
  let b:link_heading_before = '^# Please enter'
  LinkConvertAll

Expect gitcommit:
  Update README.md with project documentation links

  This commit updates the README.md file to include links to various project
  documentation resources. The documentation includes:

  1. Project Wiki: [0]
  2. API Documentation: [1]
  3. User Guide: [2]
  4. Developer Documentation: [3]

  Each link provides access to specific documentation sections relevant to
  different stakeholders involved in the project. This update ensures that
  stakeholders can easily access the necessary documentation directly from the
  project's README file.

  Links:

  [0]: https://github.com/example/project/wiki
  [1]: https://api.example.com/docs
  [2]: https://docs.example.com/user-guide
  [3]: https://docs.example.com/developer-guide

  # Please enter the commit message for your changes. Lines starting
  # with '#' will be ignored, and an empty message aborts the commit.
  #
  # On branch main
  # Changes to be committed:
  #	modified:   README.md
  #
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Given mail:
  http://www.bar.com
  Fluke furl ftp://ftp.bar.net scuttle coffer
  file://path/to/file.txt hang the jib spyglass driver crack Jennys tea cup.
  > Quarterdeck run a http://www.bar.com
  > rig Jolly Roger https://bar.org gangway http://192.0.2.1 no prey,
  > no pay pirate quarter log http://subdomain.bar.com
  schooner draft https://bar.travel
~~~~~
Execute (Skip some lines in a mail buffer):
  let b:link_skip_line = '^>'
  let b:link_heading = 'Links:'
  LinkConvertAll
~~~~~
Expect mail:
  [0]
  Fluke furl [1] scuttle coffer
  [2] hang the jib spyglass driver crack Jennys tea cup.
  > Quarterdeck run a http://www.bar.com
  > rig Jolly Roger https://bar.org gangway http://192.0.2.1 no prey,
  > no pay pirate quarter log http://subdomain.bar.com
  schooner draft [3]

  Links:

  [0]: http://www.bar.com
  [1]: ftp://ftp.bar.net
  [2]: file://path/to/file.txt
  [3]: https://bar.travel
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Given gitcommit:
  Git commit title

  Git https://comm.it body
  Body continued

  # Please enter the commit message for your changes. Lines starting
  # with '#' will be ignored, and an empty message aborts the commit.
  #
  # On branch main
  # Changes to be committed:
  #	modified:   foo.txt
  #
~~~~~
Execute (Gitcommit buffer, custom heading, repositioned reference section):
  let b:link_heading = 'Links:'
  let b:link_heading_before = '^# Please enter'
  LinkConvertAll
~~~~~
Expect gitcommit:
  Git commit title

  Git [0] body
  Body continued

  Links:

  [0]: https://comm.it

  # Please enter the commit message for your changes. Lines starting
  # with '#' will be ignored, and an empty message aborts the commit.
  #
  # On branch main
  # Changes to be committed:
  #	modified:   foo.txt
  #
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Given mail:
  Hi Recipient,

  I hope this email https://email.com finds you well.

  Best regards,
  Your Name

  --
  Your Job Title
  Your Company Name
  Your Contact Information
~~~~~
Execute (Mail buffer):
  let b:link_heading = 'Links:'
  let b:link_heading_before = '^--'
  LinkConvertAll
~~~~~
Expect mail:
  Hi Recipient,

  I hope this email [0] finds you well.

  Best regards,
  Your Name

  Links:

  [0]: https://email.com

  --
  Your Job Title
  Your Company Name
  Your Contact Information
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Given mail:
  Subject: Join Our Webinar Series!

  Hi John,

  Exciting news! We're hosting a series of webinars on Vim and Neovim. Here's
  the schedule:

  Intro to Vim: Join here: https://vim.com/webinar1 or https://vimbackup.com/webinar1
  Advanced Vim Techniques: Join here: http://www.vim.com/webinar2
  Q&A with Experts: Join here: http://vim.com/webinar3

  Intro to Neovim: Join here: https://neovim.com/webinar1 or https://neovimbackup.com/webinar1
  > Advanced Neovim Techniques: Join here: www.neovim.com/webinar2
  Q&A with Experts: Join here: http://neovim.com/webinar3

  Don't miss out — register now! Let us know if you have any questions.

  Cheers,
  Jane
~~~~~
Execute (Mail buffer):
  let b:link_heading = 'Full Links:'
  let b:link_heading_before = '^Cheers'
  let b:link_skip_line = '^>'
  LinkConvertAll
~~~~~
Expect mail:
  Subject: Join Our Webinar Series!

  Hi John,

  Exciting news! We're hosting a series of webinars on Vim and Neovim. Here's
  the schedule:

  Intro to Vim: Join here: [0] or [1]
  Advanced Vim Techniques: Join here: [2]
  Q&A with Experts: Join here: [3]

  Intro to Neovim: Join here: [4] or [5]
  > Advanced Neovim Techniques: Join here: www.neovim.com/webinar2
  Q&A with Experts: Join here: [6]

  Don't miss out — register now! Let us know if you have any questions.

  Full Links:

  [0]: https://vim.com/webinar1
  [1]: https://vimbackup.com/webinar1
  [2]: http://www.vim.com/webinar2
  [3]: http://vim.com/webinar3
  [4]: https://neovim.com/webinar1
  [5]: https://neovimbackup.com/webinar1
  [6]: http://neovim.com/webinar3

  Cheers,
  Jane
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Given mail (Two identical links on the same line):
  foo https://www.vim.org bar https://www.vim.org baz
Execute:
  let b:link_heading = 'Links:'
  LinkConvertAll

Expect mail:
  foo [0] bar [0] baz

  Links:

  [0]: https://www.vim.org
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Given mail (URLs with trailing punctuation characters):
  foo https://www.vim.org, bar
  baz https://neovim.io. qux
-----

Execute:
  LinkConvertAll

-----

Expect mail:
  foo [0], bar
  baz [1]. qux

  Links:

  [0]: https://www.vim.org
  [1]: https://neovim.io
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Given mail:
  foo (https://www.vim.org) bar
Execute (URL within parentheses):
  LinkConvertAll

Expect mail:
  foo ([0]) bar

  Links:

  [0]: https://www.vim.org
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Given gitcommit:
  Update README.md with project documentation links

  This commit updates the README.md file to include links to various project
  documentation resources. The documentation includes:

  1. Project Wiki: https://github.com/example/project/wiki
  2. API Documentation: https://api.example.com/docs
  3. User Guide: https://docs.example.com/user-guide
  4. Developer Documentation: https://docs.example.com/developer-guide

  # Please enter the commit message for your changes. Lines starting
  # with '#' will be ignored, and an empty message aborts the commit.
  #
  # On branch main
  # Changes to be committed:
  #	modified:   README.md
  #
Execute (Gitcommit buffer, reposition reference section, empty heading):
  let b:link_heading = ''
  let b:link_heading_before = '^# Please enter'
  LinkConvertAll

Expect gitcommit:
  Update README.md with project documentation links

  This commit updates the README.md file to include links to various project
  documentation resources. The documentation includes:

  1. Project Wiki: [0]
  2. API Documentation: [1]
  3. User Guide: [2]
  4. Developer Documentation: [3]

  [0]: https://github.com/example/project/wiki
  [1]: https://api.example.com/docs
  [2]: https://docs.example.com/user-guide
  [3]: https://docs.example.com/developer-guide

  # Please enter the commit message for your changes. Lines starting
  # with '#' will be ignored, and an empty message aborts the commit.
  #
  # On branch main
  # Changes to be committed:
  #	modified:   README.md
  #
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Given mail:
  Subject: Join Our Webinar Series!

  Hi John,

  Exciting news! We're hosting a series of webinars on Vim and Neovim. Here's
  the schedule:

  Intro to Vim: Join here: https://vim.com/webinar1 or https://vimbackup.com/webinar1
  Advanced Vim Techniques: Join here: http://www.vim.com/webinar2
  Q&A with Experts: Join here: http://vim.com/webinar3

  Intro to Neovim: Join here: https://neovim.com/webinar1 or https://neovimbackup.com/webinar1
  > Advanced Neovim Techniques: Join here: www.neovim.com/webinar2
  Q&A with Experts: Join here: http://neovim.com/webinar3

  Cheers,
  Jane
~~~~~
Execute (Empty heading, reposition):
  let b:link_heading = ''
  let b:link_heading_before = '^Cheers'
  let b:link_skip_line = '^>'
  LinkConvertAll
~~~~~
Expect mail:
  Subject: Join Our Webinar Series!

  Hi John,

  Exciting news! We're hosting a series of webinars on Vim and Neovim. Here's
  the schedule:

  Intro to Vim: Join here: [0] or [1]
  Advanced Vim Techniques: Join here: [2]
  Q&A with Experts: Join here: [3]

  Intro to Neovim: Join here: [4] or [5]
  > Advanced Neovim Techniques: Join here: www.neovim.com/webinar2
  Q&A with Experts: Join here: [6]

  [0]: https://vim.com/webinar1
  [1]: https://vimbackup.com/webinar1
  [2]: http://www.vim.com/webinar2
  [3]: http://vim.com/webinar3
  [4]: https://neovim.com/webinar1
  [5]: https://neovimbackup.com/webinar1
  [6]: http://neovim.com/webinar3

  Cheers,
  Jane
= 11 ===========================================================================

Given mail (URL is already present in reference section):
  Intro to Vim: Join here: [0]
  Follow the webinar at: https://vim.com/webinar1
  Intro to Neovim: Join here: https://neovim.com/webinar1 or https://neovimbackup.com/webinar1
  Into to Vim: https://vim.com/webinar1

  Links:

  [0]: https://vim.com/webinar1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Execute:
  LinkConvertAll

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expect mail:
  Intro to Vim: Join here: [0]
  Follow the webinar at: [0]
  Intro to Neovim: Join here: [1] or [2]
  Into to Vim: [0]

  Links:

  [0]: https://vim.com/webinar1
  [1]: https://neovim.com/webinar1
  [2]: https://neovimbackup.com/webinar1
= 12 ===========================================================================

Given mail (URL is not yet present in reference section, but same URL is present multiple times in body):
  Intro to Vim: Join here: https://vim.com/webinar1
  Follow the webinar at: https://vim.com/webinar1
  Intro to Neovim: Join here: https://neovim.com/webinar1 or https://neovimbackup.com/webinar1
  Into to Vim: https://vim.com/webinar1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Execute:
  LinkConvertAll

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expect mail:
  Intro to Vim: Join here: [0]
  Follow the webinar at: [0]
  Intro to Neovim: Join here: [1] or [2]
  Into to Vim: [0]

  Links:

  [0]: https://vim.com/webinar1
  [1]: https://neovim.com/webinar1
  [2]: https://neovimbackup.com/webinar1
================================================================================