That has a pretty simple and effective solution though: just mention that you want to leave. I've just been through getting a healthy amount of equity (as a freelancer no less) because someone else announced they were leaving.
If your job is _that_ important, you might not get promoted away, but you'll get the salary as if you were and then some.
Under my own personal belief system, I don't agree with this sentiment. Sure, you might obtain the immediate but you're kind of poisoning the well with an announcement of expected departure.
I take it as a rule to not ever mention that you're leaving somewhere until you're leaving and then follow through.
I don't know. If your role is that important, they'll make you an offer to make you stay, which, unless you really, really, really want to leave, you'll take, because it'll be very good. Then they either work on making you not the single point of failure, or they'll accept you being that important and just go on paying you appropriately for it.
I see "wanting to leave" as either absolute ("I hate this company, no amount of money can make me stay") or relative ("I could make more money / have less work / do more interesting stuff elsewhere"). The latter can totally be shifted by adding significantly more money, at least for most people.
If your job is _that_ important, you might not get promoted away, but you'll get the salary as if you were and then some.