Re: Mapping to the numerical - and + and *
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 ---START kMinus and CTRL-X and SHIFT-Del are Cut vnoremap kMinus+x vnoremap S-Del +x vnoremap C-X +x kMultiply and CTRL-C and CTRL-Insert are Copy vnoremap kMultiply +y vnoremap C-Insert +y vnoremap C-C +y kPlus and CTRL-V and SHIFT-Insert are Paste map kPlus +gP map S-Insert +gP map C-V+gP cmap kPlus C-R+ cmap S-Insert C-R+ cmap C-V C-R+ 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 script kPlus' paste#paste_cmd['i'] exe 'vnoremap script kPlus' paste#paste_cmd['v'] exe 'inoremap script C-V' paste#paste_cmd['i'] exe 'vnoremap script C-V' paste#paste_cmd['v'] imap S-Insert kPlus vmap S-Insert kPlus imap S-Insert C-V vmap S-Insert C-V Use CTRL-Q to do what CTRL-V used to do noremap C-QC-V ---END _ Win a Zunemake MSN® your homepage for your chance to win! http://homepage.msn.com/zune?icid=hmetagline
Re: Mapping to the numerical - and + and *
* 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 kPlus +p :vnoremap kMinus +d :vnoremap kMultiply +y This looks fine. What you want to act on is implicitly the visual selection. :noremap kPlus +p This is fine. :noremap kMinus +d :noremap kMultiply +y Here you will need to specify *what* you want to cut or paste with a motion command after you have pressed kMinus of kMultiply. :inoremap kMinus +d :inoremap kMultiply +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 kMinus C-O+d :inoremap kPlus C-O+p :inoremap kPlus +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. CTRL-R+ is the insert-mode equivalent of +p in normal-mode. -- JR
Mapping to the numerical - and + and *
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-17727moid=7581
Re: Mapping to the numerical - and + and *
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 kMinus+d :noremap kPlus +p :inoremap kPlus C-R+ :vnoremap kMultiply +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.
Re: Mapping to the numerical - and + and *
* 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)~ --- [...] kPlus keypad +*keypad-plus* kMinuskeypad -*keypad-minus* kMultiply 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 *
--- 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 *
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