13.07.2015 Views

Linux System Administration Recipes A Problem-Solution Approach

Linux System Administration Recipes A Problem-Solution Approach

Linux System Administration Recipes A Problem-Solution Approach

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 9 ■ WORKING WITH TEXT IN FILES■ Note gdm/xdm/etc should source ~/.Xmodmap on login. If you find that your keymap isn’t available onlogin and you have to load it manually with xmodmap ~/.Xmodmap, add that command to your ~/.bashrc or~/.bash_profile so it will run automatically. This has the added advantage that it’ll also be run when you log invia ssh. (This will be true only if using ssh -X, that is, if hooking into the X server. Otherwise, you’ll need tochange the console keymap.)Another input method for UTF-8 is digraphs, as supported by the program screen. Hit Ctrl-A andthen Ctrl-V, and you’ll get the prompt Enter digraph. Various digraphs are available for screen(unfortunately you can’t add your own). For example, ?? will give you an upside-down question mark (¿).Alternatively, you can use U and the hex code to enter any arbitrary Unicode character. You may findthat this doesn’t work for you; this is probably because of a lack of support in the terminal programthrough which you’re running screen.9-5b. Entering UTF-8 Characters in VimIn Vim, you can enter UTF-8 characters using their hex code, in a similar way to what’s available withGTK+. For example, the following will give you a Latin g with a cedilla over it (ģ):Ctrl-V u 0123However, an easier mode (since vim supports UTF-8 natively) is to set up your X system to supportentering UTF-8 characters. Then vim will simply handle them correctly as they’re passed in. See theprevious recipe for this. The hex code method may be useful if you only occasionally want a particularunusual character (that is, one not in your native character set).You can also use digraphs, which enable you to type a character, backspace, and then anothercharacter and have a UTF-8 character generated. To use these, put this line in your ~/.vimrc file:set digraphTo do it temporarily, type :set digraph in command mode in vim. To show the digraphs you haveset, type this in command mode::digraphsTyping (for example) U " will give you Ü.You can set your own digraphs using this::dig[raphs] {char1}{char2} {number} ...where number is the decimal representation of the character you want. Use this on the vim commandline, or add it to your ~/.vimrc file.199Download at WoweBook.Com

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!