Created
January 4, 2015 22:38
-
-
Save nicwest/6d3b5392d5a4e7c6ae83 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
if bufexists('DELETEME') | |
bw! DELETEME | |
endif | |
vert new DELETEME | |
let s:contents = system('curl -si http://google.com') | |
call append(0, ['WITH WIERD CHARS:', '-----------------', s:contents]) | |
let s:fix_return_newline = substitute(s:contents, '\r\n', "", 'g') | |
call append('$', ['FIX carrige returns:', '-----------------', s:fix_return_newline, '']) | |
let s:fix_newlines = substitute(s:fix_return_newline, '\n', "", 'g') | |
call append('$', ['FIX NEWLINES:', '-----------------', s:fix_newlines, '']) | |
let s:split_lines = split(s:contents, '\(\n\|\r\n\)') | |
call append('$', ['SPLIT:', '-----------------']) | |
call append('$', s:split_lines) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment