Enea Bastianini will start the Portuguese MotoGP from pole after narrowly getting the better of Maverick Vinales and Jorge Martin in Q2.