VIM词库文件 [英] VIM thesaurus file

查看:135
本文介绍了VIM词库文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找vim词库的好解决方案.显然,该功能是内置的,但是每个人似乎都使用的文件是mthesaur.txt.虽然在插入模式下的命令会显示一个列表的意义上起作用",但在我看来,结果在编程上是正确的,但不是超级有用. vim在线同义词库插件工作得很好,但是在线上的延迟以及对返回的缓冲区使用拆分的必要性都不理想.有人对此有意见吗?

I have been poking around for a good solution for a vim thesaurus. The capability is built-in, obviously, but the file everyone seems to use is the mthesaur.txt. While it 'works' in the sense that the commands in insert mode bring up a list, it seems to me the results are programatically correct but not super useful. The vim online thesaurus plugin works very well, but the latency over the wire and necessity of using a split for the returned buffer is less than ideal. Anyone have an opinion about this?

推荐答案

我编写了一个插件,可以解决您在此处提出的两个问题.

I have written a plugin that can address the two issues you raised here.

Vim的多语言词库查询插件

从两个方面改善了使用体验:更明智的同义词选择 机制;以及更好,更灵活的同义词来源.

It improves the using experience in two regards: more sensible synonym choosing mechanism; and better and more flexible synonym source(s).

Thesaurus_query.vim屏幕投射

默认情况下,该插件使用vim的消息框进行候选显示,每个 用数字标记的同义词.并让用户选择合适的替代品 通过输入光标编号在光标下的单词.它的工作原理类似于vim的 默认拼写更正提示.并大大减少了操作时间 从一长串候选人中选择合适的同义词.

By default, the plugin uses vim's messagebox for candidate display, with each synonym labeled by a number. And it let user choose the suitable one to replace the word under cursor by typing in its number. It works similar to vim's default spell correction prompt. And drastically reduced the operation time for choosing proper synonym from a long list of candidates.

为了提高同义词候选者的质量,我们使用了多个查询后端 用过的.对于英语用户,有两个值得注意的地方.

To improve the quality of synonym candidates, multiple query backends were used. For English user, two are note worthy.

  • thesaurus_com使用Thesaurus.com作为同义词源的后端
  • mthesaur_txt使用mthesaur.txt作为同义词源的后端
  • thesaurus_com Backend using Thesaurus.com as synonym source
  • mthesaur_txt Backend using mthesaur.txt as synonym source

thesaurus_com后端将立即运行.为了使本地查询后端正常工作, 您将需要下载mthesaur.txt并告诉插件它在哪里 通过设置变量thesaurus或指定 变量g:tq_mthesaur_file.否则,只有在线后端是 功能.

thesaurus_com Backend will work straight away. For Local Query Backend to work, you will need to download mthesaur.txt and tell the plugin where it is located either by setting variable thesaurus or specifying variable g:tq_mthesaur_file. Or else only Online Backend will be functional.

默认情况下,将首先使用Online Query Backend.但是如果没有互联网 可用或速度太慢,将在当前vim会话中处理将来的查询 首先通过本地查询后端来减少延迟时间.这两个的优先级 后端也可以手动更改(请参见文档).

By default, Online Query Backend will be used first. But if internet is not available or too slow, future query in the current vim session will be handled by Local Query Backend first to reduce latency time. Priority of these two backends can also be manually altered(see documentation).

为了解决延迟问题(通常在找不到单词时会突出显示),我引入了超时机制.您可以设置

To address the latency issue(which usually stands out when the word is not found), I have introduced a timeout mechanism. You may set

let g:tq_online_backends_timeout = 0.6

如果您的互联网速度相当快.这样就可以将等待时间减少到 不到0.6秒.

if your internet is reasonably fast. So that the latency could be reduced to under 0.6 second.

不过,该插件是用Python编写的.因此,您可能希望将其与通过Python和/或Python3支持编译的Vim一起使用.

The plugin is written in Python, though. So you might want to use it with Vim compiled with Python and/or Python3 support.

这篇关于VIM词库文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆