There are at least four possibilities. I list them in the order of straightforwardness - so 1 is easier than 2 and so on. Find screenshots below:
Solution 1
Re-project your project CRS to a pacific centered CRS like EPSG:3832
- and you're done. For the line you want to represent, it is better than a Greenwich-centered CRS.
Solution 2
Use Menu Processing / Toolbox / Geodesic line split at antimeridian
.
Solution 3
Split your line at a very short distance (like 1 meter) after the last point before the line should cross the antimeridian (180 degree meridian) and instead of this streches over the whole map canvas. Repeat this with clipping shortly before the first point on the other side. Than delete the line in between. However, you will loose a part of the liene (see screenshot).
Solution 4
Set a pacific centered CRS as project CRS, create your line there, than split at the anti-meridian (180 degrees meridian) as described in this solution.
Further solutions
Using the Geometry Wrapper
pugin might be another solution (not tested).
Screenshots
The screenshots illustrate solutions 1 to 3. In all cases, start point is the black line, created by connecting the red points:
Solution 1: change project CRS to EPSG:3832:

Solution 2: run Geodesic line split at antimeridian
on the black line to get the light red line:

Soution 3: manually clip the line at the two points indicated by red arrows. Afterwards, the disturbing "streched" line can be selected (highlighted in yellow) and deleted. However, the part of the line connecting over the 180th meridian is lost (compare with screenshot of solution 2):
