If you open a file using vi/vim and it won't let you copy because it enters the VISUAL mode, you have to disable Mouse Reporting. Press Cmd + R to toggle, or go to View → Allow Mouse Reporting
Can't copy to system clipboard out of vim inside Mac OS Terminal?
in Mac OS