What is it? A plugin to provide bindings to query via the dico client either (i) a local DICT server or (ii) GNU's DICT server.
For a vim compatible version see dico-vim
- Ideally, a local DICT server on the standard port 2628. Either dicod or dictd will do. See below for pre-configured options.
- GNU's DICT client
dico
version >= 2.4. - fold from GNU coreutils
Note
There are two ready-made dicod servers pre-configured with good dictionaries:
- dicod-docker, a dockerized DICT server; and
- a nixpkgs overlay and nixos module
Note that at the moment the remote default DICT server (at dicoweb.gnu.org.ua) is not configurable.
Add the following to your init.lua
:
With junegunn/vim-plug
Plug "metaporia/dico.nvim"
With folke/lazy.nvim
{ "metaporia/dico.nvim", config = true}
See the helpfile :h dico.nvim
for more details.
{
default_split = "h", -- window split orientation
map_prefix = "<leader>", -- default prefix for keymappings
enable_nofile = false, -- Expose user command `Nofile` used to open scratch buffer
fallback_dict_server = "gnu.org.ua" -- remote fallback DICT server
}
By default <prefix> = <leader>
in the following key-bindings, and all bindings
work in visual mode on the contents of the current visual selection.
-
<prefix>d
: define headword under cursor in horizontal split -
<prefix>da
: define headword in alternate split (ifopts.default_split
is"h"
, then this would open a vertical split). -
<prefix>ls
: list synonyms in default split
Def <headword>
: define<headword>
in default splitDefA <headword>
: define<headword>
in alternate splitLsSyn <headword>
: list synonyms (from moby-thesaurus by default) in default split