LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   add special character from vi (https://www.linuxquestions.org/questions/linux-newbie-8/add-special-character-from-vi-4175502787/)

byran cheung 04-23-2014 11:26 PM

add special character from vi
 
I use Redhat linux v6 , I would like to add special character ( eg. black diamond suit ) to the system by using vi , would advise how to do it ? thanks



http://www.webmonkey.com/2010/02/special_characters/

kbp 04-24-2014 12:40 AM

See the "By character value" section in: http://vim.wikia.com/wiki/Entering_special_characters

You'll need to determine the character code first though, there should be character map application in your distro.

byran cheung 04-24-2014 01:03 AM

thanks reply ,

in the page , it side to enter CTRL-K a:

I am not understand what that mean , press what key ? thanks

colucix 04-24-2014 01:36 AM

The Unicode for "Black Diamond Suit" is U2666. As kbp mentioned, look under the "By character value" section of the cited article, where you read:
Quote:

By hex value for BMP Unicode codepoints: ^Vunnnn (with 0000 <= nnnn <= FFFF)
First you have to go into Insert mode, then in sequence Ctrl-v, u, 2, 6, 6, 6. You will not see anything on the screen except the ^ sign, but after completing the sequence a black diamond appears. Hope this helps.

byran cheung 04-24-2014 02:13 AM

Quote:

Originally Posted by colucix (Post 5158210)
The Unicode for "Black Diamond Suit" is U2666. As kbp mentioned, look under the "By character value" section of the cited article, where you read:

First you have to go into Insert mode, then in sequence Ctrl-v, u, 2, 6, 6, 6. You will not see anything on the screen except the ^ sign, but after completing the sequence a black diamond appears. Hope this helps.


thanks reply ,

I follow the instruction , in Insert mode , press Ctrl-v , then u , 2 , 6 ,6 , 6 , I see a ? sign , save it and then still see the ? sign only , my procedure is incorrect ? thanks

colucix 04-24-2014 04:43 AM

Maybe your terminal doesn't support UNICODE character set. Which terminal are you using? If gnome-terminal (the default in Red Hat with GNOME desktop) check under the menu Terminal --> Set Character Encoding and see if Unicode (UTF-8) is there and selected.


All times are GMT -5. The time now is 02:42 PM.