Re: Mapping to the "numerical" - and + and *

2007-03-02 Thread Eric Leenman

Thanks all.
I got it working what I wanted by copying the mswin.vim file and stripping 
it to what I wanted.
When you don't understand vim-scripting as I do then good copying is beter 
then bad designing .


Rgds,
Eric


"---
" kMinus and CTRL-X and SHIFT-Del are Cut
vnoremap "+x
vnoremap  "+x
vnoremap"+x

" kMultiply and CTRL-C and CTRL-Insert are Copy
vnoremap  "+y
vnoremap   "+y
vnoremap"+y

" kPlus and CTRL-V and SHIFT-Insert are Paste
map   "+gP
map"+gP
map "+gP

cmap  +
cmap   +
cmap+

" Pasting blockwise and linewise selections is not possible in Insert and
" Visual mode without the +virtualedit feature.  They are pasted as if they
" were characterwise instead.
" Uses the paste.vim autoload script.

exe 'inoremap 

Re: Mapping to the "numerical" - and + and *

2007-03-01 Thread Jean-Rene David
* Eric Leenman [2007.03.01 13:30]:
> >How were you planning to use those?
>
> I want to use these as cut, paste and copy iso
> CTRL-X, V and C.

Cutting and copying are compound operations in the
sense that you need to specify /what/ they are
going to act on. There are many ways to do this,
depending on the mode you are in.

> I now got
> :vnoremap  "+p
> :vnoremap  "+d
> :vnoremap  "+y

This looks fine.

What you want to act on is implicitly the visual
selection.

> :noremap  "+p

This is fine.

> :noremap  "+d
> :noremap  "+y

Here you will need to specify *what* you want to
"cut" or "paste" with a motion command after you
have pressed  of .

> :inoremap  "+d
> :inoremap  "+y

These are "insert-mode" mappings. So of course you
get "+d in your text. This is exactly what you
told vim to do.

What do you *mean* when you are in insert mode and
want to "cut" or "copy"? "Copy" what?

One possibility is to revert to normal mode and
follow the command with a motion:

:inoremap  "+d
:inoremap   "+p

> :inoremap  "+p

This is meaningful but the syntax is incorrect.
Tony gave you the answer for this one.

> I tried the help CTRL-R but I don't follow that.

It would help if were more explicit about the
parts you don't understand.

In normal mode, pressing "+p means: 
'put the content of register + after the cursor'.

In insert mode, pressing "+p means: 
'insert " then + then p'. 

It has nothing whatsoever to do with registers.
This is where CTRL-R helps you. + is the
insert-mode equivalent of "+p in normal-mode.

-- 
JR


Re: Mapping to the "numerical" - and + and *

2007-03-01 Thread Eric Leenman

How were you planning to use those?

--
JR


I want to use these as cut, paste and copy iso CTRL-X, V and C.
I assume that the keypad keys by linux-windows managers are not used.
and therefor it's easier to move between the windows and linux .

[...]
Trying to extend the hints that Tony send

:vnoremap  "+d
:noremap  "+p
:inoremap  +
:vnoremap  "+y

[...]

I now got
:vnoremap  "+p
:vnoremap  "+d
:vnoremap  "+y
:noremap  "+p
:noremap  "+d
:noremap  "+y
:inoremap  "+d
:inoremap  "+p
:inoremap  "+y

But that is not working, especially not in insert-mode where I get "+d as 
text in my code when I press the kMinus.

I tried the help CTRL-R but I don't follow that.
What is wrong with these mappings?

Rgds,
Eric

_
Win a Zune™—make MSN® your homepage for your chance to win! 
http://homepage.msn.com/zune?icid=hmetagline




Re: Mapping to the "numerical" - and + and *

2007-02-28 Thread Marc Weber
On Wed, Feb 28, 2007 at 12:41:22PM +, Eric Leenman wrote:
> Hi,
> 
> Is it possible to map the - and + and * keys on the "nummerical section of 
> a keyboard" (in other words the keys in the group where the num-lock key is 
> also)
> to functioan as cut, paste and copy?
> If so, how do you this?
Have look at :h keypad-plus etc.
But I don't know wether it works everywhere. Try a :helpgrep keypad to
get all information..

Marc


Re: Mapping to the "numerical" - and + and *

2007-02-28 Thread Georg Dahn

--- Jean-Rene David <[EMAIL PROTECTED]> wrote:
> In vim, "delete" always saves the deleted data
> somewhere.

Don't forget the black hole register "_

Thus, just do "_x on the visual selection and
the selected text is deleted to nirvana.

Best wishes,
Georg








___ 
The all-new Yahoo! Mail goes wherever you go - free your email address from 
your Internet provider. http://uk.docs.yahoo.com/nowyoucan.html


Re: Mapping to the "numerical" - and + and *

2007-02-28 Thread Jean-Rene David
* Eric Leenman [2007.02.28 08:00]:
> Is it possible to map the - and + and * keys on
> the "nummerical section of a keyboard" (in other
> words the keys in the group where the num-lock
> key is also)

That part of the keyboard is sometimes referred to
as the "keypad". You can refer to those keys in
vim with the following (from :h key-notation, near
the end of the table):

notationmeaning equivalent  decimal value(s)~
---
[...]
 keypad +*keypad-plus*
keypad -*keypad-minus*
 keypad **keypad-multiply*

> to functioan as cut, paste and copy?

In vim, "delete" always saves the deleted data
somewhere. So in that sense, it's equivalent to
"cut", as long as you know where vim put the
stuff. The other operations are referred to in vim's
documentation as "put", and "yank".

These operations usually require more than one
keystroke. How were you planning to use those?

-- 
JR


Re: Mapping to the "numerical" - and + and *

2007-02-28 Thread A.J.Mechelynck

Eric Leenman wrote:

Hi,

Is it possible to map the - and + and * keys on the "nummerical section 
of a keyboard" (in other words the keys in the group where the num-lock 
key is also)

to functioan as cut, paste and copy?
If so, how do you this?

Rgds,
Eric


See ":help keypad-home" and what comes after.

:vnoremap "+d
:noremap   "+p
:inoremap  +
:vnoremap  "+y


The above works for + (delete/cut) and * (yank/copy) in Visual mode, for - 
(put/paste) in Normal and Insert mode -- if I didn't goof. All of them use the 
clipboard, which is useful to copy between Vim and a different app, not so 
useful to copy within a single instance of Vim (where you may prefer to use 
just d, p and y in Normal or Visual mode).



Best regards,
Tony.
--
Science is what happens when preconception meets verification.


Mapping to the "numerical" - and + and *

2007-02-28 Thread Eric Leenman

Hi,

Is it possible to map the - and + and * keys on the "nummerical section of a 
keyboard" (in other words the keys in the group where the num-lock key is 
also)

to functioan as cut, paste and copy?
If so, how do you this?

Rgds,
Eric

_
Refi Now: Rates near 39yr lows!  $430,000 Mortgage for $1,399/mo - Calculate 
new payment 
http://www.lowermybills.com/lre/index.jsp?sourceid=lmb-9632-17727&moid=7581