Zalgorithm

Neovim command line commands

Related to: notes / Neovim (LazyVim) key commands.

NOTE: I’m not including the : character in the commands. Enter : to open the command-line prompt.

Copy current filename to the system clipboard

let @+ = expand('%:t')

Explanation:

Copy the current root filename (excluding extension) to the clipboard

let @+ = expand('%:t:r')

The r (root) modifier removes the extension.

Copy the full absolute path to the clipboard

let @+ = expand('%:p')

Copy the relative path to the clipboard

let @+ = expand('%:')
Tags: