This is a great source of support, so I'm glad you found this site! A lot of us here have incredibly difficult challenges and turn to food, just like you...so really, you are not alone in that respect. One of the obstacles to weight loss is identifying what triggers you to overeat and you have already figured out the cause, so that's actually very helpful. The next step is for you to figure out how to manage this issue and how to find alternatives to food when you need comfort.
It takes time to make changes and for your body and mind to accept a new habit as part of your life. I think it's about 4 weeks, but as you practice your healthier life style, it will get easier with time. There will be ups and downs but the key is to commit because motivation comes and goes but commitment can be forever. If you slip, don't dwell on it...find out how you can avoid a slip next time.
Have a list of things you can do when you feel that sense of loneliness and urge to overeat. Here's my list, but you can make one for yourself.
Go for a walk or workout or just do crunches/push-ups/burpees/squats
Volunteer at a food bank/hospital/school, etc.
Hike, take a belly dancing class, etc.
Dance to favorite song as you do your housework or just for fun
Do some karaoke (youtube has lots of options)..it's silly but what the heck!
Read success stories on the Goal section of this site
Drink hot tea
Have a large pot of vegetable only soup which is low calorie but gives you a sensation of fullness.
See a movie
Watch a documentary on weight loss (Netflix)
Organize a drawer or a closet
Get involved in a book club
Paint your nails
Massage your feet
Take a bath
Watch a TED talk about happiness...there are quite a few great ones.
Write in a journal or start a blog.
Put a treatment mask on your face
Meditation has been found to be as helpful as antidepressants... 30 min. a day for the same effects http://www.dailymail.co.uk/health/ar...f-tablets.html
Finally, have a plan. Make changes every week. Start with something simple like not drinking any calories so no juices or fancy coffees with lots of calories..those are just ideas, but you get the picture. Another week, you could focus on getting the right amount of calories or protein. The next week, you could increase your exercise...a simple way is to get a pedometer and aim to get 10,000 steps a day. If you're still not able to do that with your ankle, then find activities you can do without hurting yourself.
Change the negative soundtrack in your mind. In stead of saying I'm lonely, I need to eat, say I'm so excited about my new lifestyle, I can do this! Try watching The Secret on youtube...or read about Louise Hay...it's not for everyone but there's a lot to it, in my opinion.
I hope to see you around here soon and that you'll find a way to not only overcome but to persevere.