Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Nealium/dict-popup.nvim
A simple Neovim plugin for the Linux command `dict` which shows the definitions in a popup
https://github.com/Nealium/dict-popup.nvim
Last synced: about 2 months ago
JSON representation
A simple Neovim plugin for the Linux command `dict` which shows the definitions in a popup
- Host: GitHub
- URL: https://github.com/Nealium/dict-popup.nvim
- Owner: Nealium
- License: apache-2.0
- Created: 2024-02-20T00:25:39.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2024-07-01T23:42:41.000Z (6 months ago)
- Last Synced: 2024-10-30T11:41:44.811Z (2 months ago)
- Language: Lua
- Size: 87.9 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- my-neovim-pluginlist - Nealium/dict-popup.nvim - popup.nvim) ![](https://img.shields.io/github/last-commit/Nealium/dict-popup.nvim) ![](https://img.shields.io/github/commit-activity/y/Nealium/dict-popup.nvim) (Other Standard Feature Enhancement / Dictionary)
README
# dict-popup.nvim
[![Neovim](https://img.shields.io/badge/NeoVim-%2357A143.svg?&style=for-the-badge&logo=neovim&logoColor=white)](https://neovim.io/)
[![Lua](https://img.shields.io/badge/lua-%232C2D72.svg?style=for-the-badge&logo=lua&logoColor=white)](https://www.lua.org/)A simple plugin for the Linux command `dict` which shows the definitions in a popup. ([vim9script version](https://github.com/Nealium/dict-popup.vim))
![Screenshot](screenshot.png)
### Features
* center and cursor popups
* ex command: `:Dict {word}` (center)
* normal mode: lookup current word (cursor)
* visual mode: lookup selection (cursor)
* `dict` filetype and accompanying syntax
* in-buffer pseudo jumplist## Install
### Command
```bash
sudo apt install dictd
# or
sudo dnf install dictd
```
```bash
# extra dictionaries
sudo apt install dict-jargon dict-vera
```
**Note:** Syntax tested with gcide *(default)*, jargon and vera### Plugin
* https://github.com/folke/lazy.nvim
```lua
{
"Nealium/dict-popup.nvim",
opts = {
normal_mapping = nil, -- disable
visual_mapping = "h",
visual_reg = "*",
stack = false,
},
}
```
**Notes:**
* Setting `normal_mapping` or `visual_mapping` to `nil` (*actual* nil, not a
string), or leaving the keys out all together, will disable the mapping.
* Setting `stack` to `true` will open up a cursor popup on top of a center popup
instead of the default behavior which is to overwrite the center popup's
contents. This *may* lead you with the center popup open and unfocused, to
refocus do ``- in some situations this won't work and you are on
your own!## Dict buffer keymaps
* `` and `q` close popup
* `}` next definition
* `{` previous definition
* `` next in search jumplist
* `` and `` previous in search jumplist
* `` search current word
* if stacked, `` close popupKeymaps can be changed through the opts key `buffer_mappings`:
```lua
{
"Nealium/dict-popup.nvim",
opts = {
normal_mapping = "h",
visual_mapping = "h",
visual_reg = "*",
stack = false,
buffer_mappings = { -- defaults
close = { "", "q" },
next_definition = { "}" },
previous_definition = { "{" },
jump_back = { "" },
jump_forward = { "", "" },
jump_definition = { "" },
},
},
}
```# TODO
- [X] Proper config & setup
- [X] Center popup for `:Dict` command
- [X] Ability to call `dict.Cursor` inside of a dict popup and have it overwrite
the current contents
- [ ] Colors set in config