Slightly altering put behaviour

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Slightly altering put behaviour

justAnotherUser
This post has NOT been accepted by the mailing list yet.
Hello forum

By default, p and P put the unnamed register, which stores the last
yanked or deleted text. That's not what i usually want -- i usually
want to put what i yanked, and not what i maybe occasionally deleted
in the meantime. The "0 register holds the last yank, so "0p does the
right thing. Now i try to set this to be the default behaviour of p
and P. Its still possible to put the unnamed register with ""p or
""P. So what i did was to add the remappings
nnoremap p "0p
nnoremap P "0P
to my vimrc.
The result was not being able to use any registers other than "0; of
course, if i type, say, "ap, this would be expanded according to my
mapping, and give "a"0p, the latter command is then executed, putting
the "0 register instead of intended "a. So the remappings above are
not viable.
Is there any way to make p and P to put the "0 register by default and
still to keep the "old" meaning of p for explicitly putting registers
by their name?
Loading...