Insomnia Support Group
Insomnia is a symptom, rather than a disease, and is characterized by inadequate quantity or quality of sleep. People with insomnia complain of difficulty falling or staying asleep, which results in significant impairment of daytime functioning. Insomnia is categorized as transient (shorter than one week), short-term (one to three weeks) or chronic (longer than three...
Regarding "4 hours before bed", that applies to caffeine, not necessarily food. Many people eat less than 4 hours before bed with no problem.
You might try several small calorie-dense snacks timed separately before bed. Again, an MD familiar with insomnia might be of great help in your situation.
The food is a queue that tells my brain that its time to go to sleep.
It took me around a month or so to do it. Works like a charm. Although, you could condition yourself with anything.