New EU Regulation
Since 17.8.2015 the law of the state in which the decedent had his last habitual residence is applicable in matters of succession.
For example: If a Spanish citizen is living in Austria, Austrian law will be applicable in matters of succession, if she deceases. If an Austrian citizen is living in Spain, the Spanish laws will be applicable in case he deceases.
Options and Advantages of the New Regulation
There is the option to choose the law of succession of the state of your origin in your last will (testament or "agreement as to succession" - see article 3/1/(b) of Regulation No 650/2012; or see the full Regulation).
For example: A Spanish citizen who is living in Austria deceases. In her testament there is a clause, that only Spanish law of succession shall be applied. Therefore, only Spanish law applies to the matter of succession.
Finally it could be worthy of consideration to actively choose your habitual residence, taking into account the most suitable law of succession for your situation.