문제

I'm trying to use vim on a remote Ubuntu server and I'm noticing that the start up for vim is too slow unless I use the -X flag or have set clipboard=exclude:.* in my .vimrc.

When I use either options, vim starts up fast but the problem is I can't copy from vim to the system clipboard. I've tried numerous times to do :set clipboard=unnamed and the like from the console but it won't register anything because it seems to only connect to the x server if that line is in .vimrc.

How can I start vim with the -X option but start the x server afterwards (only if I need to copy stuff)? Or how can I change clipboard settings from within the console?

도움이 되었습니까?

해결책

If you have to start Vim with -X, I don't think there's a way to later enable clipboard support. You either have to find and fix the root cause for the slowness of connecting to X, or work around this with external tools, e.g.

:3,5w !xsel --clipboard

or

:3,5w !xclip -in -selection clipboard
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top