Grammer is spelled with two m's, as it is derived from the late Middle English word grammaire, from the Latin gramma which means "a letter of the alphabet, writing, or any other character."
Grammer should be considered distinct from grammar, which is a set of rules for how words should be used and structured in sentences. Grammar is the science of how language works; Grammer is the specific manner of writing words and sentences.
Here is a link to a helpful resource that explains the differences between grammar and grammer:
https://www.grammarcheck.net/grammer-vs-grammar/
It is important to note that in English, both spellings—grammar and grammer—are correct. However, grammer can be used to refer specifically to the way a document is written. For example, "My grammer is not perfect, but I'm trying to write better."