Make Vim discoverable!
This is not a Vim plugin.
This is a work in progress solution for analyzing your Vim usage patterns. It consists of three parts:
- commands to enable logging in Vim
- a script to convert the logs to a particular format
- and the Jupyter Notebook with useful code snippets to analyze the log
Neovim is not yet supported.
There is no ch_logfile
function in Neovim and I did not research if there is an alternative.
If you find it let me know or make a Pull Request.
NOTE: this may take a considerable amount of space (on the order of GB/month). Keep an eye on these files.
Put this snippet in your vimrc:
" Log to analyze user behaviour
augroup VimSensei
autocmd VimEnter * call ch_logfile($HOME . "/.vim/log-" . strftime('%s'))
autocmd InsertEnter * call ch_log("::Entering Insert Mode::")
autocmd InsertLeave * call ch_log("::Leaving Insert Mode::")
autocmd CmdwinEnter * call ch_log("::Entering command-line window::")
autocmd CmdwinLeave * call ch_log("::Leaving command-line window::")
autocmd CmdlineEnter * call ch_log("::Entering command-line mode::")
autocmd CmdlineLeave * call ch_log("::Leaving command-line mode::")
augroup END
$ python scripts/process-vim-log.py ~/.vim/log-* > vim.log
The resulting log file may contain sensitive information due to imperfect filtering of insert methods! Do not share your log file with untrusted parties!
Use scripts/find-words.py to detect some english words in your log.
Here are some resources to help you find better solutions. Help links are clickable.
-
First of all, the User Manual. Access inside Vim with
:h user-manual
. This is not just a help reference, it is a readable chapter-by-chapter guide. It will take you to another level. -
Using Neovim floating window to break bad habits. This can be adapted for Vim, using
:h popup-window
. You can see an example in my plugin Vim Ostroga.