vim-yankstack icon indicating copy to clipboard operation
vim-yankstack copied to clipboard

After setup callback

Open iamFIREcracker opened this issue 8 years ago • 0 comments

This PR adds support for a user defined function that yankstack will run after the initial setup.

I recently switched from pathogen to Vim's built-in support for plugins, and noticed that calling yankstack#setup() to get custom mappings set up did not work anymore; it turns out I have to throw a packloadall somewhere in my vimrc, but that breaks other things.

So I thought: why not let the user know when the initial setup is complete? I could then add the following to my vimrc, and call it a day:

function! YankStackAfterSetup()
    nmap Y y$
    nmap D d$
    nmap gp <Plug>yankstack_substitute_older_paste
    nmap gP <Plug>yankstack_substitute_newer_paste
endfunction

let g:yankstack_after_setup = 'YankStackAfterSetup'

What do you think about that? Can you think of a better way to solve this?

Ciao, Matteo

iamFIREcracker avatar Oct 07 '17 15:10 iamFIREcracker