sponsor Vim development Vim logo Vim Book Ad

K.vim : K.vim features VIM with key-value instant search from external dictionary

 script karma  Rating 0/0, Downloaded by 104    Comments, bugs, improvements  Vim wiki

created by
brook hong
script type
K.vim features VIM with key-value instant search from external dictionary(in StarDict format) using an external command line tool -- `kv`, thus with it you can

* translate word from an oxford english dictionary
* get a quick referrence to some function of some kind of programming langugae
* get a quick help from you own dictionary, which you can build from a plain text file by `kv`

Some screenshots (under windows)

# Installation

1. get and build `kv` tool from https://github.com/brookhong/kv, for WINDOWS you can get pre-built binary http://sharing-from-brook.16002.x6.nabble.com/file/n4967532/kv.zip
2. copy kv or kv.exe to a folder in your path such as /usr/local/bin or C:\Windows\system32
3. put k.vim to your .vim/plugin folder
4. build or download dictionaries you need to some folder, and tell VIM where it is

    let g:kdbDir = $HOME.'/kdb'

I have shared some of my dictionaries here https://www.dropbox.com/sh/75leolu1dso27qn/lG7VSrv1l7

# Configuration

    " the plugin will scan this directory to create key mapping globally or specially for some type of file.
    let g:kdbDir = $HOME.'/kdb'
    " when press `<leader>,`, will translate word under the cursor, works for all kinds of files.
    let g:globalDBkeys = {
          \ 'oxford-gb' : '<leader>,',
          \ }
    " when press `K` in normal mode or `C-j` in insert mode, will get referrence of function under the cursor, works only for php file.
    " for file-type dictionaries, they must be named same as the file type.
    let g:localDBkeys = {
          \ 'php' : ['K', '<C-j>'],
          \ }

# Usage

For global dictionaries, with cursor on a word, press the key you set in `g:globalDBkeys` to search.
For file-type dictionaries, open a file, with cursor on a word, press the key you set in `g:localDBkeys` to search.
The result is displayed in a split window, you can close it by `<Space>,` in normal mode.
install details
Just unzip the zip file to your VIM file path, usually to be ~/.vim.


Bundle 'brookhong/k.vim'

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
k.zip 0.1 2013-06-13 7.0 brook hong Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
SourceForge.net Logo