Skip to content

Instantly share code, notes, and snippets.

@aesnyder
Created June 30, 2015 22:42
Show Gist options
  • Save aesnyder/7d692b85a51719896237 to your computer and use it in GitHub Desktop.
Save aesnyder/7d692b85a51719896237 to your computer and use it in GitHub Desktop.
Circle CI status in vim-airline
let g:circle_last_update = localtime()
let g:circle_update_frequencey_in_seconds = 30
function! UpdateCirlceStatus()
let output = system('circle status')
if v:shell_error
let g:circle_last_status = 'fail'
else
let g:circle_last_status = 'pass'
endif
return g:circle_last_status
endfunction
let g:circle_last_status = UpdateCirlceStatus()
function! CircleStatus()
let current_time = localtime()
if current_time - g:circle_last_update > g:circle_update_frequencey_in_seconds
let g:circle_last_update = current_time
echo "Checking CI"
call UpdateCirlceStatus()
endif
return g:circle_last_status
endfunction
let g:airline_section_b = "%{CircleStatus()}"
@aesnyder
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment