IntelliJ beginning of file keyboard shortcut
On Mac, command+home and command+end move to the top and bottom of the file.
On a Mac laptop, there are no home or end keys. Many key combinations with option/function keys produce missing keys and do other neat things. For instance, using function+left and function+right will provide windows-style home and end behaviour while function+up and function+down will provide page up and page down behaviour. Superuser has more information.
Also, if you open the Keyboard
preferences pane and look at the Input Sources
tab, you will find that the displayed keyboard changes as you press modifier keys such shift, option and function. Your keyboard probably does way more than you thought.
command+home or fn+command+left arrow
Edit the Intellij Preferences -> KeyMap -> Editor Actions entries for "Move Caret to Text Start" and "Move Caret to Text End". If you set those to Command+UpArrow and Command+DownArrow, it'll work like a normal text editor. I have no idea why that isn't the default in Intellij instead of the seemingly pointless "scroll one line" feature.