Formal:
* Egotism: A strong sense of self-importance.
* Narcissism: Excessive admiration of oneself.
* Vanity: Excessive pride in one's appearance or accomplishments.
* Pride: A feeling of deep pleasure or satisfaction derived from one's achievements, qualities, or possessions.
* Braggadocio: Boastful or arrogant behavior.
Informal:
* Showboating: Acting in a flamboyant or attention-seeking way to impress others.
* Grandstanding: Acting in a way to attract attention or praise, especially by appealing to popular emotions.
* Blowing one's own trumpet: Boasting or bragging about oneself.
* Tooting one's own horn: Similar to "blowing one's own trumpet."
* Playing up to: Behaving in a way that is intended to impress someone.
The best word to use will depend on the specific context and the level of formality you require.