咖啡日语论坛

 找回密码
 注~册
搜索
查看: 2840|回复: 8

[使用心得] 有了eblook.vim插件,结合vim软件,Ebwin可以实现即点即查了

[复制链接]
发表于 2015-7-18 22:08:48 | 显示全部楼层 |阅读模式
本帖最后由 beanzhang 于 2015-7-18 14:18 编辑

我是ebwin词典的忠实粉丝,从08年开始来到咖啡日语就开始收集各种ebwin格式的词典,唯独遗憾的是ebwin不支持即点即查,而且在ubuntu等linux系统里没有对应的软件。

vim和eblook.vim插件可以完美解决以上2个问题,以至于我现在都不怎么用ebwin这个软件了。

废话不多说,直接上图。

图片1一个是日语文本,只要把鼠标点在需要查询的词上,注意不需要选中整个日语词组,只要点在任何一个字上都可以,因为插件做了单词识别处理的,很智能。然后按<F4>就可以一键查询你想查的单词。(图片里的例子查询 反对)
图片2一个是英语文本,只要把鼠标点在需要查询的词上,注意不需要选中整个英语单词,只要选中单词中任意一个字母即可。按<F4>就可以一键查询你想查的单词。(图片里的例子查询 health)

对字体感兴趣的同学,英语字体我用的是Ubuntu Mono

日语字体用的是IPAGothic

想了解这个eblook.vim插件的同学可以去http://www1.interq.or.jp/~deton/eblook-vim

当然你要先安装gvim文字编辑器,据说天下只有3种文字编辑器 emac,vim和其他 :)

字体库都是之前和ebwin的软件通用的,无需另外下载了。

需要了解详细配置的可以联系我。
日语文章查词.jpg
英语文章查词.jpg
回复

使用道具 举报

发表于 2015-7-26 21:13:59 | 显示全部楼层
帮主辛苦了。
回复 支持 反对

使用道具 举报

发表于 2015-7-27 22:19:38 | 显示全部楼层
辛苦了,感谢提供。
回复 支持 反对

使用道具 举报

头像被屏蔽
发表于 2015-8-6 12:25:11 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

发表于 2015-8-19 19:05:51 | 显示全部楼层
正在搞C语言
回复 支持 反对

使用道具 举报

发表于 2015-8-29 14:10:37 | 显示全部楼层
谢谢楼主的分享,收获颇大
回复 支持 反对

使用道具 举报

 楼主| 发表于 2015-10-6 04:37:10 | 显示全部楼层
blueicenan 发表于 2015-8-6 04:25
怎么设置?网页访问不了

可以上啊,你显示不了么?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2015-10-6 04:47:32 | 显示全部楼层
colo murphy
"$ defaults write org.vim.MacVim MMNativeFullScreen 0
syntax enable
syntax on

set encoding=utf-8
set fileencodings=utf-8,chinese,latin-1
if has("win32")
set fileencoding=chinese
else
set fileencoding=utf-8
endif

source   $VIMRUNTIME/delmenu.vim
source   $VIMRUNTIME/menu.vim

language messages zh_CN.utf-8
set   directory=.,$TEMP
set   nobackup
set   diffexpr=MyDiff()
set   guicursor=a:block-blinkon0
set   nu
set   guifont=Ubuntu\ Mono:h16
set         guifontwide=TakaoGothic:h16
set   showmatch
set   nocompatible
set   bs=2
set   background=dark
set   tabstop=2
set   wrapmargin=2
set   nobk
set   cindent
set   shiftwidth=2
set   ruler
set   noexpandtab
set   smartindent              " 智能自动缩进
set   autoindent
set   shortmess=atI
set   wrap "自动折行
set   encoding=utf-8
set   ambiwidth=double
set   guioptions-=L      " 隐藏左侧滚动条
set   guioptions-=r      " 隐藏右侧滚动条
set   guioptions-=b      " 隐藏底部滚动条
"set showtabline=0       " 隐藏Tab栏
set   guioptions-=m
set   guioptions-=T

"映射<F2>为文件另存为
imap <F2> <ESC>:saveas
nmap <F2> :saveas
"映射<F3>为当前词条查询
imap <F3> <ESC><Plug>EblookInput
nmap <F3> <Plug>EblookInput
"映射<F4>开启eblook单词查询
imap <F4> <ESC><Plug>EblookSearch
nmap <F4> <Plug>EblookSearch
"映射<F5>为保存更新文件
imap <F5> <ESC>:w<CR>
nmap <F5> :w<CR>
"映射<F7>打开、关闭文件目录表
nmap <F7> :NERDTreeToggle<CR>
imap <F7> <ESC>:NERDTreeToggle<CR>
"映射<F8>排版Json原数据
nmap <F8> :%!python -m json.tool<CR>
imap <F8> <ESC>:%!python -m json.tool<CR>
"映射<F9>打开、关闭命令控制台
nmap <F9> :ConqueTerm bash<CR>
imap <F9> <ESC>ZZ<CR>
"映射<F10>打开、关闭可选菜单
map <silent> <F10> :if &guioptions =~# 'T' <Bar>
        \set guioptions-=T <Bar>
        \set guioptions-=m <Bar>
    \else <Bar>
        \set guioptions+=T <Bar>
        \set guioptions+=m <Bar>
    \endif<CR>
"映射<F12>重载语法高亮文件
noremap <F12> <Esc>:syntax sync fromstart<CR>
inoremap <F12> <C-o>:syntax sync fromstart<CR>
" ######### 括号、引号、中括号等自动匹配 ######### "
:inoremap ( ()<ESC>i
:inoremap ) <c-r>=ClosePair(')')<CR>
:inoremap { {}<ESC>i
:inoremap } <c-r>=ClosePair('}')<CR>
:inoremap [ []<ESC>i
:inoremap ] <c-r>=ClosePair(']')<CR>
":inoremap < <><ESC>i
":inoremap > <c-r>=ClosePair('>')<CR>
:inoremap " ""<ESC>i
:inoremap ' ''<ESC>i
:inoremap ` ``<ESC>i


let s:pattern = '^\(.* \)\([1-9][0-9]*\)$'
let s:minfontsize = 9
let s:maxfontsize = 13
function! AdjustFontSize(amount)
  if has("gui_gtk2") && has("gui_running")
    let fontname = substitute(&guifont, s:pattern, '\1', '')
    let cursize = substitute(&guifont, s:pattern, '\2', '')
    let newsize = cursize + a:amount
    if (newsize >= s:minfontsize) && (newsize <= s:maxfontsize)
      let newfont = fontname . newsize
      let &guifont = newfont
    endif
  else
    echoerr "You need to run the GTK2 version of Vim to use this function."
  endif
endfunction

function! LargerFont()
  call AdjustFontSize(1)
endfunction
command! LargerFont call LargerFont()

function! SmallerFont()
  call AdjustFontSize(-1)
endfunction
command! SmallerFont call SmallerFont()

function ClosePair(char)
        if getline('.')[col('.') - 1] == a:char
                return "\<Right>"
        else
                return a:char
        endif
endf

"映射ctrl up/ctrl down改变字体大小
nnoremap <C-Up> :silent! let &guifont = substitute(
\ &guifont,
\ ':h\zs\d\+',
\ '\=eval(submatch(0)+1)',
\ '')<CR>
nnoremap <C-Down> :silent! let &guifont = substitute(
\ &guifont,
\ ':h\zs\d\+',
\ '\=eval(submatch(0)-1)',
\ '')<CR>

if has("gui_running")
  " GUI is running or is about to start.
  " Maximize gvim window.
  set lines=35 columns=90
else
  " This is console Vim.
  if exists("+lines")
    set lines=40
  endif
  if exists("+columns")
    set columns=100
  endif
endif


" ######### save and run ######### "

" compile c file
func! CompileGcc()
    exec "w"
    let compilecmd="!gcc -Wall -pedantic -std=c99 "
    let compileflag="-o %<"
    exec compilecmd." % ".compileflag
endfunc

" compile cpp file
func! CompileCpp()
    exec "w"
    let compilecmd="!g++ -Wall -pedantic -std=c++98 "
    let compileflag="-o %<"
    exec compilecmd." % ".compileflag
endfunc

" compile java file
func! CompileJava()
    exec "w"
    exec "!javac %"
endfunc

" compile Haskell file
func! CompileHaskell()
    exec "w"
    let compilecmd="!ghc --make "
    let compileflag="-o %<"
    exec compilecmd." % ".compileflag
endfunc

" run Lua file
func! RunLua()
    exec "w"
    exec "!lua %"
endfunc

" run Perl file
func! RunPerl()
    exec "w"
    exec "!perl %"
endfunc

" run Python file
func! RunPython()
    exec "w"
    exec "!python %"
endfunc

" run Ruby file
func! RunRuby()
    exec "w"
    exec "!ruby %"
endfunc


" auto-select relevant script to run according to file type
func! CompileCode()
        exec "w"
        if &filetype == "c"
            exec "call CompileGcc()"
        elseif &filetype == "cpp"
            exec "call CompileCpp()"
        elseif &filetype == "java"
            exec "call CompileJava()"
        elseif &filetype == "haskell"
            exec "call CompileHaskell()"
        elseif &filetype == "lua"
            exec "call RunLua()"
        elseif &filetype == "perl"
            exec "call RunPerl()"
        elseif &filetype == "python"
            exec "call RunPython()"
        elseif &filetype == "ruby"
            exec "call RunRuby()"
        endif
endfunc

" run compiled/script files
func! RunResult()
        exec "w"
        if &filetype == "c"
            "exec "call CompileGcc()"
            exec "! %<"
        elseif &filetype == "cpp"
            "exec "call CompileCpp()"
            exec "! %<"
        elseif &filetype == "java"
            "exec "call CompileJava()"
            exec "!java %<"
        elseif &filetype == "haskell"
            "exec "call CompileHaskell()"
            exec "! %<"
        elseif &filetype == "lua"
            exec "!lua %<.lua"
        elseif &filetype == "perl"
            exec "!perl %<.pl"
        elseif &filetype == "python"
            exec "!python %<.py"
        elseif &filetype == "ruby"
            exec "!ruby %<.rb"
        endif
endfunc

" Ctrl + S save and compile
map  :call CompileCode()<CR>
imap  <ESC>:call CompileCode()<CR>
vmap  <ESC>:call CompileCode()<CR>

" Ctrl + R save and run
map :call RunResult()<CR>
imap <ESC>:call RunResult()<CR>
vmap <ESC>:call RunResult()<CR>

let mapleader=","
nmap <leader>f :Fullscreen<CR>
"使用space向下翻页
nmap <space> <c-f>
"使用backspace向上翻页
nmap <backspace> <c-b>
"使用>号切换到前一个Nerdtree的分页
nmap < gT<CR>
"使用>号切换到后一个Nerdtree的分页
nmap > gt<CR>
"使用“,tb”键就可以打开/关闭tagbar窗口:
map <silent> <leader>tb :TagbarToggle<cr>
"使用“,nt”键就可以打开/关闭nerdtree窗口:
map <silent> <leader>nt :NERDTreeToggle<cr>
"按,ev打开配置文件
nmap <silent> <leader>ev :e $MYVIMRC<CR>
"按,sv重载配置文件
nmap <silent> <leader>sv :so $MYVIMRC<CR>
"按,m取消高亮搜索结果
nmap <silent> <leader>m :nohlsearch<CR>
"按,w保存文件
nmap <leader>w :w<CR>
"按,e在新tab打开文件
nmap <leader>e :tabe<Space>
"按,r在当前tab打开文件
nmap <leader>r :e<Space>
"按,cmd在新tab打开控制台
nmap <leader>cmd :ConqueTermSplit cmd.exe<CR>
nmap <leader>ccmd :ConqueTerm cmd.exe<CR>
"设置tagbar
"let g:tagbar_ctags_bin='D:\ctags58\ctags.exe'
"
"uncomment following to enable autoopen tagbar
"autocmd BufReadPost *.cpp,*.c,*.h,*.hpp,*.cc,*.rb,*.py call tagbar#autoopen()

"生成一个tags文件
"nmap <F9> <Esc>:!ctags -R *<CR>
"let g:indent_guides_guide_size=1
"配置Snipmate
let g:acp_behaviorSnipmateLength=1
let g:ConqueTerm_CloseOnEnd = 1
let g:ConqueTerm_ToggleKey = '<F13>'
"配置eblook
let eblookenc='cp932'

let g:ConqueTerm_StartMessages = 0

let eblook_contentwin_height=15
let eblook_dictlist1 = [
  \{
    \'book': 'Downloads/UbuntuDict/SRD',
    \'name': 'srd',
    \'title': 'ランダムハウス英語辞典',
    \'skip': 0,
  \},
  \{
    \'book': 'Downloads/UbuntuDict/EIDAI6',
    \'name': 'eidai6',
    \'title': '研究社新英和大辞典第6版',
    \'skip': 0,
  \},
  \{
    \'book': 'Downloads/UbuntuDict/PLUS',
    \'name': 'plus',
    \'title': '研究社リーダーズ+プラスv2',
    \'skip': 0,
  \},
        \{   
    \'book': 'Downloads/UbuntuDict/COLLOC',
    \'name': 'colloc',
    \'title': '研究社 新編英和活用大辞典',
    \'skip': 0,
  \},
  \{   
    \'book': 'Downloads/UbuntuDict/GENIUS',
    \'name': 'genius',
    \'title': 'ジーニアス英和和英辞典',
    \'skip': 0,
  \},
  \{   
    \'book': 'Downloads/UbuntuDict/EIJIRO',
    \'name': 'eijiro',
    \'title': '英辞郎108',
    \'skip': 0,
  \},
\]

let eblook_dictlist2 = [
    \{
    \'book': 'Downloads/UbuntuDict/LDOCE4',
    \'name': 'ldoce4',
    \'title': '朗文当代高级英英辞典',
    \'skip': 0,
  \},
\]

let eblook_dictlist3 = [
  \{
    \'book': 'Downloads/UbuntuDict/CAMBRIEC',
    \'name': 'cambriec',
    \'title': '剣橋高級学習者辞典(第三版)',
    \'skip': 0,
  \},
        \{
    \'book': 'Downloads/UbuntuDict/OXfull',
    \'name': 'oxfull',
    \'title': '牛津双解英漢',
    \'skip': 0,
  \},
  \{
    \'book': 'Downloads/UbuntuDict/AHD',
    \'name': 'ahd',
    \'title': '美国伝統辞典(双解)',
    \'skip': 0,
  \},
\]

let eblook_dictlist4 = [
   \{
    \'book': 'Downloads/UbuntuDict/SGK2',
    \'name': 'sgk2',
    \'title': '小学館中日日中统合辞典',
    \'skip': 0,
  \},
        \{   
    \'book': 'Downloads/UbuntuDict/DAIJIRIN',
    \'name': 'daijirin',
    \'title': '三省堂スーパー大辞林',
    \'skip': 0,
  \},
  \{   
    \'book': 'Downloads/UbuntuDict/KOJIEN',
    \'name': 'kojien',
    \'title': '広辞苑第六版',
    \'skip': 0,
  \},
  \{   
    \'book': 'Downloads/UbuntuDict/KOUDANJC',
    \'name': 'koudanjc',
    \'title': '講談社日中',
    \'skip': 0,
  \},
\]
回复 支持 反对

使用道具 举报

 楼主| 发表于 2015-10-6 04:48:05 | 显示全部楼层
以上是我的gvimrc文件,欢迎共享。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注~册

本版积分规则

小黑屋|手机版|咖啡日语

GMT+8, 2024-4-24 07:41

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表