on Mac
-
copy selected part: visually select text(type
v
orV
in normal mode) and type:w !pbcopy
-
copy the whole file
:%w !pbcopy
-
past from the clipboard
:r !pbpaste
on Mac
copy selected part: visually select text(type v
or V
in normal mode) and type :w !pbcopy
copy the whole file :%w !pbcopy
past from the clipboard :r !pbpaste