Paolo wrote:
> I need to perform ANSI/UNICODE commands in my GVIM.

The procedure is pretty baffling. Generally, by the time you
have read the file, it is too late. I used the following code to
convert several files a year ago.

I have the following in my vimrc, but I _think_ that this does
not matter given the following procedure:
  set encoding=utf-8

You would put the following in a file, say convert.vim, and
edit it for the names of the files you want. You need to also
specify the encoding for reading, and for writing.

  " Convert specified files from cp1251 to utf-8.
  let files = 'first.txt second.txt third.txt'
  for f in split(files)
    exec 'edit ++enc=cp1251 '.f
    exec 'write ++enc=utf-8 '.f
  endfor

After saving the above file, open it in Vim (do NOT open any
other file), and enter the following to execute the code:

  :so %

That "sources" the current file. You should have a COPY of the
files you want to convert in the current directory. They will be
overwritten.

John


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to