Multi-language Thesaurus Query and Replacement plugin for Vim/NeoVim
cnrtl.fr
and synonymo.fr
openthesaurus.de
, backend identifier openthesaurus_de
datamuse_en
into default backends list.thesaurus.com
and woxikon.de
from default backend list.- added Russian synonym backend based on `yarn-synsets.csv`, backend
identifier `yarn_synsets`
- variable `g:tq_python_version` to force use user determined version of
Python, provided the version is supported
- Fixed problem caused by Woxikon html design change.
- Timeout feature for shorter waiting time. Timeout will not demote the
backend.
- =<Leader>cs= for thesaurus_query functionality.
- Add German(=de=) support (Issue #12)
- Add Python3 support, and set as default. Python2 still supported.
- Due to performance reasons, removed =datamuse_com= from default backend
list.
- Improve coloring for candidate choosing window.
- Now visual mode synonym query also support replacing feature. And the
replacing feature is set to default.
- change =g:tq_use_python= to =s:tq_use_python=.
- default value for =g:tq_language= become list, =g:tq_language = ['en']=
- use of =<LocalLeader>cs=.
- Exclude Tab =\\t= from being recognized as part of a word in Insert Mode
query.
- Insert mode auto-complete ineffective in Python3 due to behavior
difference of =map= in Python3 and Python2.
- the issue that makes redefining variable mid-session ineffective
- fix out-of-boundary exception when query empty string with completefunc
(insert mode completion)
Thesaurus Query Plugin v0.3 made two changes:
ctrl-x ctrl-u
), complementing the existing normal-mode spell like word
replacing interface.Detailed changelog is attached below.
b:tq_language
and g:tq_language
to setup which language source you
prefer the plugin to querycompletefunc
for insertmode autocomplete (Issue #7)let g:tq_use_vim_autocomplete = 1
to activate completefunc
g:thesaurus_query#
, replacing the prefix of
all of them by g:tq_
g:thesaurus_query#map_keys
, use g:tq_map_keys
instead.KeyboardInterrupt
exception handler for candidate choosing.(closes
Issue #8 )V0.2 Changelog
g:thesaurus_query#enabled_backends
:ThesaurusQueryReset
g:thesaurus_query#use_local_thesaurus_source_as_primary
g:thesaurus_query#use_alternative_backend
Change_log since v0.1.0:
:Thesaurus [your_word]
);The first release of thesaurus_query.vim
, written mainly in Python
.
thesaurus_query.vim
is made for a simple purpose: to create a simple,
sensible and functional interface for user to query synonym of a word and
replace it with user chosen candidate if that word is obtained from under
cursor.
So essentially, this plugin can query synonyms from words
<LocalLeader>cs
in Normal mode)<LocalLeader>cs
in Visual mode)Currently for word input from first case, a candidate list of found synonyms will be generated, and user may replace the word under cursor with chosen candidate or cancel the operation.
To maximize the query experience, two query backends were created:
mthesaur.txt
file. For this
backend to work, be sure to download the file from gutenberg.org and
place it under "~/.vim/thesaurus".By default, query will be performed by Online Query Backend first. Only when no synonym is found from Thesaurus.com, either due to the lack of Internet connection or the word is not included, the plugin will turn to the Local Query Backend for further query. This query sequence can be reversed. For detail, please refer to documentation.
Install using plugin managers is prefered. Use your plugin manager of choice:
git clone https://github.com/ron89/thesaurus_query.vim ~/.vim/bundle/thesaurus_query.vim
Bundle 'ron89/thesaurus_query.vim '
to .vimrc:BundleInstall
NeoBundle 'ron89/thesaurus_query.vim'
to .vimrc:NeoBundleInstall
Plug 'ron89/thesaurus_query.vim'
to .vimrc:PlugInstall
The Online Query Backend is functional by default. So without further customization, the plugin should be good to go. However, if user want the Local Query Backend to be functional as well, some further steps might be needed.
Download mthesaur.txt
(around 24MB) file from
gutenberg.org, and place it under
folder "~/.vim/thesaurus". If user place the file elsewhere, be sure to let
this plugin know the location of your mthesaur.txt
file by adding the line
let g:thesaurus_query#mthesaurus="/directory/to/your/mthesaur.txt
into your .vimrc
.
Currently, 8
global variables and 3
commands created for you to customize
plugin's detailed behaviors. Including backend query sequence, keymappings and
result truncations. Some are described in
README.md.
And all of them are documented in detail in
documentation.