Skip to content

Instantly share code, notes, and snippets.

@yuki-yano
Last active June 8, 2017 09:23
Show Gist options
  • Select an option

  • Save yuki-yano/2d74e749abbc5dc40070aa008aaec144 to your computer and use it in GitHub Desktop.

Select an option

Save yuki-yano/2d74e749abbc5dc40070aa008aaec144 to your computer and use it in GitHub Desktop.
Google Translation from vim. require translategoogle.vim
function! TransRange() range
let texts = []
for n in range(a:firstline, a:lastline)
let line = getline(n)
call substitute(line, '\n\+$', ' ', '')
call add(texts, line)
endfor
10new | put!=translategoogle#command(join(texts))
endfunction
command! -range Trans <line1>,<line2>call TransRange()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment