在vimrc中加入一下代码
function! Mydict()
let expl=system('sdcv -n ' .
\ expand("<cword>"))
windo if
\ expand("%")=="diCt-tmp" |
\ q!|endif
25vsp diCt-tmp
setlocal buftype=nofile bufhidden=hide noswapfile
1s/^/\=expl/
1
endfunction
nmap F :call Mydict()<CR>
" shift+f 查取单词
按shift+f查单词
当然前提是安装了sdcv
ubuntu上安装sdcv方法是 sudo apt-get install sdcv
安装完了之后还需要添加词库
安装方法:
tar -xjvf a.tar.bz2
mv a /usr/share/stardict/dic
enjoy.........