〜んとする
be about to, be trying to (literary)
Verb ない-stem + んとする / んとして / んとしている (する → せんとする)
Sign up free to review this point on a spaced schedule.
んとする is a literary "be about to, try to": 日が沈まんとする頃、港に着いた, "we reached the harbour just as the sun was about to set".
It's the classical version of ようとする (N3). It attaches to the ない-stem: 沈む → 沈ま + んとする, 言う → 言わ + んとする, and する → せんとする.
A very common phrase is 言わんとすること, "what someone is trying to say": 彼の言わんとすることはよく分かる, "I understand what he's getting at".
It belongs with んがため ("in order to") and んばかり ("as if about to"), which also use this classical ん. Watch the shape: ようとする needs the volitional (沈もうとする). After the ない-stem, only んとする fits.
Examples
日が沈まんとする頃、港に着いた。
We reached the harbour just as the sun was about to set.
彼は何か言わんとして、口を閉じた。
He was about to say something, then closed his mouth.
今、新しい時代が始まらんとしている。
A new era is about to begin.
彼の言わんとすることはよく分かる。
I understand what he's getting at.
船は今まさに出航せんとしていた。
The ship was just about to set sail.