The subject is full of oxymorons. The Scots want to be free of the English but are desperate to stay in the EU. I've never got that. I can understand them feeling disenfranchised, now more than ever, but to them be happy to be to be partly governed by people even less close (in many ways) strikes me as odd.
These are two separate but interlinked issues. Scotland is at odds with Westminster because the direction that Westminster takes is not perceived as right for Scotland, and hasn't since the 1950s.
Scotland wants to be part of the EU because it has a long tradition of trading with Europe, and a wholly different mindset to England and Wales in this respect. Where England fought wars with France and Spain, these were Scotland's allies and trading partners. Since the financial services business is so important to Scotland (as well as the City of London) it's not surprising that Scots want to stay in the EU. The linking is because the majority of England's voters voted for Brexit, taking Scotland out regardless. This is the peril of being a smaller part of a bigger entity.