2012年6月24日日曜日

Sync Vim with Google Calendar(3/3)

Setting of viske.vim

Next, you can modify your .vimrc to activate Google Calendar Pulgin.

If you installed viske.vim by Bundle, you should check the path of "gcal.rb" first. Please place the script at a below location.

$VIMHOME/ruby/gcal.rb

Then add below settings to .vim.rc so as to activate sync plugin. Please substitute your own value for {CALENDAR-ID}.

let g:viskeGcalId = "{CALENDAR-ID}" 
cal viske#setSyncFunc("viske#gcal")

{CALENDAR-ID} might be the same as a google account. You can check an actual Calendar-ID at a setting of Google Calendar.

Now you can synchronize viske schedule with Google Calendar. Congratulation!!

Parameters

You can modify the behavior of this scripts by below parameters.

Parameter nameDescriptionexample
g:viskeGcalIDCalencar ID to be synchronizedvimyum@gmail.com
g:viskeGcalGetScriptPath to gcal.rb$HOME . ".vim/ruby/gcal.rb"
g:viskeGcalTZoneTime zone"+0900"
g:viskeGcalAuthFilePath to AOuth token$HOME . ".google-api.yaml"
g:viskeSyncNoConfIf it exists, viske does not confirm before synchronizing."true"
g:viskeSyncReadOnlyIf it exists, viske does not apply local change to Google calendar."true"

Caution

This script may contain a lot of bugs. It can damage your data on google calendar by unexpected behavior. Pleas kindly use these scripts at your own risk.