https://www.slothparadise.com/copy-system-clipboard-vim/
How to Copy to System Clipboard from Vim
In this tutorial, I used Cygwin on Windows 10 and Bash on Windows 10 to copy text from vim
to the system clipboard for pasting.
- Check if we have
+clipboard
on our version of vim
- If you’re using bash on Windows or Ubuntu, and vim does not have
+clipboard
, sudo apt-get install vim-gnome -y
+clipboard
gets installedvim file
- Type:
:%y+
to copy all lines - Right click and paste, and you’ll see the lines you copied from
vim
In this tutorial, I used Cygwin on Windows 10 and Bash on Windows 10 to copy text from vim
to the system clipboard for pasting.
- Check if we have
+clipboard
on our version ofvim
- If you’re using bash on Windows or Ubuntu, and vim does not have
+clipboard
,sudo apt-get install vim-gnome -y
+clipboard
gets installedvim file
- Type:
:%y+
to copy all lines - Right click and paste, and you’ll see the lines you copied from
vim
Check if we have +clipboard
on our version of vim
.
Instead of -clipboard
, we want +clipboard
.
Instead of -clipboard
, we want +clipboard
.
If you’re using bash or Ubuntu, and vim does not have +clipboard
already:
+clipboard
gets installed.
Open the file with vim
and copy its contents to the clipboard.
Type:
to yank all lines.
Type:
to yank all lines.
Now, you can right click and paste into a text editor.
I pasted the clipboard to an empty document in Sublime!
I pasted the clipboard to an empty document in Sublime!
'Linux' 카테고리의 다른 글
vimrc 옵션 (0) | 2019.05.05 |
---|---|
리눅스 레포지토리 패키지 찾기 명령어 (0) | 2019.05.05 |
vim 단축키 정리 (0) | 2019.04.28 |
리눅스 소켓프로그래밍 설명 (0) | 2019.01.26 |
git 관련 설정 및 명령어 (0) | 2019.01.26 |