Last active
February 15, 2016 12:31
-
-
Save anekos/50baa2423e9139840d7d to your computer and use it in GitHub Desktop.
Long cat is long.
This file contains 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:long_cat (n) | |
let l:top = copy([ | |
\ ' /\___/\', | |
\ ' / \', | |
\ ' | o o |', | |
\ ' \ # |', | |
\ ' \ _|_ /', | |
\ ' / \______', | |
\ ' / _______ ___ \', | |
\ ' |_____ \ \__/', | |
\ ' | \__/' | |
\ ]) | |
let l:middle = ' | |' | |
let l:bottom = copy([ | |
\ ' / \', | |
\ ' / ____ \', | |
\ ' | / \ |', | |
\ ' | | | |', | |
\ ' / | | \', | |
\ ' \__/ \__/' | |
\ ]) | |
let l:middles = [] | |
for l:_ in range(1, a:n) | |
let l:middles = add(l:middles, l:middle) | |
endfor | |
return extend(extend(l:top, l:middles), l:bottom) | |
endfunction | |
function! s:spawn_longcat (...) | |
let l:n = get(a:, 1, 20) | |
call append(line('.'), s:long_cat(l:n)) | |
endfunction | |
command! -nargs=? LongCat call s:spawn_longcat(<args>) | |
Author
anekos
commented
Feb 15, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment