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
|
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:
foo ftp://ftp.bar.net
foo file://path/to/file.txt
foo http://www.bar.com
foo https://bar.org
foo http://192.0.2.1
foo http://subdomain.bar.com
foo https://bar.travel
foo http://bar.very123longtld
foo http://www.ba-r.com
foo http://bar.com:8080
foo http://bar.com/baz
foo http://bar.com/index.html
foo http://www.parameters.org/page2014.html?utm_source=facebook&utm_medium=eventlinkonwall&utm_term=trapshoot&utm_content=calendar_event_on_wall&utm_campaign=trapshoot2014
foo www.bar.com
foo bar
foo 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 (URLs in varying formats):
let b:link_heading = 'Links:'
LinkConvertAll
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expect mail:
foo [0]
foo [1]
foo [2]
foo [3]
foo [4]
foo [5]
foo [6]
foo [7]
foo [8]
foo [9]
foo [10]
foo [11]
foo [12]
foo www.bar.com
foo bar
foo 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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|