Tools -> Editor Options -> Auto Indent.