I'm laughing reading some of these comments. No one -- I repeat, NO ONE -- is indispensable. EVERYONE should always have his/her ear to the ground to get the pulse of the company, know its financials, etc. and if things look bad, start preparing to move on.
For the record, I have never been laid off. In one company I worked for, my position was moved but they found another position for me. Prior to that, there had been one or two rounds of layoffs and while I survived, I got more work heaped on me. Even still, I'm not delusional enough to think I'm "too awesome to get laid off." I used that opportunity (and others throughout my career) to move to greener pastures. My mistake at that company (and probably at a previous company too) was that I should've pushed to be laid off to get the fat severance packages, as I would've had NO issues finding another job.
One thing I have learned over the years is that nobody is too awesome to get laid off. Nobody is irreplaceable. Perhaps the exception is when you own your own business, but that is a different situation.
I have 20 years in with my current employer. It would be hard for them to get rid of me simply because I have so much equipment out in the field but they could replace me and the company would still get along fine.
This.
In the situation I outlined above, I was the highest rated employee in my department for years and the company had no qualm about eliminating the position (it was a larger departmental consolidation). Yes, I could've moved to HQ, but to add insult to injury, HQ wanted me to "interview" for it. I had no intention of moving and having to interview was an insult given my accomplishments and what I had achieved for the company, so I took the position that was created for me by our local director with the full intention of buying time to find another job.
Also, at this company, one of my friends was the lone MS application developer. He always bragged about how indispensable he was and that the company would "grind to a halt" if he left. Well, guess what? He got another job offer, went in to his manager's office, and the basic response was "don't let the door hit you in the ass on the way out." Not only wasn't he nearly as indispensable as he thought, they didn't even bother replacing him, let alone throwing money at him to stay. I am 100% sure that if he would've stayed, he would've been laid off in the next round of layoffs a couple years later. Of course, in all fairness, this guy's ego was huge and his apps (with maybe one exception) were not that important and from my conversations with him and observations of some of his applications, he wasn't nearly as good a developer as he thought. He made tons and tons of rookie mistakes. At any rate, he didn't view things correctly and him leaving did nothing except play right into management's hands.