{"id":13595945,"url":"https://github.com/pafcu/vimsplain","last_synced_at":"2025-04-09T13:33:54.437Z","repository":{"id":1273122,"uuid":"1212347","full_name":"pafcu/vimsplain","owner":"pafcu","description":"Explain Vim command sequences","archived":false,"fork":false,"pushed_at":"2017-12-19T16:41:56.000Z","size":35,"stargazers_count":104,"open_issues_count":6,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-06T18:46:10.722Z","etag":null,"topics":["python","vim"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pafcu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-01-01T13:42:33.000Z","updated_at":"2024-10-20T09:52:29.000Z","dependencies_parsed_at":"2022-08-16T12:50:46.263Z","dependency_job_id":null,"html_url":"https://github.com/pafcu/vimsplain","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pafcu%2Fvimsplain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pafcu%2Fvimsplain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pafcu%2Fvimsplain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pafcu%2Fvimsplain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pafcu","download_url":"https://codeload.github.com/pafcu/vimsplain/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248049797,"owners_count":21039275,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["python","vim"],"created_at":"2024-08-01T16:02:01.922Z","updated_at":"2025-04-09T13:33:54.117Z","avatar_url":"https://github.com/pafcu.png","language":"Python","funding_links":["https://liberapay.com/saparvia/donate"],"categories":["Python"],"sub_categories":[],"readme":"Vimsplain takes an sequence of vim commands and attempts to explain the meaning of the commands. Note that there are some Unicode-related problems with Python 2 so it's better to use a Python 3.x interpreter (often installed as python3).\n\nUsage:\n\n```\npython3 vimsplain.py commands\n```\n\ne.g.\n\n```\n\u003e python3 vimsplain.py qa3jYpJDq2@aZZ\n\nqa      record typed characters into named register {0-9a-zA-Z\"} (uppercase to append)\n3j      cursor 3 lines downward\nY       yank 1 lines [into buffer x]; synonym for \"yy\"\np       put the text [from register x] after the cursor 1 times\nJ       Join 2 lines; default is 2\nD       delete the characters under the cursor until the end of the line and 1-1 more lines [into buffer x]; synonym for \"d$\"\nq       (while recording) stops recording\n2@a     execute the contents of register {a-z} 2 times\nZZ      store current file if modified, and exit\n```\n\nNormally escape sequences are noted by `^`, e.g. `^C`,`^[`. This introduces potential ambiguity, e.g. it is not possible to know wheter `^V` means \n\n```\n^\tcursor to the first CHAR of the line\nV\tstart linewise Visual mode\n```\n\nor:\n\n```\n^V\tstart blockwise Visual mode.\n```\n\nTherefore, the non-standard approch of using `§` is used, since that character is not used as a command in Vim, and is easy to type on most keyboards. A drawback is that § can not be entered in Insert mode since it will be interpreted as CTRL.\nEscape, or `CTRL-[`, is denoted by `§[`.\n\nVim documentation often uses `\u003cC-x\u003e` to denote Ctrl+x (where x is some character). If the program is invoked with the `--convert_special` switch, `\u003cC-x\u003e` will be converted to `§x` and `\u003cCR\u003e` will be converted to `§M` in the input. The reason this is only enabled when the switch is used is that it makes it impossible to enter some Vim commands (since these would be interpreted as a special character instead of commands).\n\nA more compex example:\n\n```\n\u003e python vimsplain.py \"4JD=Gjwci(*a§[jcfda.join(',')§[ZZ\"\n\n4J      Join 4 lines; default is 2\nD       delete the characters under the cursor until the end of the line and 1-1 more lines [into buffer x]; synonym for \"d$\"\n=G      filter 1 lines through \"indent\" with motion cursor to line 1, default last line\nj       cursor 1 lines downward\nw       cursor 1 words forward\nci(     delete 1 text [into buffer x] and start insert with motion \"inner block\" from \"[(\" to \"])\"\n                Text: *a\n                Command: §[     end insert mode (unless 'insertmode' set)\nj       cursor 1 lines downward\ncfd     delete 1 text [into buffer x] and start insert with motion cursor to 1 occurrence of d to the right\n                Text: a.join(',')\n                Command: §[     end insert mode (unless 'insertmode' set)\nZZ      store current file if modified, and exit\n```\n\nThere are still many features missing, most importantly support for arrow keys, mouse buttons, backspace and command line editing mode.\n\nThe file index.txt is a slightly modified version of the same file as included in Vim 7.3. It is licensed under the Vim license, see LICENSE.vim. Eveything else is licensed under the ISC license, see LICENSE.\n\n[![Donate using Liberapay](https://liberapay.com/assets/widgets/donate.svg)](https://liberapay.com/saparvia/donate)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpafcu%2Fvimsplain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpafcu%2Fvimsplain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpafcu%2Fvimsplain/lists"}