Wednesday, May 8, 2013

Copy and paste Spanish from google translate into vim?

Hi,

I would be very thankful if someone could tell me how to set things up so I can copy and paste Spanish text from google translate into vim? I am sure there is some very simple way to do this, but I can't see it.

When I enter English, lets say "symptom", into google translate, it gets translated into Spanish "síntoma" which I hope shows up OK here. I can copy and paste the Spanish into MS Word, works fine. When I paste to an HTML file I edit with vim, it does not work correctly. I use vim on ubuntu via a putty window, and right-click to paste, after entering insert mode. I can tell it does not work because it looks different than the same Spanish words that already exist in the file, and because the HTML that results does not display "síntoma" correctly (n and t are dropped). Other words with accents are also messed up.

I set vim encoding to utf-8 (see below). I tried with LANG and LC_ALL set to C, en_US.UTF-8, es_US.UTF-8 but same problem.

I am not asking about entering Spanish text by hand into vim. I need to copy and paste text blocks. I do not need any general help using vim, I've had a lot of experience. I did see a vim plugin for google translate by Maksim Ryzhikov, would be willing to try, but could find no directions other than a very unhelpful youtube video.

Here is what is in a vim file after "síntoma" is pasted (n and t missing):

$ od -cx temp.x
0000000 s 303 255 o m a \n
c373 6fad 616d 000a

-------------------------------------------------

$ vim --version
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Oct 26 2012 16:45:34)
Included patches: 1-547
Huge version without GUI. Features included (+) or not (-):
+arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent
-clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con +diff +digraphs
-dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path
+find_in_path +float +folding -footer +fork() +gettext -hangul_input +iconv
+insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent
+listcmds +localmap -lua +menu +mksession +modify_fname +mouse -mouseshape
+mouse_dec +mouse_gpm -mouse_jsbterm +mouse_netterm -mouse_sysmouse
+mouse_xterm +mouse_urxvt +multi_byte +multi_lang -mzscheme +netbeans_intg
+path_extra -perl +persistent_undo +postscript +printer +profile +python
-python3 +quickfix +reltime +rightleft -ruby +scrollbind +signs +smartindent
-sniff +startuptime +statusline -sun_workshop +syntax +tag_binary
+tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title
-toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo
+vreplace +wildignore +wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp
-xterm_clipboard -xterm_save

:set
--- Options ---
autoindent history=500 scroll=11 nowrap
background=dark nomodeline shiftwidth=2 nowrapscan
encoding=utf-8 paste showmatch
expandtab ruler tabstop=1
backspace=indent,eol,start
fileencodings=ucs-bom,utf-8,default,latin1
printoptions=paper:a4
termencoding=utf-8

(I tried setting fileencodings to just utf-8 - did not help.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: