Created
May 15, 2014 17:59
-
-
Save sanmiguel/2907c719c1f970a82da3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function! s:CleanExport(start) | |
| let end = search(']', 'W') | |
| let pos = getpos('.') | |
| call search(',', 'bW', a:start) | |
| if pos != getpos('.') | |
| s/\_\s*,\_\s*\([^]]\+\)\_\s*/]).\r-export([\1/ | |
| call s:CleanExport(a:start) | |
| endif | |
| endfunction | |
| function! TidyExports() | |
| call cursor(1, 1) | |
| let limit = search('^-export(\_[^)]\+,', 'cW') | |
| if limit != 0 | |
| silent s/-export(\_\s*\[\_\s*/-export([/ | |
| call s:CleanExport(limit) | |
| call TidyExports() | |
| endif | |
| endfunction |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See https://gist.github.com/AeroNotix/ff3ad7d142896695bba8