You can use the :map commands. Vim understands UTF-8 and different file formats, and there are keymaps you can load with :set keymap=???, but for simplicity, you should be able to map your own key. Let's say you want to use CTRL-^ for the copyright character. First, you need to do
Then you can type the sequence
(no spaces here). If you are in text-mode vim (and not gvim), you will see a ? mark. Position the cursor over that question mark and type
On the status line, you will see:
Bring this up in your HTML browser or whatever. If this isn't the character you expect, I don't know how to help.
Anyway, to map this to a keyboard character, say CTRL_^ you can do:
Now when you are insert mode, you can type CTRL-^ and you should see the ? mark. Do the :asc thing to make sure it's right. Finally, you can make an abbreviation so that typing (c) turns into this character:
That might be more intuitive in the long-run. If you need the sequence (c) without the abbreviation, you can type "(c)CTRL-V" and then a space, period, or whatever.
Note CTRL-V and CTRL-^ means holding down the Control key followed by V or ^ (often 6) or whatever.
Unfortunately I'm working on Solaris with standard sysV vi
The ":set encoding ..." command is not available.
And therefore the sequence "CTRL-V u 0 1 6 9" is also not working.
So, I think I need to change to another editor ...
Anyhow: many thanks for your detailed explanation.
Hi Unix Guru,
I have an requirement for replace some specail characters in a file, my file came from mainframe.
please see below example:
when open it with vi
17896660|89059215|04/24/1998 00:00:00.000000| abc 123-453-1312^M<85>^M<85>|124557
if I run cat -v I got following:... (25 Replies)
I am writing a ksh script. I need to replace a set of characters in an xml file.
FROM="ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÛÚÜÝßàáâãäåçèéêëìíîïðñòóôõö¿¶ø®";
TO="AAAAAAACEEEEIIIIDNOOOOOOUUUUYSaaaaaaceeeeiiiionooooo N R"
I have used the code- sed 's/$FROM/$TO/g'<abc.xml
But its not working.
Can anyone tell me the code to do this? (3 Replies)
i need to replace the any special characters with escape characters like below.
test!=123-> test\!\=123
!@#$%^&*()-= to be replaced by
\!\@\#\$\%\^\&\*\(\)\-\= (8 Replies)
Hi all,
I was wondering how can i see the special characters like \t, \n or anything else in a file by using Nano or any other linux command like less, more etc (6 Replies)
When I open a file in vi, I see the following characters:
\302\240
Can someone explain what these characters mean. Is it ASCII format? I need to trim those characters from a file.
I am doing the following:
tr -d '\302\240'
---------- Post updated at 08:35 PM ---------- Previous... (1 Reply)
Dear Members,
We have a file which contains some special characters. I need to replace these special character by a new line character(\n).
The Special character is \x85.
I am not sure what this character means and how we can remove it.
Any inputs are greatly appreciated.
Thanks... (5 Replies)
Hello everyone,
I use Samba to copy mp3 files to my Red Hat 8.0 box so I can randomize them through a playlist. When I copy:
Sigur Rós-Nýja Lagið.mp3
It shows in the mapped drive on Windows as:
Sigur Rós-N_ja Lagi_.mp3
And via Putty as:
Sigur R(grayed box)s-N_ja Lagi_.mp3
What is going... (1 Reply)
Hi everyone,
I need some tool or a hint how to code it myself. I want a tool that listenes to a TCP/IP port and reads everything from that port and write it to a logfile.
How can I do this?
Regards,
Steff (3 Replies)