How would i go about detecting if a rs-485 cable is plugged in?
There is a huge benefit of the RS-485 electrical layer protocol that allows for long distance communications in the presence of multiple volts of common mode voltage differences between the two ends.

I would highly discourage the use of extra signal pins in the connectors for "cable connected" checking that do not meet the same specs as the RS485 signalling signals. So I would not run low level MCU GPIO level signals over the cable wires.

The far better situation is to realize that connected cables enable communications and disconnected cables impede communications. So take advantage of that and let your systems MCUs implement heart beat handshaking directly though the RS485 communications layer using appropriately designed small packets. If one or the other end fail to see the heartbeat packets come or get acknowledgement of them then know that your cable is either disconnected or has broken wires. This scheme covers every case that would prevent communications.

For devices where you have to consider the devices at the far end of your cables to be unable to be modified, either hardware or software wise, you have to get clever regarding how you determine if the device is connected. For these secondary devices you have to implement your periodic heart beat check in some device specific way. This can vary greatly depending upon the device. The only way this would not work is if the secondary device only takes "write only to device" transmissions with no possibility of any acknowledgement or return result. A simple method is often a status check. Sometimes you can read from some register that has a known value. Other times you may write something and read it back to verify. As the implementer you have to figure out what works within your system....but in the end it is still better than using extra signal pins. 

In my book the only acceptable way on an RS-485 interface to use the extra pins for cable continuity test is if you run the signals through the same type of drivers/receivers as used by the RS-485 signalling so that you can achieve the same distance and common mode isolation that the signalling uses.