Skip to content

weilonge/vim-ydict

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ydict.vim

A (Neo)Vim plugin for ydict integration:

Prerequisite

Install ydict:

npm install -g ydict.js

Usage

  • Search a word under cursor:

    " search a word
    nnoremap <silent> <Leader>d :call YDict([expand('<cword>'), expand('<cWORD>')])<Return>
  • Search a word for your selected text:

    " search a word
    vnoremap <silent> <Leader>d y:<C-U>call YDict(getreg(0))<Return>
  • Configure where results are displayed:

    " create window below current one (default)
    let g:ydict_results_window = 'new'
    
    " create window beside current one
    let g:ydict_results_window = 'vnew'
    
    " use current window to show results
    let g:ydict_results_window = 'enew'
    
    " create panel at left-most edge
    let g:ydict_results_window = 'topleft vnew'
    
    " create panel at right-most edge
    let g:ydict_results_window = 'botright vnew'
    
    " create new tab beside current one
    let g:ydict_results_window = 'tabnew'

Testing

Developers can run the vim-spec tests:

gem install bundler         # first time
bundle install              # first time
bundle exec vim-flavor test # every time

License

This plugin is inspired by ydict.js https://github.com/sayuan/ydict.js/.

The code is copied from vim-dasht https://github.com/sunaku/vim-dasht.

Copyright 2018 Sean Lee https://github.com/weilonge

Distributed under the same terms as Vim itself.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published