Thursday, November 8, 2012

Re: Commands from insert mode

> AFAIK, most versions of Vim don't distinguish between <C-{letter}>
>
> and <C-S-{letter}> as they send the same ASCII code. You might be
>
> able to distinguish between, say <C-F2> and <C-S-F2> if you wanted
>
> to use the function keys. Likewise, I don't think control+number is
>
> caught in most cases, let alone control+shift+number (the exception
>
> being control+@ and control+^ both of which Vim uses, but can be
>
> remapped).
>
> -tim

Hi, Tim.

Your answer was very useful. Since I cannot use <C-S-X>, I mapped the backspace key to z. Although <C-z> is not symmetrical with the X command, it is more practical, since it is very difficult to press <C-S-X>. However, I am having another problem. I hope you can help me with it.

I am new to Vim, as you can see (five days of practice, to be exact). In any case, I wrote the following script, that worked perfectly well in the machine I am using to perform experiments:

:imap <C-h> <Left>
:imap <C-j> <Down>
:imap <C-k> <Up>
:imap <C-l> <Right>
:imap <C-x> <Delete>
:imap <C-z> <BS>
:imap <C-w> <C-o>:w<CR>

However, the script is not working in about 40 machines. The machines are all of the same brand (HP), and roughly the same model. All machines are running Zorin OS, that is built on top of Ubuntu. As far as I am aware, all machines have the following programs: Ubuntu, Zorin, konsole, rlwrap (that was necessary to run a shell inside vim), sbcl Common Lisp, Emacs, Latex, Latex-extra, vim, cream, firefox, google.

In the machines where the script does not work, when one types <C-x> in INSERTION mode, the command erases the char below the cursor, and put the cursor one char ahead, leaving a blank behind. In fewer words, the <C-x> command is behaving almost like a replace space bar.

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

No comments: