Skip to content

Commit

Permalink
xterm-256 support
Browse files Browse the repository at this point in the history
  • Loading branch information
kat0h committed Jul 23, 2020
1 parent 35293a7 commit 2b9ad9d
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 21 deletions.
4 changes: 0 additions & 4 deletions autoload/nyancat.vim

This file was deleted.

37 changes: 20 additions & 17 deletions plugin/nyancat.vim
Original file line number Diff line number Diff line change
Expand Up @@ -283,22 +283,25 @@ let s:PATTERN1 = [
\]


" Init
let s:popUpWindow = popup_create("", {})
let s:status = 1
call win_execute(s:popUpWindow ,'setlocal filetype=nyancatHL')
"color
function! Nyan()
" Init
let s:popUpWindow = popup_create("", {})
let s:status = 1
call win_execute(s:popUpWindow ,'setlocal filetype=nyancatHL')
"color

while s:status
for i in range(12)
call popup_settext(s:popUpWindow, s:PATTERN1[i])
redraw
if getchar(0)
let s:status = 0
break
endif
sleep 100m
endfor
endwhile
while s:status
for i in range(12)
call popup_settext(s:popUpWindow, s:PATTERN1[i])
redraw
if getchar(0)
let s:status = 0
break
endif
sleep 85m
endfor
endwhile

call popup_close(s:popUpWindow)
call popup_close(s:popUpWindow)
endfunction
command! Nyan call Nyan()
61 changes: 61 additions & 0 deletions syntax/nyancatHL.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
if exists("b:current_syntax")
finish
endif

syn match NyanBlue ','
highlight NyanBlue ctermbg=18
highlight NyanBlue ctermfg=18

syn match NyanWhite '\.'
highlight NyanWhite ctermbg=15
highlight NyanWhite ctermfg=15

syn match NyanBlack '\''
highlight NyanBlack ctermbg=16
highlight NyanBlack ctermfg=16

syn match NyanOrange '@'
highlight NyanOrange ctermbg=223
highlight NyanOrange ctermfg=223

syn match NyanPink '\$'
highlight NyanPink ctermbg=205
highlight NyanPink ctermfg=205

syn match NyanLightPink '-'
highlight NyanLightPink ctermbg=198
highlight NyanLightPink ctermfg=198

syn match NyanRed '>'
highlight NyanRed ctermbg=196
highlight NyanRed ctermfg=196

syn match NyanDeepOrange '&'
highlight NyanDeepOrange ctermbg=202
highlight NyanDeepOrange ctermfg=202

syn match NyanYellow '+'
highlight NyanYellow ctermbg=226
highlight NyanYellow ctermfg=226

syn match NyanLightGreen '#'
highlight NyanLightGreen ctermbg=46
highlight NyanLightGreen ctermfg=46

syn match NyanLightBlue '='
highlight NyanLightBlue ctermbg=75
highlight NyanLightBlue ctermfg=75

syn match NyanPurple ';'
highlight NyanPurple ctermbg=57
highlight NyanPurple ctermfg=57

syn match NyanGray '\*'
highlight NyanGray ctermbg=246
highlight NyanGray ctermfg=246

syn match NyanPalePink '%'
highlight NyanPalePink ctermbg=213
highlight NyanPalePink ctermfg=213

let b:current_syntax = "nyancatHL"

0 comments on commit 2b9ad9d

Please sign in to comment.