---
title: "Vim Copy to Clipboard on Ubuntu"
date: 2021-08-08T22:46:50.000Z
author: Z.SHINCHVEN
tags: [vim, vim-gtk, Ubuntu]
canonical: https://atlassc.net/2021/08/09/ubuntu-vim-copy-to-clipboard
---
## Check Vim Version

Check if [register](https://vim.fandom.com/wiki/Accessing_the_system_clipboard#:~:text=Checking%20for%20X11-clipboard%20support%20in%20terminal) is available for your version of vim:

```bash
vim --version | grep clipboard
```

- `+clipboard` - means it is available, skip next step.
- `-clipboard` - means it is not available.

## Install a Vim that Supports Register on Ubuntu

```bash
sudo apt purge vim       # remove default vim
sudo apt install vim-gtk # install the vim with extra functions
```

## Copy to Clipboard

- Enter select mode by press `v`.
- Use `h`+`j`+`k`+`l` to select content
- Press `"`+`+`+`y` to copy selected content to system clipboard.
