On 20/12/08 04:22, Leandro Camargo wrote:
> Yeah...following a simpler idea, it'd become something like these:
>
> imap<C-Left>   <Esc>bi
> imap<C-Right>   <Esc>wi
> imap<C-S-Left>   <Esc>A
> imap<C-S-Right>   <Esc>I
>
> On Sat, Dec 20, 2008 at 1:02 AM, Marc Weber<[email protected]>  wrote:
>> You still haven't corrected this i (should be a). Using<esc>A is
>> much shorter anyway :-) Thus just use:
>>> imap<C-S-Right>  <Esc>A
>> On linux you can do something like
>> xmodmap -e 'clear Lock' -e 'keycode 0x42 = Escape'
>> to map capslock to<esc>. Then typing<caps>b is even more convinient
>> than using the default ctrl-left and ctrl-right combos. Your<esc>
>> mapping stuff won't work with visual mode. So do yourself a favour,
>> read :h motion once to see what mappings are availible. Repeat this once
>> a month till you feel you know most mappings you really need. You'll
>> find mappings such as tT fF (and using ; and , (repeat last movement)
>> which are much better than ctrl- quirks. And you'll be able to use them
>> in visual mode as well.
>
> Yeah, believe me...I'm a shortcuts addict, so I try hard to learn the
> most useful of them in vim.
> But I don't know if you got the main idea on this, which is:
> * having shortcuts in *insert mode* for jumping a word (forward and
> backward) and going to the current line edges, without changing the
> mode by hand (like typing ESC), because I want something with lower
> cost to my hands like Ctrl + something in insert mode.
>
> And mapping ctrl + arrows would give me a very good user experience
> for its ease of use.
>
>> You'll be more precise with vim mappings as well. Example:
>> Lookup the difference e E  w W. Which behaviour do you want for c-right?
>
> Yeah, I understand.
> That's why I really meant w for word forwarding and b for word backwarding.
>
>> I know its hard to learn something you're not used to. Put it will pay off 
>> soon
>> if you spend some time within vim.
>
> Sure. I'm in that philosophy too. I use to spend a precious time
> digging vim features and any other tools that could save me some
> valuable time in long term.

IIUC, Ctrl-Left and Ctrl-Right to move left/right by words are among the 
default key bindings of Vim. If they don't work when you hit them, not 
even after loading Vim with "-N -u NONE" (without quotes) on its (shell) 
command-line, then there is something wrong about how these keys are 
passed to Vim. Maybe your terminal or window manager doesn't pass them 
at all, or maybe it strips away the Ctrl modifier, or maybe it doesn't 
respect its own termcap/terminfo table, I don't know. Here are a few 
troubleshooting hints:

- What exactly happens when you hit Ctrl-Left (on some text page) after 
starting Vim with -N -u NONE
- Does it work (or not work) the same way when you start Vim normally?
- What is the answer to :echo "\<C-Left>" (with the quotes)?
- What happens in Insert mode when you hit Ctrl-V followed by Ctrl-Left? 
(If you have remapped Ctrl-V to Paste, use Ctrl-Q instead).
- The same with Ctrl-Right instead of Ctrl-Left
- All the above in gvim and in Console Vim (or if you have only one of 
them, then which one?)
- What are the first five lines or so of the ":version" output? (until 
the line ending "Features included (+) or not (-):"? (See :help :redir 
about how to capture that output. In particular, ":redir @+" [without 
quotes] starts redirection to the clipboard.)

Ctrl-Shift-Left and Ctrl-Shift-Right normally mean "the same as without 
Shift, but also start Select mode". (This is under control of the 
'selectmode' and 'keymodel' options.) Do they? If they do, you can remap 
them, but of course if you do you'll lose the default bindings.


Best regards,
Tony.
-- 
The very powerful and the very stupid have one thing in common.
Instead of altering their views to fit the facts, they alter the facts
to fit their views ... which can be very uncomfortable if you happen to
be one of the facts that needs altering.
                -- Doctor Who, "Face of Evil"

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to