{"id":15493500,"url":"https://github.com/phux/vim-keypress-analyzer","last_synced_at":"2026-05-09T00:12:15.163Z","repository":{"id":73539336,"uuid":"324618235","full_name":"phux/vim-keypress-analyzer","owner":"phux","description":"vim-keypress-analyzer parses a vim keypress log file  and aggregates key press counts.","archived":false,"fork":false,"pushed_at":"2021-01-03T10:06:44.000Z","size":82,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-29T21:06:17.035Z","etag":null,"topics":["golang-application","neovim","vim"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phux.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-26T19:05:04.000Z","updated_at":"2025-03-08T14:40:12.000Z","dependencies_parsed_at":"2024-06-20T15:41:01.349Z","dependency_job_id":null,"html_url":"https://github.com/phux/vim-keypress-analyzer","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/phux/vim-keypress-analyzer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phux%2Fvim-keypress-analyzer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phux%2Fvim-keypress-analyzer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phux%2Fvim-keypress-analyzer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phux%2Fvim-keypress-analyzer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phux","download_url":"https://codeload.github.com/phux/vim-keypress-analyzer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phux%2Fvim-keypress-analyzer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32802601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang-application","neovim","vim"],"created_at":"2024-10-02T08:07:26.315Z","updated_at":"2026-05-09T00:12:15.131Z","avatar_url":"https://github.com/phux.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vim Keypress Analyzer\n\n`vim-keypress-analyzer` parses vim keypress log files generated by\n`(n)vim -w \u003ca_log_file\u003e` and aggregates key press counts and some antipattern analysis.\n\nNote: this is not delivering accurate numbers yet, check TODOs\n\n## Table of contents\n\n* [Example output](#example-output)\n* [Features](#features)\n* [Install](#install)\n  * [Binary from GitHub release](#binary-from-github-release)\n* [Usage](#usage)\n  * [Collecting keypresses in vim/nvim](#collecting-keypresses-in-vim/nvim)\n  * [Analyzing logfiles](#analyzing-logfiles)\n  * [Optional flags](#optional-flags)\n* [Motivation](#motivation)\n* [TODO](#todo)\n\n## Example output\n\n```sh\n$ vim-keypress-analyzer --file ~/.nvim_keylog --limit 10 --enable-antipatterns\n\nVim Keypress Analyzer\n\nKey presses per mode (total: 104281)\n│─────────────────│───────│───────────│\n│ IDENTIFIER (4)  │ COUNT │ SHARE (%) │\n│─────────────────│───────│───────────│\n│ insert          │ 46.2K │     44.32 │\n│ normal          │ 43.7K │     41.98 │\n│ command         │  7.4K │      7.11 │\n│ visual          │  6.8K │      6.58 │\n│─────────────────│───────│───────────│\n\nKey presses excluding [insert, command] modes (total: 50642)\n│──────────────────│───────│───────────│\n│ IDENTIFIER (10)  │ COUNT │ SHARE (%) │\n│──────────────────│───────│───────────│\n│ w                │  7.9K │     14.01 │\n│ \u003cspace\u003e          │  4.3K │      8.51 │\n│ j                │  3.4K │      6.78 │\n│ k                │  2.9K │      5.91 │\n│ b                │  2.4K │      4.83 │\n│ d                │  1.5K │      3.15 │\n│ e                │  1.4K │      2.93 │\n│ i                │  1.3K │      2.62 │\n│ l                │  1.2K │      2.54 │\n│ \u003cesc\u003e            │  1.2K │      2.45 │\n│──────────────────│───────│───────────│\n\nFound Antipatterns\n│───────────────│───────│───────────────────│─────────────────────────│\n│ PATTERN (16)  │ COUNT │ TOTAL KEY PRESSES │ AVG KEYS PER OCCURRENCE │\n│───────────────│───────│───────────────────│─────────────────────────│\n│ www+          │   559 │              3.6K │ 5.48                    │\n│ bbb+          │   306 │              1.5K │ 4.97                    │\n│ ko            │   195 │               390 │ 2.00                    │\n│ jjj+          │   148 │               777 │ 5.25                    │\n│ li            │   145 │               290 │ 2.00                    │\n│ kkk+          │   140 │               794 │ 5.67                    │\n│ eee+          │   126 │               734 │ 5.83                    │\n│ jO            │    52 │               104 │ 2.00                    │\n│ lll+          │    37 │               398 │ 10.76                   │\n│ xxx+          │    31 │               131 │ 4.23                    │\n│ hhh+          │    28 │               137 │ 4.89                    │\n│ dddd+         │    23 │               102 │ 4.43                    │\n│ ha            │     7 │                14 │ 2.00                    │\n│ WWW+          │     2 │                12 │ 6.00                    │\n│ BBB+          │     2 │                 6 │ 3.00                    │\n│ XXX+          │     1 │                 6 │ 6.00                    │\n│───────────────│───────│───────────────────│─────────────────────────│\n```\n\n## Features\n\n- [x] count total keys pressed by mode (NORMAL, INSERT, VISUAL, COMMAND)\n- [x] count key presses for each key (excludable modes, e.g. don't show\n  `insert` mode key presses)\n- [x] detect repetitive key sequences as antipatterns (e.g. `jjj` or `dddd`)\n  - [ ] detect repetitive multi key sequences like `dwdwdwdw`\n\n\n## Install\n\n### Binary from GitHub release\n\n1. Download the archive for your OS (OSX and Linux, OSX is not tested yet) from the [releases page](https://github.com/phux/vim-keypress-analyzer/releases)\n1. Extract the binary `vim-keypress-analyzer` to a directory in your `$PATH`\n\n## Usage\n\n### Collecting keypresses in vim/nvim\n\n1. start vim with the `-w \u003cpath/to/logfile\u003e` flag (see `:h -w`) to tracking\n   your key presses\n1. edit files/text\n1. quit vim. This will create or append the `\u003cpath/to/logfile\u003e` with the\n   keys you have pressed in the session\n\nHelpful alias to always log your keys:\n\n```sh\n\nalias n='nvim -w ~/.nvim_keylog \"$@\"'\n# or\nalias v='vim -w ~/.vim_keylog \"$@\"'\n```\n\nIf you want to split the logs per day, to track progress for example:\n\n```sh\n# necessary once\nmkdir ~/.vim_logs\n\n# automatically write to ~/.vim_logs/YYYY-MM-DD.log\nalias n='nvim -w ~/.vim_logs/$(date -Idate).log \"$@\"'\n# or\nalias v='vim -w ~/.vim_logs/$(date -Idate).log \"$@\"'\n```\n\n### Analyzing logfiles\n\nThere is only a single mandatory option: `-f`\\`--file` to the log file generated in the previous step.\n\n```sh\n$ vim-keypress-analyzer -f \u003ca_log_file\u003e\n```\n\n### Optional flags\n\n| Flag                          | Description                                                          | Possible values              | Default          |\n|-------------------------------|----------------------------------------------------------------------|------------------------------|------------------|\n| `-l`, `--limit`               | limit the number of key presses displayed                            | any positive int             | `0` (unlimited)  |\n| `-a`, `--enable-antipatterns` | boolean flag, enable a rudimentary antipattern analysis              | flag is present or not       | false            |\n| `-e`, `--exclude-modes`       | comma separated list of modes to be excluded from the key press list | insert,normal,command,visual | `insert,command` |\n\n## Motivation\n\n- be able to see the ratio of typing in `insert` mode vs. other modes\n  - if you are typing 99.9% of the time in `insert` mode, there is not much reason to use vim\n- count the characters you type in vim (e.g. per day)\n- identify your most pressed keys in non-insert modes, to check for example for\n  optimization potential\n- identify antipatterns in your editing habit. Antipatterns means repetitive or inefficient key strokes.\n  For example, pressing eight times `j` repetitively is considered an\n  antipattern. Similarly, pressing `A\u003ccr\u003e` can be done as well by `o`\n\n## TODO\n\n- [ ] improve motion detection - e.g. `ciw`\n- [ ] command \u0026 insert mode shares seem to high - check\n- [ ] rewrite antipattern detection [WIP]\n  - [ ] configurable via yaml file\n- [ ] option to store results in a structured format (json e.g.)\n- [ ] (maybe) `\u003cleader\u003e\u003ckey\u003e` detection? - the numbers are otherwise not 100% correct\n- [ ] (maybe maybe) build a vim plugin that logs keys on the fly to a structured log format\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphux%2Fvim-keypress-analyzer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphux%2Fvim-keypress-analyzer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphux%2Fvim-keypress-analyzer/lists"}