You are not logged in.

#1 Yesterday 06:24:29

Bernadette
Member
Registered: Yesterday
Posts: 4

[SOLVED] Struggling with clipboard support in Vim

Hi, I need your help! I can't copy from Vim to external application and

vim --version

command returns

-xterm_clipboard

. As I understood, I need to recompile my Vim and add clipboard support into config file, but I don't know where I can find it. Is it the ~/.vimrc file? I can't find the original PKGBUILD in my ~/vim/ directory also.

I've tried to use pacbuilder-svn and

$ pacbuilder --install --edit vim vim-runtime

, but the the script doesn't ask me whether I want to edit the PKGBUILD file, it just builds packages and that's it.

I've also tried to use devtools and

$ sudo pkgctl repo clone https://github.com/vim/vim.git

command but it says

How can I recompile my Vim with clipboard support? I would be grateful for your help.

Last edited by Bernadette (Yesterday 13:26:10)

Offline

#2 Yesterday 06:56:09

seth
Member
Registered: 2012-09-03
Posts: 64,283

Re: [SOLVED] Struggling with clipboard support in Vim

I need to recompile my Vim and add clipboard support

https://wiki.archlinux.org/title/Vim#Installation - install gvim?
https://wiki.archlinux.org/title/Vim#Clipboard

Alternative approach: https://stackoverflow.com/a/20961530 (doesn't need gvim)

Online

#3 Yesterday 07:02:07

Bernadette
Member
Registered: Yesterday
Posts: 4

Re: [SOLVED] Struggling with clipboard support in Vim

Hi seth, yeah I heard about gvim, but still want to keep a default Vim. Thank you for alternative solution, I'll try it!

Offline

#4 Yesterday 07:10:49

seth
Member
Registered: 2012-09-03
Posts: 64,283

Re: [SOLVED] Struggling with clipboard support in Vim

The point about gvim is that it has clipboard enabled, if you want to build a custom vim package, see https://wiki.archlinux.org/title/Arch_build_system
The most straight forward way is probably https://wiki.archlinux.org/title/Arch_b … t_directly

Online

#5 Yesterday 07:39:54

Bernadette
Member
Registered: Yesterday
Posts: 4

Re: [SOLVED] Struggling with clipboard support in Vim

I came up with

 vnoremap <C-c> :w !xclip -i -sel c<CR><CR>

line in my ~/.vimrc file using xclip package. Also my terminal's copy/paste features work in vim as well. For me it is shift + mouse middle click button. Thank you for your help, seth!

Offline

#6 Yesterday 09:38:31

seth
Member
Registered: 2012-09-03
Posts: 64,283

Re: [SOLVED] Struggling with clipboard support in Vim

\o/
Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Online

#7 Yesterday 13:28:34

Bernadette
Member
Registered: Yesterday
Posts: 4

Re: [SOLVED] Struggling with clipboard support in Vim

done, thank you.

Offline

Board footer

Powered by FluxBB