In debian, some weird version of vi is installed by default The correct version is nvi, so just apt install nvi update-alternatives --config vi apt remove vim solves all the borkedness of default vi and makes is possible to copy/paste again using the 3rd mouse button