06/08/2021 23:52 | Category: vim

Tags: scriptsvim

vim filepaths in register

We can get the full paths, relative paths, and filenames within Vim. This pulls from the current buffer and will output it to the system clipboard (!).

" relative path
:let @+ = expand("%")

" full path
:let @+ = expand("%:p")

" just filename
:let @+ = expand("%:t")