Instead of typing the whole message content in command line, you can set the content in a yaml file
: msg.yaml :
x: 1.0
y: 2.0
z: 3.0
and then pass the file to the ros2 command line.
ros2 topic pub /point geometry_msgs/msg/Point "$(cat msg.yaml | yq eval -o=json)"