15. How to copy and paste

Copying a single line

Navigate to the line you want to copy.

Press yy (two times y). This copies the entire line.

Copying multiple lines

Go to the first line you want to copy.

Press V for the visual mode of the lines.

Use the arrow keys or j and k to select rows.

Press y to copy the selected lines.

Inserting text

Inserting text

Scroll to the location where you want to insert text.

Press p to insert text after the cursor or P to insert text before the cursor.

Other useful features

Deleting text

Scroll to the line you want to delete.

Press dd to delete the entire line.

Delete multiple lines

Scroll to the first line you want to delete.

Press V for visual mode of the lines.

Use the arrow keys or j and k to select rows.

Press d to delete the selected rows.

Moving text

Select the text you want to move (for example, use V and j/k).

Press d to delete the selected text (which also copies it to the clipboard).

Navigate to the location where you want to move the text.

Press p or P to paste the text.

Using the system clipboard

Neovim supports integration with the system clipboard, allowing you to copy and paste text between Neovim and other applications.

Copying to the system clipboard Select the text you want to copy (for example, using V and j/k).

Press "+y to copy the selected text to the system clipboard. Paste from the system clipboard.

Navigate to the location where you want to paste the text.

Press "+p to paste text from the system clipboard after the cursor or "+P to paste text before the cursor.

Outside of Neovim, use the shortcut CTRL+V.

To copy t to Neovim from another application use SHIFT+CTRL+V.

These commands and keyboard shortcuts allow you to work efficiently with text in Neovim.

NOTE: in Linux, for proper functionality, I had to install the xclib package to copy from Neovim !

These commands and keyboard shortcuts will allow you to work efficiently with text in Neovim.

Copyright ยฉ 2024 - 2025 ๐Ÿš€ ApolloNvim / Lukรกลก Kaลˆka