Tuesday, February 18, 2014

Re: Que: can i wright key sequence without dead key. I am using PKL. Please help me by email.

On 18/02/14 14:53, Prakash Dongare wrote:
>
>
>
For serious help about Vim, you'd better subscribe to the list — in
fact, you already did, since you're allowed to post — and then you can
set your list preferences to get every list post, or only digests. I
recommend "every post" for the list(s) you're really interested in.

You can write any key sequence without using a dead key, if you want, by
using mappings and keymaps, but of course you'll be limited to the
number of different keys present on your keyboard. I recommend to use
mappings when they are few, or present in any kind of file; keymaps,
when there are many of them, or they are used only in a limited number
of files.

Examples:

For all helpfiles, and any files using tags; also to terminate
abbreviations:

:map <F9> <C-]>
:map! <F9> <C-]>

For files in Cyrillic alphabet: the example shows how to do it for HTML
files by means of a modeline:

<!DOCTYPE html>
<html><head>
<!--: vim: set keymap=russian-phonetic et ts=8 sts=8 :-->
<title>whatever</title>
</head><body>
...etc.
</body></html>

where $VIM/vimfiles/keymap/russian-phonetic.vim is a keymap I wrote
myself. In fact it does use dead keys, but that's because I like them. I
suppose I might have written it differently without multibyte {lhs}es.

See
:help map.txt
:help 'keymap'
http://vim.wikia.com/wiki/How_to_make_a_keymap
:help modeline



From a philosophical point of view, however, Vim is a modal editor: any
key which changes the mode could be seen as a kind of "extended dead
key". Or conversely, a dead key could be seen as a limited kind of
mode-key, which changes the mode but only for the next key, similar to
what ctrl-O does (setting Normal mode for only one command) in Insert
mode, see ":help i_CTRL-O" (without the quotes). IOW, "philosophically",
dead keys are never very far away in Vim.


Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
87. Everyone you know asks why your phone line is always busy ...and
you tell them to send an e-mail.

--
--
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:

Post a Comment