On Oct 20, 10:13 am, Ben Fritz <[email protected]> wrote: > On Oct 20, 12:05 am, sinbad <[email protected]> wrote: > > > hi, > > > is it possible when a text is yanked, perhaps an autocommand kind of > > mechanism. > > i want to be able to set a variable or call a function when a text is > > yannked. i know > > there are many ways in which text can be yanked, but i want a solution > > for the specific > > case of yank commands like "yy" "yw" ... Is it possible ? > > Sure, map the y command. > > Or tell us what you're actually trying to accomplish. Possibly it has > already been done for you. The YankRing plugin comes to mind, but you > haven't said what the actual problem you're trying to solve is.
i have mapped n and p keys to do some other functions for example to navigate forward/backward through a quickfix list. i know mapping n and p is not a good idea, but i use quickfix so often that i need a very simple way to navigate through it, i wanted a single char mappings so, n and p were the obvious choices (to me atleast), now for p's paste function i had setup another knob, which when set performs paste function and when not set it does "list previous function", i have mapped another key(s) to set this knob. depending on my usage of vim, believe me, it's working very well for me and moreover i got use to these mappings. now i want to automate the control of knob, for example when i yank some text, i definitely want to paste it, so if there is an autocommand sort of mechanism, when an yank is done, i automatically set the knob so that the immediate p key press would mean a paste rather than quickfix previous. thanks -- 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
