yankkakoune

How do I yank to system clipboard in Kakoune?


If I yank a word in kakoune, how do I paste it into another editor (e.g. gedit)?

I have read How to make vim paste from (and copy to) system's clipboard? since vim is very similar but kakoune does not have any * register.


Solution

  • In case all the links go away this is the complete solution:

    <a-|> xsel --input --clipboard <ret>
    

    Explanation:

    This will work on Linux. Not sure about MacOS, I'd imagine piping to pbcopy would Just Work.

    EDIT: To make live easier define a key binding in User mode like so (in your .kakrc):

    map global user y '<a-|>xsel -i -b<ret>'
    

    Now you can select the text and press ,y to yank to the system clipboard. The leading comma tells Kakoune to look for the key binding in User mode.