如果直接在vim中使用,则在~/.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>
在vim中光标移动到单词上,使用shift+f可以新分割出来一个窗口显示单词的翻译.