President Trump is recasting the role of wartime leader in his image, breaking from generations of practice as he attacks his domestic enemies and revels in memes.