setting clipboard register by vim9cmd or noremapping

9 views
Skip to first unread message

Ni Va

unread,
Jan 12, 2022, 8:18:09 AM1/12/22
to vim_use
Hi,

Just would like to set clipboard register value to path of my current opened file.

but it seems to fail trying these :

  :vim9cmd @"* = expand('%:p')

or in $MYVIMRC
  nnoremap          cp    :vim9cmd @"* = expand('%:p')<CR>

Ni Va

unread,
Jan 12, 2022, 8:33:42 AM1/12/22
to vim_use
Sorry solved as this :

nnoremap          cp    :vim9cmd @* = expand('%:p')<CR>

or from vim command line :
:vim9cmd @* = expand('%:p')
Reply all
Reply to author
Forward
0 new messages