Skip to content

Instantly share code, notes, and snippets.

@soh335
Created January 22, 2010 11:31
Show Gist options
  • Save soh335/283699 to your computer and use it in GitHub Desktop.
Save soh335/283699 to your computer and use it in GitHub Desktop.
function! s:Alc(str)
setlocal modifiable
setlocal noreadonly
% delete _
setlocal nonumber
setlocal noswapfile
setlocal buftype=nofile
setlocal bufhidden=delete
setlocal noshowcmd
setlocal nowrap
let l:body = system('w3m "http://eow.alc.co.jp/'.a:str.'/UTF-8/?ref=sa"')
execute 'silent 1 put = l:body'
execute "normal! 33z\<CR>"
setlocal readonly
setlocal nomodifiable
endfunction
command! -nargs=1 Alc :call s:Alc(<f-args>)
nnoremap <silent> <plug>(Alc) :<C-u>call <SID>Alc(expand('<cword>'))<CR>
nmap <silent> <space>e <plug>(Alc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment