setting clipboard register by vim9cmd or noremapping

8 views
Skip to first unread message

Ni Va

unread,
Jan 12, 2022, 8:18:09 AMJan 12
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 AMJan 12
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