The announcement comes less than 24 hours after the 24-year-old made his 100th appearance for Glasgow in the 22-5 European Champions Cup win over Racing 92 at Rugby Park.
The former Cambuslang player has signed a two-year contract with Edinburgh.
Weir said: "It was a very difficult decision to leave Glasgow Warriors, a club I've supported since I was a teenager.
"It'll be a new challenge for me at BT Murrayfield after six years at the Warriors, and when the time comes I'll move on with a number of good memories from my time in Glasgow.
"The highlight has obviously been winning the Guinness Pro12 last season, but there is still a lot of rugby to be played this season and my aim is to end my time at Scotstoun on a high."
Weir revealed the chance to work with Edinburgh assistant coach Duncan Hodge, the former Scotland fly-half, was a major attraction in moving east.
He said: "It does help the transition, knowing a number of the Edinburgh players from Scotland duty and, for much of that time, having worked with Hodgey.
"That was a key part of making the move over. I've known Hodgey for close to 10 years now, I have a really good relationship with him, he's a great guy and a good Edinburgh man.
"I'm really looking forward to working alongside him - as a 10 I'm still pretty young at 24 so I still want to develop and work on all aspects of my game."
Edinburgh head coach Alan Solomons said: "It is a real boost for the club that Duncan has decided to join us.
"He is a quality player who has proven himself at international level.
"I have no doubt that he will add huge value to the team and I look forward to working with him."
Glasgow Warriors head coach Gregor Townsend said: "Duncan has been outstanding for us over the last few years.
"He's had to go through some tough times with injuries, but he always brings enthusiasm to training and he's playing some really good rugby.
"It'll be tough for us to go up against him next season, but he wants to fight for the stand-off position at Edinburgh and we wish him all the best when he leaves."