The only viable option here is to make yourself non-replaceable. Stuff as much knowledge in your head as possible, share bare minimum, use non-standard tech stack, write no documentation, ground as much project on yourself.
And in the interim, before you're non-replaceable (which very, very few people actually are even if they follow your suggestions), you'll definitely be fired for being an asshole to your coworkers, barely doing half your job, and as jensens said having horrific technical judgment. And rightfully so, and now there's a company of people who know you and what kind of coworker you are.
Several times in my career I've had my boss or one of my boss's peers send someone's resume to me because our tenures at another company lined up. Sometimes I knew them, and sometimes someone otherwise very well qualified for a job on the technical merits didn't get an initial interview because they were horrible to work with.
> Stuff as much knowledge in your head as possible, share bare minimum, use non-standard tech stack, write no documentation, ground as much project on yourself
this will be countered by denied code reviews and security reviews because of the nonstandard tech, forced to write documentation and finally knowledge sharing.