Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/heraldofsolace/vimhelpbot
VimHelpBot is a bot that replies to r/vim and r/neovim comments with link to Vim Help page
https://github.com/heraldofsolace/vimhelpbot
bot praw python3 reddit vim
Last synced: about 1 month ago
JSON representation
VimHelpBot is a bot that replies to r/vim and r/neovim comments with link to Vim Help page
- Host: GitHub
- URL: https://github.com/heraldofsolace/vimhelpbot
- Owner: heraldofsolace
- License: gpl-3.0
- Created: 2020-05-24T14:33:34.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-11-27T15:50:45.000Z (3 months ago)
- Last Synced: 2024-11-27T16:42:44.784Z (3 months ago)
- Topics: bot, praw, python3, reddit, vim
- Language: Python
- Homepage:
- Size: 2.61 MB
- Stars: 46
- Watchers: 3
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/heraldofsolace/VimHelpBot/actions/workflows/deploy.yaml)
VimHelpBot is a cute little bot which lurks on [r/vim](https://reddit.com/r/vim) and [r/neovim](https://reddit.com/r/neovim) as [u/vim-help-bot](https://www.reddit.com/user/vim-help-bot). It looks for comments containing ":h help-topic" and replies with a link to [Vim Help](https://vimhelp.org/).
## How it works
It monitors all comments on r/vim r/neovim and uses two regex to extract the help topic. By default it looks for `:(h|he|hel|help) topic` within backticks and extracts `topic`. If it fails, it looks for `:h` and extracts until the first space after that.
It uses a tag database to figure out which helpfile `topic` belongs to and creates a link to vimhelp for that topic.
If an exact match is not found, it tries to follow Vim's algorithm. From `:h E149`:
> If there is no full match for the pattern, or there
> are several matches, the "best" match will be used.
> A sophisticated algorithm is used to decide which
> match is better than another one. These items are
> considered in the computation:
> - A match with same case is much better than a match
> with different case.
> - A match that starts after a non-alphanumeric
> character is better than a match in the middle of a
> word.
> - A match at or near the beginning of the tag is
> better than a match further on.
> - The more alphanumeric characters match, the better.
> - The shorter the length of the match, the better.If no tag is found for a topic, it automatically creates a github issue.
# Donate
If my program helped you, please consider donating -
[](https://ko-fi.com/J3J53WCCI)