Giter Site home page Giter Site logo

victionary's Introduction

Victionary

An easy to use dict client for Vim.

img

Table of Contents

Click here to show.
  1. Requirements
  2. Installation
  3. Configuration
  4. Usage
  5. Examples

Requirements

  • Vim compiled w/ Ruby 1.9.2 or greater

Installation

For easy installation, I highly suggest that you install a plugin manager (ie. Pathogen/Vundle/NeoBundle)

  • Vim 8 Native Package Manager
mkdir ~/.vim/pack/plugin/start/victionary
git clone https://github.com/farconics/victionary ~/.vim/pack/plugin/start/victionary
git clone https://github.com/farconics/victionary ~/.vim/bundle/victionary
  1. Add Plug 'farconics/victionary' to your .vimrc file.
  2. Reload your .vimrc.
  3. Run :PlugInstall
  1. Add Plugin 'farconics/victionary' to your .vimrc file.
  2. Reload your .vimrc.
  3. Run :BundleInstall
  1. Add NeoBundle 'farconics/victionary' to your .vimrc file.
  2. Reload your .vimrc.
  3. Run :NeoUpdate

Configuration

The plugin works out of the box, using 'dict.org' as the host and WordNet as the dictionary. I will try to add the option to specify a host.

Changing Dictionary

You can chance which dictionary to use with g:victionary#dictionary. There are currently 2 options, which you can set in your .vimrc:

" Use WordNet
let g:victionary#dictionary = g:victionary#WORD_NET

" Use the Collaborative International Dictionary of English
let g:victionary#dictionary = g:victionary#GCIDE

Usage

You can read the help docs for this plugin at any time with:

:help victionary

Mappings

<Plug>(victionary#define_prompt)

  • Prompts the user for a word to define

<Plug>(victionary#define_under_cursor)

  • Defines the word currently under the cursor

<Plug>(victionary#synonym_prompt)

  • Prompts the user for a word to get synonyms

<Plug>(victionary#synonym_under_cursor)

  • Get synonym the word currently under the cursor

By default, the hotkeys for triggering each mapping are:

Hotkey Mapping
<Leader>d <Plug>(victionary#define_prompt)
<Leader>D <Plug>(victionary#define_under_cursor)
<Leader>s <Plug>(victionary#synonym_prompt)
<Leader>S <Plug>(victionary#synonym_under_cursor)

If you'd like to disable the default mappings, add this to your .vimrc:

let g:victionary#map_defaults = 0

If you'd like to customize the mappings, add this to your .vimrc:

let g:victionary#map_defaults = 0
nmap <mapping> <Plug>(victionary#define_prompt)
nmap <mapping> <Plug>(victionary#define_under_cursor)
nmap <mapping> <Plug>(victionary#synonym_prompt)
nmap <mapping> <Plug>(victionary#synonym_under_cursor)

Commands

:VictionaryDefine

  • Takes a word as a parameter to define

:VictionarySynonym

  • Takes a word as a parameter to get synonyms

Looking up a word will open a horizontal split at the bottom, simply press q to close the window.

Variables

g:victionary#format_results

Type: Number

Default: 1

If this variable is set to a non-zero value, then the results are formatted to remove visual clutter. This includes disabling 'number', relativenumber, listchars, and colorcolumn, while enabling cursorline for visual distinction. If you like to have the results window to be unaltered, add the following to your .vimrc:

let g:victionary#format_results = 0

g:victionary#visible_results

Type: Number

Default: 1

This sets the maximum number of results immediately visible when a word's definition is searched for. The results window resizes to match the number of results set to be visible.

For example, for the definition results of the word "number", if g:victionary#visible_results is set to 1, then the results would resize to fit only the first definition:

Word:number
    n 1: the property possessed by a sum or total or indefinite
         quantity of units or individuals; "he had a number of
         chores to do"; "the number of parameters is small"; "the
         figure was about a thousand" [syn: {number}, {figure}]

If set to 3, the window would resize to fit the first three definitions, which would take up more space:

Word:number
    n 1: the property possessed by a sum or total or indefinite
         quantity of units or individuals; "he had a number of
         chores to do"; "the number of parameters is small"; "the
         figure was about a thousand" [syn: {number}, {figure}]
    2: a concept of quantity involving zero and units; "every number
       has a unique position in the sequence"
    3: a short theatrical performance that is part of a longer
       program; "he did his act three times every evening"; "she had
       a catchy little routine"; "it was one of the best numbers he
       ever did" [syn: {act}, {routine}, {number}, {turn}, {bit}]

In all cases, the user can still scroll down to see more definitions, but the window will maintain its initial size.

Examples

img

victionary's People

Contributors

farconics avatar evanquan avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.