On the subject of swearing, cussing, and general bad language in fictional dialogue:
Profanity and obscenity have their own grammar, and if you don’t know first-hand how to deploy it, don’t try to fake it. Either leave the bad language out completely or seek out a trusted beta reader with a fluency in the vulgar tongue. The explanation, “I’m going to be writing about this, and I want to make sure I get it right,” opens a lot of research doors, some of them in unexpected places. It’s a rare human being who doesn’t appreciate being sought out for his/her expertise.
Period-accurate bad language seldom works as well as it should, because the shock value is lost. Made-up future bad language, for its part, doesn’t have the shock value to lose. In the latter case, the best bet is usually to go with contemporary expressions — or, as the science fiction writer James Blish once said, “The future equivalent of ‘damn,’ expressed in present terms, is ‘damn.'” Sometimes this is also the best answer for historical bad language as well, though it can depend on the overall tone of the rest of the book; most of the time, a writer of historical fiction has to walk a tightrope strung over the twin pits of presentism and forsoothery (about which I will write a post someday) without falling into either one.
Which brings us around — finally — to my actual peeve:
It’s either dammit or damn it. Writing it out as damnit, with the silent n included, makes it look like the speaker is cursing out the egg of a head-louse.