7
mirror of https://github.com/tenderlove/initial-v.git synced 2025-04-22 04:13:22 +00:00

adding the vim plugin

This commit is contained in:
Aaron Patterson 2023-02-13 17:43:33 -08:00
parent ca53a042fd
commit 185e9208a1
No known key found for this signature in database
GPG Key ID: 953170BCB4FFAFC6

View File

@ -0,0 +1,28 @@
let s:path = fnamemodify(resolve(expand('<sfile>:p')), ':h')
let s:cli = fnamemodify(s:path .. "/../../client/zig-out/bin/initial-v", ":p")
fun! Lost()
echom "Lost"
call job_start([s:cli, "general"])
endfun
fun! Gained()
echom "Gained"
call job_start([s:cli, "vim"])
endfun
if filereadable(s:cli)
augroup InitialV
autocmd!
"autocmd FocusGained * :call job_start([s:cli, "vim"])
autocmd FocusGained * :call Gained()
autocmd GUIEnter * :call Gained()
"autocmd FocusLost * :call job_start([s:cli, "general"])
autocmd FocusLost * :call Lost()
autocmd InsertEnter * :silent call job_start([s:cli, "neutral"])
autocmd InsertLeave * :silent call job_start([s:cli, "drive"])
autocmd BufWritePost * :silent call job_start([s:cli, "park"])
augroup END
else
echom "wat"
endif