Skip to content

Instantly share code, notes, and snippets.

@Bakudankun
Last active April 1, 2022 14:00
Show Gist options
  • Save Bakudankun/9364f05ca9ed845bedd0c87b8bb93b2c to your computer and use it in GitHub Desktop.
Save Bakudankun/9364f05ca9ed845bedd0c87b8bb93b2c to your computer and use it in GitHub Desktop.
PARTY OR DIE - Activate by ` :so https://git.io/JO5NW `
vim9script
var hue: number = 0
def Update(timer: number)
hue += 64
hue %= 1536
var r: number = abs(hue - 768) - 256
var g: number = abs(Mod((hue - 512), 1536) - 768) - 256
var b: number = abs(Mod((hue - 1024), 1536) - 768) - 256
r = max([min([r, 255]), 0]) / 2 + 128
g = max([min([g, 255]), 0]) / 2 + 128
b = max([min([b, 255]), 0]) / 2 + 128
hlset([{name: 'Cursor', guifg: '#000000', guibg: printf("#%02x%02x%02x", r, g, b)}])
enddef
def Mod(a: number, b: number): number
if a >= 0
return a % b
endif
return a % b + b
enddef
if !g:->get('partycursor_timer')
g:partycursor_timer = timer_start(15, Update, {repeat: -1})
endif
:set guicursor+=n-v-c:blinkon0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment