1、首先打开as:File-->Settings...
2、Editor-->General-->Appearence
3、右边show line numbers
4、依次点击apply、OK
5、完成