macvim-dev / macvim-dev/macvim
Epic: Support dictionary/data lookup in MacVim
Nobody has claimed this yet.
- Dominant language
- Vim Script
- Stars
- 7.9k
- Forks
- 691
- PR merge metrics
- No merged PRs in 30d
Description
It is useful to support the ability to look up a piece of selected / highlighted text in MacVim and show a OS popup that gives you more information. #1191 was the original issue, but this work has ballooned as this becomes more ambitious and need to span multiple commits. Using this epic to track the work and elicit ideas / brainstorm.
- #1312
- Basic implementation to support looking up text in the Core Text view:
- #1313
- Data detection. Should detect URLs, addresses, etc, using NSDataDetector. Note that WebKit/NSTextView use an internal "Reveal" API, which we don't have access to as a third-party software, so we will not be able to do as good as job as them, especially for things like package tracking and airline numbers.
- Looking up selected texts (when in visual mode) should look up the whole text, not just the individual words.
- #1315
- Vimscript API support to look up arbitrary data. Add a new function
showdefinition()so that we can programmatically invoke this. - Right click menu should show a "Look Up" item. This makes it easier to trigger the look up without need a trackpad as Ctrl-Cmd-D is a little unwieldy and harder to discover.
- Vimscript API support to look up arbitrary data. Add a new function
- Others
- Autocmd to intercept lookups and override what to do (see custom popup as an example)
- Custom popup. This would allow us to popup arbitrary dialog boxes with Markdown / HTML support using NSPopUp. E.g. show documentation in richer format.
- Extend balloon to support using this. Right now balloon is too barebone and text only
- Add documentation to a new
docfolder for technical details and general guidelines. Would be a nice time to update thesrc/MacVim/READMEfile which hasn't been updated forever.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the completed lookup work in #1312, #1313, and #1315, then inspect the custom popup example and the existing src/MacVim/README. The remaining scope includes an autocmd, richer custom popups, balloon support, and documentation, so the desired design and completion criteria need clarification before implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- macos, vim
- Domain
- desktop
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100