The WakaTime plugin works for both Terminal Vim and Graphical Vim and is open-source on GitHub.
Install Vundle for Vim.
From terminal run:
echo "Plugin 'wakatime/vim-wakatime'" >> ~/.vimrc && vim +PluginInstall
(Re-)start Vim and enter your API key , then press Enter.
Use Vim and your coding activity will be displayed on your WakaTime Dashboard.
Inside Vim, press ESC.
Type :PluginUpdate and press Enter.
Remove the line Plugin 'wakatime/vim-wakatime' from your ~/.vimrc.
Restart Vim.
From terminal run:
cd ~/.vim/bundle && git clone git://github.com/wakatime/vim-wakatime.git
(Re-)start Vim and enter your API key , then press Enter.
Use Vim like you normally do and your time will be tracked for you automatically.
Visit https://wakatime.com/dashboard to see your logged time.
From terminal run
cd ~/.vim/bundle/vim-wakatime && git pull origin master
From terminal run
cd ~/.vim/bundle && rm -rf vim-wakatime
This command will only remove the plugin from Vim, but will keep your ~/.wakatime.cfg with your API key and configuration.
Restart Vim.