Git Product home page Git Product logo

vim-wakatime's Introduction

vim-wakatime

Vim Neovim MacVim gVim Coding time tracker

WakaTime is an open source Vim plugin for metrics, insights, and time tracking automatically generated from your programming activity.

Installation

  1. With Vundle: echo "Plugin 'wakatime/vim-wakatime'" >> ~/.vimrc && vim +PluginInstall

    Or with Pathogen: cd ~/.vim/bundle && git clone https://github.com/wakatime/vim-wakatime.git

    Or with Vim-plug: add Plug 'wakatime/vim-wakatime' to .vimrc file. While in vim reload .vimrc with :so ~/.vimrc or restart vim, enter :PlugInstall

    Or with Packer: add use 'wakatime/vim-wakatime' to your plugins file.

    Or with Vim 8+: mkdir -p ~/.vim/pack/plugins/start && ~/.vim/pack/plugins/start && git clone https://github.com/wakatime/vim-wakatime.git

    Or with Lazy.nvim: add to your plugins file.

    { 'wakatime/vim-wakatime', lazy = false }
  2. Restart Vim.

  3. If this is the first WakaTime plugin on your machine, type :WakaTimeApiKey inside Vim.

  4. Enter your API Key, then press enter.

  5. Use Vim and your coding activity will be displayed on your WakaTime dashboard.

Screen Shots

Project Overview

Commands

  • :WakaTimeApiKey - set or change the api key saved in your ~/.wakatime.cfg
  • :WakaTimeDebugEnable - enable debug mode (may slow down Vim so disable when finished debugging)
  • :WakaTimeDebugDisable - disable debug mode
  • :WakaTimeScreenRedrawEnable - enable screen redraw to prevent artifacts (only for Vim < 8.0)
  • :WakaTimeScreenRedrawEnableAuto - redraw screen when plugin takes too long (only for Vim < 8.0)
  • :WakaTimeScreenRedrawDisable - disable screen redraw
  • :WakaTimeToday - echo your total coding activity for Today

The vim-wakatime plugin automatically downloads and updates wakatime-cli in your $WAKATIME_HOME/.wakatime/ folder. WakaTime plugins also share a common $WAKATIME_HOME/.wakatime.cfg config file. $WAKATIME_HOME defaults to your $HOME folder.

Troubleshooting

Run :WakaTimeDebugEnable in Vim then run this Terminal command:

tail -f ~/.wakatime/wakatime.log

Enabling Debug Mode writes Vim Script errors to your Vim Status Bar and tells wakatime-cli to write verbose logs to $WAKATIME_HOME/.wakatime/wakatime.log.

Debug mode can make it hard to find the real error because of all the extra logging, so also try disabling Debug Mode while tailing ~/.wakatime/wakatime.log and editing files in Vim. With Debug Mode enabled, the plugin sends data synchronously so disable it when finished debugging with :WakaTimeDebugDisable.

The How to Debug Plugins guide shows how to check when coding activity was last received from Vim use the User Agents API. For more general troubleshooting info, see the wakatime-cli Troubleshooting Section.

Uninstalling

  1. Remove Plugin 'wakatime/vim-wakatime' from your .vimrc file.

  2. Run in terminal: rm ~/.wakatime.*.

  3. Run in terminal: vim +PluginClean.

If using vim-plug

While in vim

  1. Delete or comment out Plug command from .vimrc file.

  2. Reload vimrc (:so ~/.vimrc) or restart vim

  3. Run :PlugClean, it will detect and remove undeclared plugins.

vim-wakatime's People

Contributors

5ht2 avatar alanhamlett avatar bentglasstube avatar blurgyy avatar borwe avatar bradbeam avatar gandarez avatar gzxultra avatar hash-bang avatar holiq avatar jaspertandy avatar mephistophiles avatar moeshin avatar namestarlit avatar nishu-murmu avatar pharbi avatar queensferryme avatar rohitpaulk avatar shadmeoli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-wakatime's Issues

Errors when wakatime.com is not responding.

For some reason wakatime.com is not responding for me so vim plugin constantly writes errors on top of vim window, so I unable to work with it. There is some logs:

{"now": "2016/07/04 21:32:08 +0300", "version": "6.0.6", "plugin": "vim/703 vim-wakatime/4.0.12", "time": 1467657068.24605, "level": "ERROR", "message": "Traceback (most recent call last):\n  File \"/Users/maks/.vim/bundle/vim-wakatime/plugin/packages/wakatime/logger.py\", line 77, in traceback_formatter\n    level = kwargs.get('level', args[0]).lower()\nIndexError: tuple index out of range\n"}
Traceback (most recent call last):
  File "/Users/maks/.vim/bundle/vim-wakatime/plugin/packages/wakatime/main.py", line 518, in execute
    retval = process_heartbeat(args, configs, hostname, heartbeat)
  File "/Users/maks/.vim/bundle/vim-wakatime/plugin/packages/wakatime/main.py", line 496, in process_heartbeat
    return send_heartbeat(**heartbeat)
  File "/Users/maks/.vim/bundle/vim-wakatime/plugin/packages/wakatime/main.py", line 374, in send_heartbeat
    proxies=proxies, timeout=timeout)
  File "/Users/maks/.vim/bundle/vim-wakatime/plugin/packages/wakatime/packages/requests/sessions.py", line 518, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "/Users/maks/.vim/bundle/vim-wakatime/plugin/packages/wakatime/packages/requests/sessions.py", line 475, in request
    resp = self.send(prep, **send_kwargs)
  File "/Users/maks/.vim/bundle/vim-wakatime/plugin/packages/wakatime/packages/requests/sessions.py", line 585, in send
    r = adapter.send(request, **kwargs)
  File "/Users/maks/.vim/bundle/vim-wakatime/plugin/packages/wakatime/packages/requests/adapters.py", line 403, in send
    timeout=timeout
  File "/Users/maks/.vim/bundle/vim-wakatime/plugin/packages/wakatime/packages/requests/packages/urllib3/connectionpool.py", line 640, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/Users/maks/.vim/bundle/vim-wakatime/plugin/packages/wakatime/packages/requests/packages/urllib3/util/retry.py", line 284, in increment
    _observed_errors=_observed_errors)
  File "/Users/maks/.vim/bundle/vim-wakatime/plugin/packages/wakatime/packages/requests/packages/urllib3/util/retry.py", line 153, in new
    raise_on_status=self.raise_on_status,
AttributeError: 'Retry' object has no attribute 'raise_on_status'

{"now": "2016/07/04 21:32:19 +0300", "version": "6.0.6", "plugin": "vim/704 vim-wakatime/4.0.12", "time": 1467657079.319077, "level": "ERROR", "message": "Traceback (most recent call last):\n  File \"/Users/maks/.vim/bundle/vim-wakatime/plugin/packages/wakatime/logger.py\", line 77, in traceback_formatter\n    level = kwargs.get('level', args[0]).lower()\nIndexError: tuple index out of range\n"}
{"now": "2016/07/04 21:32:57 +0300", "version": "6.0.6", "plugin": "vim/704 vim-wakatime/4.0.12", "time": 1467657117.530476, "level": "ERROR", "message": "Traceback (most recent call last):\n  File \"/Users/maks/.vim/bundle/vim-wakatime/plugin/packages/wakatime/logger.py\", line 77, in traceback_formatter\n    level = kwargs.get('level', args[0]).lower()\nIndexError: tuple index out of range\n"}

And it writes those 'Tracebacks' into my vim window.

Huge CPU hit when doing :bufdo

Hello, I have a somewhat huge'ish amount of files ( ~140 files ), and when I run a bufdo in all of them, wakatime ( exactly python -W ignore /home/.../vim-wakatime/plugin/packages/wakatime/cli.py --entity ... ) spawns like 10+ processes, each consuming up to 5% of the cpu ( 50% in total ).

Is there a way to disable wakatime on bufdo's ? Is this expected behavior?

cpu_usage

Error when sending heartbeats: Invalid arguments for function job_start

The following error shows up every once in a while:

Error detected while processing function <SNR>49_InitAndHandleActivity[3]..<SNR>49_HandleActivity[23]..<SNR>49_SendHeartbeats:
line   38:
E121: Undefined variable: channel
E116: Invalid arguments for function job_start([&shell, &shellcmdflag, s:JoinArgs(cmd)], { 'stoponexit': '', 'callback': {channel, output -> s:AsyncHandler(output, cmd)}})
E15: Invalid expression: job_start([&shell, &shellcmdflag, s:JoinArgs(cmd)], { 'stoponexit': '', 'callback': {channel, output -> s:AsyncHandler(output, cmd)}})
line   42:
E121: Undefined variable: job
E116: Invalid arguments for function job_getchannel(job)
E15: Invalid expression: job_getchannel(job)
line   43:
E121: Undefined variable: channel
E116: Invalid arguments for function ch_sendraw
Press ENTER or type command to continue
Error detected while processing function <SNR>49_HandleActivity[23]..<SNR>49_SendHeartbeats:
line   38:
E121: Undefined variable: channel
Error detected while processing function <SNR>49_HandleActivity[23]..<SNR>49_SendHeartbeats:
line   38:
E116: Invalid arguments for function job_start([&shell, &shellcmdflag, s:JoinArgs(cmd)], { 'stoponexit': '', 'callback': {channel, output -> s:AsyncHandler(output, cmd)}})
Press ENTER or type command to continue
Error detected while processing function <SNR>49_HandleActivity[23]..<SNR>49_SendHeartbeats:
line   38:
E15: Invalid expression: job_start([&shell, &shellcmdflag, s:JoinArgs(cmd)], { 'stoponexit': '', 'callback': {channel, output -> s:AsyncHandler(output, cmd)}})
Press ENTER or type command to continue
Error detected while processing function <SNR>49_HandleActivity[23]..<SNR>49_SendHeartbeats:
line   42:
E121: Undefined variable: job
Press ENTER or type command to continue
Error detected while processing function <SNR>49_HandleActivity[23]..<SNR>49_SendHeartbeats:
line   42:
E116: Invalid arguments for function job_getchannel(job)
Press ENTER or type command to continue
Error detected while processing function <SNR>49_HandleActivity[23]..<SNR>49_SendHeartbeats:
line   42:
E15: Invalid expression: job_getchannel(job)
Press ENTER or type command to continue
Error detected while processing function <SNR>49_HandleActivity[23]..<SNR>49_SendHeartbeats:
line   43:
E121: Undefined variable: channel
Press ENTER or type command to continue
Error detected while processing function <SNR>49_HandleActivity[23]..<SNR>49_SendHeartbeats:
line   43:
E116: Invalid arguments for function ch_sendraw
Press ENTER or type command to continue
$ vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 24 2016 16:44:48)
Included patches: 1-1689
Extra patches: 8.0.0056
Modified by [email protected]
Compiled by [email protected]
Huge version without GUI.  Features included (+) or not (-):
+acl             +farsi           +mouse_netterm   +tag_binary
+arabic          +file_in_path    +mouse_sgr       +tag_old_static
+autocmd         +find_in_path    -mouse_sysmouse  -tag_any_white
-balloon_eval    +float           +mouse_urxvt     -tcl
-browse          +folding         +mouse_xterm     +terminfo
++builtin_terms  -footer          +multi_byte      +termresponse
+byte_offset     +fork()          +multi_lang      +textobjects
+channel         +gettext         -mzscheme        +timers
+cindent         -hangul_input    +netbeans_intg   +title
-clientserver    +iconv           +packages        -toolbar
-clipboard       +insert_expand   +path_extra      +user_commands
+cmdline_compl   +job             -perl            +vertsplit
+cmdline_hist    +jumplist        +persistent_undo +virtualedit
+cmdline_info    +keymap          +postscript      +visual
+comments        +langmap         +printer         +visualextra
+conceal         +libcall         +profile         +viminfo
+cryptv          +linebreak       -python          +vreplace
+cscope          +lispindent      +python3         +wildignore
+cursorbind      +listcmds        +quickfix        +wildmenu
+cursorshape     +localmap        +reltime         +windows
+dialog_con      -lua             +rightleft       +writebackup
+diff            +menu            -ruby            -X11
+digraphs        +mksession       +scrollbind      -xfontset
-dnd             +modify_fname    +signs           -xim
-ebcdic          +mouse           +smartindent     -xsmp
+emacs_tags      -mouseshape      +startuptime     -xterm_clipboard
+eval            +mouse_dec       +statusline      -xterm_save
+ex_extra        +mouse_gpm       -sun_workshop    -xpm
+extra_search    -mouse_jsbterm   +syntax          
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H   -Wdate-time  -g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1      
Linking: gcc   -Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim        -lm -ltinfo -lnsl  -lselinux  -lacl -lattr -lgpm -ldl     -L/usr/lib/python3.5/config-3.5m-x86_64-linux-gnu -lpython3.5m -lpthread -ldl -lutil -lm      

Running on Ubuntu 16.04.3 LTS 64-bit. I have set the API key via the :WakaTimeApiKey command, and the .wakatime.cfg file is present in the home directory. Other plugins requiring Python runs correctly (e.g. youcompleteme). The plugin was installed with vim-plug.

Errors when using zsh as vim shell

If you set set shell=zsh\ --login in your vim config, the plugin stops working.

I can see this error in the messages panel:

[WakaTime] Heartbeat Command: 'python' '-W' 'ignore' '/Users/fer/Dropbox/dotfiles/.vim/plugged/vim-wakatime/plugin/packages/wakatime/cli.py' '--entity' '/path/to/my/file.elm' '--time' '150836
3996.038438' '--plugin' 'vim/800 vim-wakatime/6.0.1' '--write' '--language' 'elm'^@[WakaTime] Error: executing job failed: No such file or directory

This error happens in both macOS and Arch Linux.

Unicode errors when editting gpg encrypted files (using vim-gpg)

I get the following error frequently when I edit GPG encrypted files:

Traceback (most recent call last):
  File "/home/alan/.vim/bundle/vim-wakatime/plugin/packages/wakatime/wakatime-cli.py", line 20, in <module>
  sys.exit(wakatime.main(sys.argv))
  File "/home/alan/.vim/bundle/vim-wakatime/plugin/packages/wakatime/wakatime/__init__.py", line 375, in main
  stats = get_file_stats(args.targetFile)
  File "/home/alan/.vim/bundle/vim-wakatime/plugin/packages/wakatime/wakatime/stats.py", line 96, in get_file_stats
  'lines': number_lines_in_file(file_name),
  File "/home/alan/.vim/bundle/vim-wakatime/plugin/packages/wakatime/wakatime/stats.py", line 86, in number_lines_in_file
  for line in f:
  File "/usr/lib/python3.4/codecs.py", line 313, in decode
  (result, consumed) = self._buffer_decode(data, self.errors, final)
  UnicodeDecodeError: 'utf-8' codec can't decode byte 0x85 in position 0: invalid start byte

Not sure I got the formatting of the traceback right - it was output with seemingly incorrect line endings that made it look like garbage in my terminal.

'NoneType' has no attribute 'name'

I'm getting this error on stats.py, at line 43.
I'm sorry for just citing this issue instead of providing a patch, but I'm out of time right now :/

Huge delay added to switching tabs

I'm using lots of tabs with many windows when I'm coding and when I added this plugin to my Vim the performance really tanked. From taking a couple milliseconds between tab switches it now takes around 0.5+ everytime I switch tab in Vim.

My guess is that this line is the cause:
autocmd BufEnter * call s:handleActivity(s:false) found here: https://github.com/wakatime/vim-wakatime/blob/master/plugin/wakatime.vim#L312

Does it really have to call this method every single time on every single buffer in the tab I switch to?
Could this be refactored to use the new async API that has been implemented in the latest Vim or NeoVim?

Installation in combination with other IDEs

Hey there,

I found a bug concerning the wakatime.cfg.
I have Wakatime installed for Sublime which has its own configuration files for stuff like the api key, but also uses the .wakatime.cfg in the $HOME directory.
VIM have not tried to prompt me for my API key, because the .wakatime.cfg has been already there. The only thing that was in there though was the debug and the hidefilenames directive.
So what happend? VIM put a lot of error code in my source code about a missing API key and the usage of the client binary.
I think that is not right, either. A plugin should not mess with the file content in my editor, right?
I am not familiar with VIM, so maybe that is normal.

Anyway, problems with multiple IDEs running using the same configuration.

If you need anything more, you know how to reach me ;)

TypeError: unorderable types: LexerMeta() < LexerMeta()

Got this output after updating today:

Traceback (most recent call last):
  File "/home/alan/.vim/bundle/vim-wakatime/plugin/packages/wakatime/wakatime-cli.py", line 21, in <module>
    sys.exit(wakatime.main(sys.argv))
  File "/home/alan/.vim/bundle/vim-wakatime/plugin/packages/wakatime/wakatime/__init__.py", line 195, in main
    stats = get_file_stats(args.targetFile)
  File "/home/alan/.vim/bundle/vim-wakatime/plugin/packages/wakatime/wakatime/stats.py", line 53, in get_file_stats
    'language': guess_language(file_name),
  File "/home/alan/.vim/bundle/vim-wakatime/plugin/packages/wakatime/wakatime/stats.py", line 31, in guess_language
    lexer = guess_lexer_for_filename(file_name, f.read(512000))
  File "/home/alan/.vim/bundle/vim-wakatime/plugin/packages/wakatime/wakatime/packages/pygments3/pygments/lexers/__init__.py", line 191, in guess_lexer_for_filename
    result.sort()
TypeError: unorderable types: LexerMeta() < LexerMeta()

Problem with python urllib3/ssl and OpenSSL 0.9.8e

I just updated wakatime vim plugin to the version 3.0.7 and started to get a lot of these errors:

Traceback (most recent call last):
  File "/root/.vim/bundle/vim-wakatime/plugin/packages/wakatime/wakatime-cli.py", line 20, in <module>
    sys.exit(wakatime.main(sys.argv))
  File "/root/.vim/bundle/vim-wakatime/plugin/packages/wakatime/wakatime/__init__.py", line 406, in main
    **vars(args)
  File "/root/.vim/bundle/vim-wakatime/plugin/packages/wakatime/wakatime/__init__.py", line 323, in send_heartbeat
    proxies=proxies)
  File "/root/.vim/bundle/vim-wakatime/plugin/packages/wakatime/wakatime/packages/requests/api.py", line 99, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/root/.vim/bundle/vim-wakatime/plugin/packages/wakatime/wakatime/packages/requests/api.py", line 49, in request
    response = session.request(method=method, url=url, **kwargs)
  File "/root/.vim/bundle/vim-wakatime/plugin/packages/wakatime/wakatime/packages/requests/sessions.py", line 461, in request
    resp = self.send(prep, **send_kwargs)
  File "/root/.vim/bundle/vim-wakatime/plugin/packages/wakatime/wakatime/packages/requests/sessions.py", line 573, in send
    r = adapter.send(request, **kwargs)
  File "/root/.vim/bundle/vim-wakatime/plugin/packages/wakatime/wakatime/packages/requests/adapters.py", line 370, in send
    timeout=timeout
  File "/root/.vim/bundle/vim-wakatime/plugin/packages/wakatime/wakatime/packages/requests/packages/urllib3/connectionpool.py", line 529, in urlopen
    body=body, headers=headers)
  File "/root/.vim/bundle/vim-wakatime/plugin/packages/wakatime/wakatime/packages/requests/packages/urllib3/connectionpool.py", line 326, in _make_request
    self._validate_conn(conn)
  File "/root/.vim/bundle/vim-wakatime/plugin/packages/wakatime/wakatime/packages/requests/packages/urllib3/connectionpool.py", line 740, in _validate_conn
    conn.connect()
  File "/root/.vim/bundle/vim-wakatime/plugin/packages/wakatime/wakatime/packages/requests/packages/urllib3/connection.py", line 238, in connect
    ssl_version=resolved_ssl_version)
  File "/root/.vim/bundle/vim-wakatime/plugin/packages/wakatime/wakatime/packages/requests/packages/urllib3/util/ssl_.py", line 254, in ssl_wrap_socket
    return context.wrap_socket(sock)
  File "/usr/local/lib/python3.4/ssl.py", line 364, in wrap_socket
    _context=self)
  File "/usr/local/lib/python3.4/ssl.py", line 535, in __init__
    raise ValueError("check_hostname requires server_hostname, "
ValueError: check_hostname requires server_hostname, but it's not supported by your OpenSSL library

I don't get these errors when using version 3.0.6 so the cause is probably the change from urllib2 to the requests library... Proper thing to do would be update my OpenSSL but alas, that is not possible because I'm running CentOS 5.

Is there any way around this so that I can keep using newer versions?

ImportError: cannot import name MAXREPEAT

Heyo! Interested in using your plugin. After performing :BundleInstall though, I got this output. Also get this anytime I open vim which makes it crash:

Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 563, in <module>
    main()
  File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 545, in main
    known_paths = addusersitepackages(known_paths)
  File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 278, in addusersitepackages
    user_site = getusersitepackages()
  File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 253, in getusersitepackages
    user_base = getuserbase() # this will also set USER_BASE
  File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 243, in getuserbase
    USER_BASE = get_config_var('userbase')
  File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.py", line 472, in get_config_var
    return get_config_vars().get(name)
  File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.py", line 405, in get_config_vars
    import re
  File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py", line 105, in <module>
    import sre_compile
  File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_compile.py", line 14, in <module>
    import sre_parse
  File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_parse.py", line 17, in <module>
    from sre_constants import *
  File "/usr/local/Cellar/python/2.7.4/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sre_constants.py", line 18, in <module>
    from _sre import MAXREPEAT
ImportError: cannot import name MAXREPEAT

pkg_resources issues UserWarning: Module XXXX was already imported

I'm using Ubuntu 13.04, vim 7.4.52 and python 2.7.4.

I have installed simplejson at site-packages and vim complains:

~/.vim/bundle/vim-wakatime/plugin/packages/wakatime/wakatime/packages/pygments2/pygments/plugin.py:39: UserWarning: Module simplejson was already imported from ~/.vim/bundle/vim-wakatime/plugin/packages/wakatime/wakatime/packages/simplejson/init.pyc, but /usr/lib/python2.7/site-packages is being added to sys.path
~ import pkg_resources

After that, my vim session gets dirty with such messages again and again

doesn't work for subversion on non-english system

Hi,
I'm working on an environment with "LANG=zh_CN.UTF8", so the result of cmd svn info won't shown 'Repository Root', or URL lines , however, the stdout strings have been translated to local language.
Thus make the vim plugin doesn't work, even cause this line:

line = bytes.decode(line)

to throws an exception.( UnicodeDecodeError: 'ascii' codec can't decode byte )

I make a small patch for it:

diff --git a/plugin/packages/wakatime/wakatime/projects/subversion.py b/plugin/packages/wakatime/wakatime/projects/subversion.py
index bc5e6b8..40d87a8 100644
--- a/plugin/packages/wakatime/wakatime/projects/subversion.py
+++ b/plugin/packages/wakatime/wakatime/projects/subversion.py
@@ -41,6 +41,7 @@ class Subversion(BaseProject):
         info = OrderedDict()
         stdout = None
         try:
+            os.environ["LANG"] = 'en_US'
             stdout, stderr = Popen([
                 'svn', 'info', os.path.realpath(path)
             ], stdout=PIPE, stderr=PIPE).communicate()

Used 'python_bin' should be configurable from vimrc

Problem is that CentOS 5 has very old python (2.4) and wakatime doesn't work with it. I have installed newer python versions in 'usr/local' as alternate versions, meaning that their binaries are named like python2.7 and python3.4, but I don't have good way to tell wakatime to use those instead the default 'python' one.

Thus the 'python_bin' variable in wakatime.vim should be made accessible from users vimrc.

Wakatime keeps asking for api_key even .wakatime.cfg is set

I have my wakatime set and running a while ago without problem, but recently I encountered this issue, not sure if it is caused by recent updates. The output on startup is:

wakatime

My setup (working properly for a long time until last few weeks):

NeoVim v0.2.0-891-g091a99a
Ubuntu 14.04 lts
has python virtualenv and set the g:wakatime_PythonBinary value
self-signed SSL certificate

any help is much appreciated.

not reporting logged time

Copied from http://www.reddit.com/r/WakaTime/comments/34xw7a/wakatime_for_vim_not_reporting/

I've got the WakaTime plugin for vim set up, configured my API key, and have worked extensively for over a week in Vim, but it's not getting reported to WakaTime (or at least not showing up on my dashboard or elsewhere). My .wakatime.log file is empty. My .wakatime.data file shows the file I'm editing, but what I assume are a pair of timestamps are equal. My IntelliJ IDEA plugin works fine, but not Vim.
I do the vast majority of my work in Vim, so with out this, WakaTime isn't much good to me =(.

IndexError: pop from empty list

Traceback (most recent call last): File "/home/feliciousx/.vim/bundle/vim-wakatime/plugin/packages/wakatime/wakatime-cli.py", line 20, i sys.exit(wakatime.main(sys.argv)) File "/home/feliciousx/.vim/bundle/vim-wakatime/plugin/packages/wakatime/wakatime/__init__.py", line stats = get_file_stats(args.targetFile) File "/home/feliciousx/.vim/bundle/vim-wakatime/plugin/packages/wakatime/wakatime/stats.py", line 92, dependencies = parser.parse() File "/home/feliciousx/.vim/bundle/vim-wakatime/plugin/packages/wakatime/wakatime/languages/__init__. dependencies = plugin.parse() File "/home/feliciousx/.vim/bundle/vim-wakatime/plugin/packages/wakatime/wakatime/languages/templates self._process_token(token, content) File "/home/feliciousx/.vim/bundle/vim-wakatime/plugin/packages/wakatime/wakatime/languages/templates self._process_tag(token, content) File "/home/feliciousx/.vim/bundle/vim-wakatime/plugin/packages/wakatime/wakatime/languages/templates self.tags.pop(0)

This keep appearing on my buffer and annoys me. Any ideas to why?

Locale floats breaks up wakatime-cli invocation

I'm using a locale setting that use a comma as the decimal separator. I think vim's printf("%f") is locale-aware, which breaks the invocation of wakatime-cli:

usage: wakatime-cli.py [-h] --file file [--time time] [--write]                                                                                                           10:57
                       [--plugin PLUGIN] [--key KEY] [--ignore IGNORE]
                       [--logfile LOGFILE] [--config CONFIG] [--verbose]
                       [--version]
wakatime-cli.py: error: argument --time: invalid float value: '1384365465,958159'

A possible solution could be to make ensure Vim always prints the time using the period as the decimal separator. I don't know Vim script very well, but I'll see if I can make a PR that implements this change.

old python version causes urllib3 certs error

➜ /Users/MasterMac >Traceback (most recent call last):
  File "/Users/MasterMac/.vim/bundle/vim-wakatime/plugin/packages/wakatime/cli.py", line 15, in <module>
    import wakatime
  File "/Users/MasterMac/.vim/bundle/vim-wakatime/plugin/packages/wakatime/__init__.py", line 17, in <module>
    from .base import main
  File "/Users/MasterMac/.vim/bundle/vim-wakatime/plugin/packages/wakatime/base.py", line 38, in <module>
    from .packages import requests
  File "/Users/MasterMac/.vim/bundle/vim-wakatime/plugin/packages/wakatime/packages/requests/__init__.py", line 58, in <module>
    from . import utils
  File "/Users/MasterMac/.vim/bundle/vim-wakatime/plugin/packages/wakatime/packages/requests/utils.py", line 26, in <module>
    from .compat import parse_http_list as _parse_list_header
  File "/Users/MasterMac/.vim/bundle/vim-wakatime/plugin/packages/wakatime/packages/requests/compat.py", line 42, in <module>
    from .packages.urllib3.packages.ordered_dict import OrderedDict
  File "/Users/MasterMac/.vim/bundle/vim-wakatime/plugin/packages/wakatime/packages/requests/packages/__init__.py", line 95, in load_module
    raise ImportError("No module named '%s'" % (name,))
ImportError: No module named 'wakatime.packages.requests.packages.urllib3'

Report 'language' based on the vim filetype of the active buffer

Not sure if the wakatime API supports specifying the language on the client side, but it'd be kind of nice to take advantage of the fact that vim knows the language/filetype to intelligently set the language on wakatime. This would be helpful to avoid constantly setting up filters to set language on wakatime.

UI errors

Once in a while my Vim UI gets scrambled with this:

screenshot 2015-07-03 20 59 33

Any ideas on how to fix this?

No option to enter API key

Hey folks,

I installed wakatime via Vundle. I restarted vim and did not get any prompt asking for an API key. Any idea what i'm doing wrong?

slight lag caused by plugin

Original issue wakatime/wakatime#39:

I'm on OSX 10.11.2 with Vim 7.4 (85), and sadly, while I have the plugin installed, everything lags slightly.

The only fix I could find is disabling the plugin.

Probably caused by reading the last heartbeat from the filesystem, which happens on every keystroke. Solution is to store the last heartbeat info in a variable and only check the file every 30 seconds.

Plugin breaks quickfix window

With the vim plugin installed I get a weird behaviour in the quickfix window. Rather than explaining, here is a video showing the slow behaviour of the quickfix window. Notice how the issue is resolved when the plugin is removed.

https://www.screenmailer.com/v/9N2RA0PbVCaKwt4

Mac OSX 10.10.3
vim and tmux
Vim:

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jun 17 2014 11:27:44)
MacOS X (unix) version
Included patches: 1-258
Compiled by Homebrew
Huge version with MacVim GUI.  Features included (+) or not (-):
+acl             +file_in_path    +mouse_sgr       +tag_binary
+arabic          +find_in_path    -mouse_sysmouse  +tag_old_static
+autocmd         +float           +mouse_urxvt     -tag_any_white
+balloon_eval    +folding         +mouse_xterm     +tcl
+browse          -footer          +multi_byte      +terminfo
++builtin_terms  +fork()          +multi_lang      +termresponse
+byte_offset     +fullscreen      -mzscheme        +textobjects
+cindent         -gettext         +netbeans_intg   +title
+clientserver    -hangul_input    +odbeditor       +toolbar
+clipboard       +iconv           +path_extra      +transparency
+cmdline_compl   +insert_expand   +perl            +user_commands
+cmdline_hist    +jumplist        +persistent_undo +vertsplit
+cmdline_info    +keymap          +postscript      +virtualedit
+comments        +langmap         +printer         +visual
+conceal         +libcall         +profile         +visualextra
+cryptv          +linebreak       +python          +viminfo
+cscope          +lispindent      -python3         +vreplace
+cursorbind      +listcmds        +quickfix        +wildignore
+cursorshape     +localmap        +reltime         +wildmenu
+dialog_con_gui  -lua             +rightleft       +windows
+diff            +menu            +ruby            +writebackup
+digraphs        +mksession       +scrollbind      -X11
+dnd             +modify_fname    +signs           -xfontset
-ebcdic          +mouse           +smartindent     +xim
+emacs_tags      +mouseshape      -sniff           -xsmp
+eval            +mouse_dec       +startuptime     -xterm_clipboard
+ex_extra        -mouse_gpm       +statusline      -xterm_save
+extra_search    -mouse_jsbterm   -sun_workshop    -xpm
+farsi           +mouse_netterm   +syntax          
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/Applications/MacVim.app/Contents/Resources/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe  -DMACOS_X_UNIX  -F/System/Library/Frameworks -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1     -I/System/Library/Frameworks/Tcl.framework/Headers  -D_REENTRANT=1  -D_THREAD_SAFE=1  -D_DARWIN_C_SOURCE=1  
Linking: clang   -L. -L/usr/local/lib -L. -L/usr/local/lib -L/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config -F/System/Library/Frameworks -L/opt/boxen/homebrew/lib -o Vim -framework Cocoa -framework Carbon       -lm  -lncurses -liconv -framework Cocoa   -fstack-protector -L/usr/local/lib  -L/System/Library/Perl/5.16/darwin-thread-multi-2level/CORE -lperl -framework Python  -F/System/Library/Frameworks -framework Tcl -framework CoreFoundation -framework Ruby   

slow startup time on Windows OS

Ken says,

90% of the time it takes 5-7 seconds for for vim to start. The other 10% of the time it takes over 7 seconds, more like 10-15

Visual glitch when I run `:help`

Every time I run :help I get this weird glitch.

screen shot 2016-06-14 at 3 05 16 pm

It seems to be related to a Python feature that is expected. Does anyone know how to workaround this?

Lagging and artifacts displayed on screen when typing key frequently

I found a strange bug recently when typing hjkl frequently to move the cursor in normal mode,
vim repeated occasional hjkl letters, see the below figure.
vim-waketime-bug

so when moving left with h, some of the cursor through the local characters into h.
But in my observation found that the content did not actually change that character, as if covered with a layer in the above.
I tried exit vim and re-open the file, but in normal mode the same problem occurred again when I move the cursor frequently. Stuck in a long time and did not know why.

So I decided to dig in and do the steps below:

  1. Comment out (or remove) about half your vimrc file.
  2. Restart Vim, or open a new Vim (reloading the vimrc is not good enough, as settings aren't unset).
  3. Is the problem now gone? Put back the part you removed out (keeping Vim open and using undo is useful here) and repeat step 1 on the part you added back.
  4. Does the problem still occur? Go to step 1.

Finally, I found if I comment vim-wakatime plugin, this problem solved!
Seemed it was processing a Python command when the bug occurred.

Environment: Mac OS 10.12.6,

 vim --version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jan 30 2017 04:49:52)
MacOS X (unix) version
Included patches: 1-271
Compiled by Homebrew
Huge version without GUI.  Features included (+) or not (-):
+acl             +file_in_path    +mouse_sgr       +tag_old_static
+arabic          +find_in_path    -mouse_sysmouse  -tag_any_white
+autocmd         +float           +mouse_urxvt     -tcl
-balloon_eval    +folding         +mouse_xterm     +termguicolors
-browse          -footer          +multi_byte      +terminfo
++builtin_terms  +fork()          +multi_lang      +termresponse
+byte_offset     -gettext         -mzscheme        +textobjects
+channel         -hangul_input    +netbeans_intg   +timers
+cindent         +iconv           +num64           +title
-clientserver    +insert_expand   +packages        -toolbar
+clipboard       +job             +path_extra      +user_commands
+cmdline_compl   +jumplist        +perl            +vertsplit
+cmdline_hist    +keymap          +persistent_undo +virtualedit
+cmdline_info    +lambda          +postscript      +visual
+comments        +langmap         +printer         +visualextra
+conceal         +libcall         +profile         +viminfo
+cryptv          +linebreak       +python          +vreplace
+cscope          +lispindent      -python3         +wildignore
+cursorbind      +listcmds        +quickfix        +wildmenu
+cursorshape     +localmap        +reltime         +windows
+dialog_con      -lua             +rightleft       +writebackup
+diff            +menu            +ruby            -X11
+digraphs        +mksession       +scrollbind      -xfontset
-dnd             +modify_fname    +signs           -xim
-ebcdic          +mouse           +smartindent     -xpm
+emacs_tags      -mouseshape      +startuptime     -xsmp
+eval            +mouse_dec       +statusline      -xterm_clipboard
+ex_extra        -mouse_gpm       -sun_workshop    -xterm_save
+extra_search    -mouse_jsbterm   +syntax
+farsi           +mouse_netterm   +tag_binary
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X_UNIX  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: clang   -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib  -L/usr/local/lib -o vim        -lncurses -liconv -framework Cocoa   -mmacosx-version-min=10.12 -fstack-protector-strong -L/usr/local/lib  -L/usr/local/Cellar/perl/5.24.0_1/lib/perl5/5.24.0/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc -F/usr/local/opt/python/Frameworks -framework Python   -lruby.2.4.0 -lobjc

Hoping there is a solution.

Unable to install on OSX

When I try to install I get the following issue:


  " Installing plugins to /Users/brian/.vim/bundle         |
. Plugin 'gmarik/Vundle.vim'                               |~
+ Plugin 'wakatime/vim-wakatime'                           |~
* Helptags                                                 |~
  usage: cli.py [-h] --file file [--key KEY] [--write] [--plugin PLUGIN]
  ~                                                        |~                         [--time time] [--notfile] [--proxy PROXY]                                                  |~
  ~                    [--project PROJECT_NAME] [--disableoffline] [--hidefilenames]
  ~                                                        |~                                     [--exclude EXCLUDE] [--include INCLUDE] [--logfile LOGFILE]                    |~
  ~                                                  [--config CONFIG] [--verbose] [--version]
  ~                                                        |~                                 cli.py: error: Missing api key                                                     |~
[Vundle] Installer [Preview][RO]                            [No Name]
Done!

Looks like an issue with calling cli.py - I never get asked for an api key. This is on OSX.

Where to enter the API-key?

I'm never asked to enter the API-key (VIM 7.3 on OS X).

This is my ~/.vimrc so what am I doing wrong?

set nocompatible              " be iMproved, required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'wakatime/vim-wakatime'

" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList       - lists configured plugins
" :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal
"

Neoterm on Neovim

When switching to a neoterm split, error is raised:

Error detected while processing function <SNR>63_handleActivity..<SNR>63_Api:
line   22:
E499: Empty file name for '%' or '#', only works with ":p:h": silent !'python' '-W' 'ignore' '/Users/me/.config/nvim/bundle/vim-wakatime/
plugin/packages/wakatime/cli.py' '--file' 'term://.//27524:/bin/zsh;#neoterm-3' '--plugin' 'vim/704 vim-wakatime/4.0.6' &

When switching to normal neovim terminal there is no error.

Subversion output messes up terminal vim

Hi, for the past couple of days the invokation of terminal vim often results in a bunch of garbage interspersed with the actual vim display. As far as I can tell it is the output of some subversion-related command. Here are some fragments of the message:

(...)n: warning: cannot set LC_CTYPE locale
variable LANG is en_US
svn, version 1.8.8 (r1568071)
s are available:
accessing a repository using the svn network protoco(...)
- with Cyrus SASL authentication
...

It seems like the invocation of some svn-related python code results in a bunch of stuff printed on stdout that messes the display. I'm pretty sure wakatime is causing this, as disabling it fixes the problem. I wouldn't mind a workaround that disables svn support altogether, as I am currently not using any svn repos. The recent commit in the code with some svn-related stuff is probably the culprit.

My system is Ubuntu 14.04, vim 7.4, python 2.7.6.

Doesn't seem to be writing to the online API

Wakatime is great!

However, having some issues on VIM on Yosemite. The plugin is logging all the time properly, but it never sends it to wakatime. I had not noticed this at first since I was going back and forth with sublime, but last few days have been VIM only. Had to open sublime for the sync to happen.

Any advice on this? Thanks!

v4.0.4 can't work normally on my svn project

python -V : 2.7.9
There are many exceptions on ~/.wakatime.log when I edit svn files.
The error info is "../vim-wakatime/plugin/packages/wakatime/projects/subversion.py", line 73, in _get_info line = bytes.decode(line) UnicodeDecodeError: 'ascii' codec can't decode byte 0xe8 in position 0: ordinal not in range(128)".
When I modify subversion.py and add "
import sys
reload(sys)
sys.setdefaultencoding('utf-8')", there is anthor error info:"/home/RogerLuo/.vim/bundle/vim-wakatime/plugin/packages/wakatime/projects/subversion.py", line 38, in name return u(self.info['Repository Root'].split('/')[-1]) KeyError: 'Repository Root'"

What can I do if I want use wakatime?

My Linux setting is:
~/.vimrc
...
set enc=utf-8
set fencs=utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936
set langmenu=zh_CN.UTF-8
set helplang=cn
...

~/.bash_profile
...
export LC_ALL='zh_CN.utf8'
...

vim reports syntax = python but dashboard reports Other

I've just started trying wakatime but the first thing I notice is that my dashboard reports "Other" when editing my python file. Vim reports syntax=python. It seems to be basing the language just from the file (.py) extension? The python utility I am editing does not have a filename ending in .py. The plugin should use the vim determined syntax.

'%s' not expanded in log.warn() <-- "No module named configs"?

I've just started using wakatime and the service itself works really well.

This morning I peeked at the logfile and noticed it wasn't particularly useful; it was full of lines like:

{"now": "2015/05/30 10:14:50 +0000", "version": "4.0.13", "plugin": "vim/704 vim-wakatime/4.0.0", "time": 1432980890.122888, "level": "WARNING", "message": "%s"}

I've enabled debugging and done a few simple file actions (open, close, check log, ...).
This is the output from that:

➔ rm ~/.wakatime.log
➔ vim ~/.wakatime.cfg
➔ cat ~/.wakatime.log
{"now": "2015/05/30 10:14:01 +0000", "version": "4.0.13", "plugin": "vim/704 vim-wakatime/4.0.0", "time": 1432980841.171594, "level": "WARNING", "message": "%s"}
{"now": "2015/05/30 10:14:07 +0000", "version": "4.0.13", "plugin": "vim/704 vim-wakatime/4.0.0", "time": 1432980847.702621, "caller": "/home/chisel/.vim/bundle/vim-wakatime/plugin/packages/wakatime/languages/__init__.py", "lineno": 99, "isWrite": true, "file": "/home/chisel/.wakatime.cfg", "level": "DEBUG", "message": "Traceback (most recent call last):\n  File \"/home/chisel/.vim/bundle/vim-wakatime/plugin/packages/wakatime/languages/__init__.py\", line 93, in __init__\n    module = import_module('.%s' % module_name, package=__package__)\n  File \"/usr/lib/python2.7/importlib/__init__.py\", line 37, in import_module\n    __import__(name)\nImportError: No module named configs\n"}
{"now": "2015/05/30 10:14:07 +0000", "version": "4.0.13", "plugin": "vim/704 vim-wakatime/4.0.0", "time": 1432980847.702621, "caller": "/home/chisel/.vim/bundle/vim-wakatime/plugin/packages/wakatime/base.  py", "lineno": 314, "isWrite": true, "file": "/home/chisel/.wakatime.cfg", "level": "DEBUG", "message": "Sending heartbeat to api at https://wakatime.com/api/v1/heartbeats"}
{"now": "2015/05/30 10:14:07 +0000", "version": "4.0.13", "plugin": "vim/704 vim-wakatime/4.0.0", "time": 1432980847.702621, "caller": "/home/chisel/.vim/bundle/vim-wakatime/plugin/packages/wakatime/base.py", "lineno": 341, "isWrite": true, "file": "/home/chisel/.wakatime.cfg", "level": "DEBUG", "message": {"is_write": true, "lines": 9, "language": "INI", "file": "/home/chisel/.wakatime.cfg", "time": 1432980847.702621}}
{"now": "2015/05/30 10:14:08 +0000", "version": "4.0.13", "plugin": "vim/704 vim-wakatime/4.0.0", "time": 1432980847.702621, "caller": "/home/chisel/.vim/bundle/vim-wakatime/plugin/packages/wakatime/packages/requests/packages/urllib3/util/ssl_.py", "lineno": 79, "isWrite": true, "file": "/home/chisel/.wakatime.cfg", "level": "WARNING", "message": "%s"}
{"now": "2015/05/30 10:14:08 +0000", "version": "4.0.13", "plugin": "vim/704 vim-wakatime/4.0.0", "time": 1432980847.702621, "caller": "/home/chisel/.vim/bundle/vim-wakatime/plugin/packages/wakatime/base.py", "lineno": 391, "isWrite": true, "file": "/home/chisel/.wakatime.cfg", "level": "DEBUG", "message": {"response_code": 201}}
➔ vim ~/.wakatime.cfg
➔ cat ~/.wakatime.log
{"now": "2015/05/30 10:14:01 +0000", "version": "4.0.13", "plugin": "vim/704 vim-wakatime/4.0.0", "time": 1432980841.171594, "level": "WARNING", "message": "%s"}
{"now": "2015/05/30 10:14:07 +0000", "version": "4.0.13", "plugin": "vim/704 vim-wakatime/4.0.0", "time": 1432980847.702621, "caller": "/home/chisel/.vim/bundle/vim-wakatime/plugin/packages/wakatime/languages/__init__.py", "lineno": 99, "isWrite": true, "file": "/home/chisel/.wakatime.cfg", "level": "DEBUG", "message": "Traceback (most recent call last):\n  File \"/home/chisel/.vim/bundle/vim-wakatime/plugin/packages/wakatime/languages/__init__.py\", line 93, in __init__\n    module = import_module('.%s' % module_name, package=__package__)\n  File \"/usr/lib/python2.7/importlib/__init__.py\", line 37, in import_module\n    __import__(name)\nImportError: No module named configs\n"}
{"now": "2015/05/30 10:14:07 +0000", "version": "4.0.13", "plugin": "vim/704 vim-wakatime/4.0.0", "time": 1432980847.702621, "caller": "/home/chisel/.vim/bundle/vim-wakatime/plugin/packages/wakatime/base.py", "lineno": 314, "isWrite": true, "file": "/home/chisel/.wakatime.cfg", "level": "DEBUG", "message": "Sending heartbeat to api at https://wakatime.com/api/v1/heartbeats"}
{"now": "2015/05/30 10:14:07 +0000", "version": "4.0.13", "plugin": "vim/704 vim-wakatime/4.0.0", "time": 1432980847.702621, "caller": "/home/chisel/.vim/bundle/vim-wakatime/plugin/packages/wakatime/base.py", "lineno": 341, "isWrite": true, "file": "/home/chisel/.wakatime.cfg", "level": "DEBUG", "message": {"is_write": true, "lines": 9, "language": "INI", "file": "/home/chisel/.wakatime.cfg", "time": 1432980847.702621}}
{"now": "2015/05/30 10:14:08 +0000", "version": "4.0.13", "plugin": "vim/704 vim-wakatime/4.0.0", "time": 1432980847.702621, "caller": "/home/chisel/.vim/bundle/vim-wakatime/plugin/packages/wakatime/packages/requests/packages/urllib3/util/ssl_.py", "lineno": 79, "isWrite": true, "file": "/home/chisel/.wakatime.cfg", "level": "WARNING", "message": "%s"}
{"now": "2015/05/30 10:14:08 +0000", "version": "4.0.13", "plugin": "vim/704 vim-wakatime/4.0.0", "time": 1432980847.702621, "caller": "/home/chisel/.vim/bundle/vim-wakatime/plugin/packages/wakatime/base.py", "lineno": 391, "isWrite": true, "file": "/home/chisel/.wakatime.cfg", "level": "DEBUG", "message": {"response_code": 201}}
{"now": "2015/05/30 10:14:29 +0000", "version": "4.0.13", "plugin": "vim/704 vim-wakatime/4.0.0", "time": 1432980868.548927, "level": "WARNING", "message": "%s"}
➔ vim ~/.wakatime.cfg
➔ vim ~/.wakatime.cfg
➔ vim ~/.wakatime.cfg
➔ tail ~/.wakatime.log
{"now": "2015/05/30 10:14:01 +0000", "version": "4.0.13", "plugin": "vim/704 vim-wakatime/4.0.0", "time": 1432980841.171594, "level": "WARNING", "message": "%s"}
{"now": "2015/05/30 10:14:07 +0000", "version": "4.0.13", "plugin": "vim/704 vim-wakatime/4.0.0", "time": 1432980847.702621, "caller": "/home/chisel/.vim/bundle/vim-wakatime/plugin/packages/wakatime/languages/__init__.py", "lineno": 99, "isWrite": true, "file": "/home/chisel/.wakatime.cfg", "level": "DEBUG", "message": "Traceback (most recent call last):\n  File \"/home/chisel/.vim/bundle/vim-wakatime/plugin/packages/wakatime/languages/__init__.py\", line 93, in __init__\n    module = import_module('.%s' % module_name, package=__package__)\n  File \"/usr/lib/python2.7/importlib/__init__.py\", line 37, in import_module\n    __import__(name)\nImportError: No module named configs\n"}
{"now": "2015/05/30 10:14:07 +0000", "version": "4.0.13", "plugin": "vim/704 vim-wakatime/4.0.0", "time": 1432980847.702621, "caller": "/home/chisel/.vim/bundle/vim-wakatime/plugin/packages/wakatime/base.py", "lineno": 314, "isWrite": true, "file": "/home/chisel/.wakatime.cfg", "level": "DEBUG", "message": "Sending heartbeat to api at https://wakatime.com/api/v1/heartbeats"}
{"now": "2015/05/30 10:14:07 +0000", "version": "4.0.13", "plugin": "vim/704 vim-wakatime/4.0.0", "time": 1432980847.702621, "caller": "/home/chisel/.vim/bundle/vim-wakatime/plugin/packages/wakatime/base.py", "lineno": 341, "isWrite": true, "file": "/home/chisel/.wakatime.cfg", "level": "DEBUG", "message": {"is_write": true, "lines": 9, "language": "INI", "file": "/home/chisel/.wakatime.cfg", "time": 1432980847.702621}}
{"now": "2015/05/30 10:14:08 +0000", "version": "4.0.13", "plugin": "vim/704 vim-wakatime/4.0.0", "time": 1432980847.702621, "caller": "/home/chisel/.vim/bundle/vim-wakatime/plugin/packages/wakatime/packages/requests/packages/urllib3/util/ssl_.py", "lineno": 79, "isWrite": true, "file": "/home/chisel/.wakatime.cfg", "level": "WARNING", "message": "%s"}
{"now": "2015/05/30 10:14:08 +0000", "version": "4.0.13", "plugin": "vim/704 vim-wakatime/4.0.0", "time": 1432980847.702621, "caller": "/home/chisel/.vim/bundle/vim-wakatime/plugin/packages/wakatime/base.py", "lineno": 391, "isWrite": true, "file": "/home/chisel/.wakatime.cfg", "level": "DEBUG", "message": {"response_code": 201}}
{"now": "2015/05/30 10:14:29 +0000", "version": "4.0.13", "plugin": "vim/704 vim-wakatime/4.0.0", "time": 1432980868.548927, "level": "WARNING", "message": "%s"}
{"now": "2015/05/30 10:14:40 +0000", "version": "4.0.13", "plugin": "vim/704 vim-wakatime/4.0.0", "time": 1432980880.513787, "level": "WARNING", "message": "%s"}
{"now": "2015/05/30 10:14:45 +0000", "version": "4.0.13", "plugin": "vim/704 vim-wakatime/4.0.0", "time": 1432980884.821277, "level": "WARNING", "message": "%s"}
{"now": "2015/05/30 10:14:50 +0000", "version": "4.0.13", "plugin": "vim/704 vim-wakatime/4.0.0", "time": 1432980890.122888, "level": "WARNING", "message": "%s"}

I'm not familiar with python, so my attempts to debug, resolve and submit a pull-request failed.
Let me know if you require any further information.

The line that looks most interesting/useful to my un-python eyes is:

{"now": "2015/05/30 10:14:07 +0000", "version": "4.0.13", "plugin": "vim/704 vim-wakatime/4.0.0", "time": 1432980847.702621, "caller": "/home/chisel/.vim/bundle/vim-wakatime/plugin/packages/wakatime/languages/__init__.py", "lineno": 99, "isWrite": true, "file": "/home/chisel/.wakatime.cfg", "level": "DEBUG", "message": "Traceback (most recent call last):\n  File \"/home/chisel/.vim/bundle/vim-wakatime/plugin/packages/wakatime/languages/__init__.py\", line 93, in __init__\n    module = import_module('.%s' % module_name, package=__package__)\n  File \"/usr/lib/python2.7/importlib/__init__.py\", line 37, in import_module\n    __import__(name)\nImportError: No module named configs\n"}

Odd Trace when internet is off / disconnected

On iterm 3.0.7, with vim 7.4 and janus, with wakatime 4.0.12, when wifi is disconnected, I see an odd set of errors:
screen shot 2016-09-02 at 2 44 48 pm

` Traceback (most recent call last):

I pulled from master. That might have fixed the error.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.