My vim doesn't shipped with +clipboard, so I could not use like "+y commands to copy and paste with clipboard.
I want to map to copy the text to clipboard, which is
vnoremap <C-c><C-c> :write !xsel -b<CR>
however, it will shows "Press ENTER or type command to continue", which is boring. How should I disable the message?
You can use the :silent command to suppress that output.
There's a small issue in doing that in a vnoremap, since that adds a '<,'> range to your command, but that needs to be a range for write and not silent, so use <c-u> to delete that added range at the start and then add it explicitly after the silent.
Putting it all together:
vnoremap <C-c><C-c> :<c-u>silent '<,'>write !xsel -b<cr>
Another possible solution is to add an extra <cr> to the end of the original mapping, to go past the "Press ENTER" prompt:
vnoremap <C-c><C-c> :write !xsel -b<cr><cr>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With