Haskell for Mac features a range of keyboard shortcuts that help you move around a project without taking your hands of the keyboard. This article summarises those shortcuts. (For an overview over the terminology used to name the components of the app, please have a look at The Anatomy of Haskell for Mac.)
Moving focus between areas
To move between the three areas of Haskell for Mac (project navigator, module editor, and playground), use the following shortcuts:
- ⌥⌘` and ⌥⇧⌘` — move focus to the next and previous area (same as Xcode)
- ⌥⌘J — move focus to the module editor
- ⌥⇧⌘P — re-execute the code in the playground and move the focus to the playground
Moving between files
While the focus is in the project navigator, the arrow keys move around the various files as usual. However when the focus is in the editor or playground, you can move through the file list as follows:
- ⌥⌘↑ and ⌥⌘↓ — move up and down in the list of files
Hiding and showing areas
The visibility of each of the three areas can be toggled with one shortcut each:
- ⌘0 — hide and show the project navigator (same as Xcode)
- ⌥⌘E — hide and show the module editor
- ⌥⌘P — hide and show the playground
In addition to these three shortcuts, we also have got the following:
- ⌥⌘→ and ⌥⌘← — hide or reveal areas on the left and right side of the window
- ⌥⇧⌘P — ensure the playground is visible and re-execute the code
Please keep in mind that the project navigator can only be visible if the module editor is also visible; that is, if both are hidden and you reveal the project navigator, the module editor will be revealed, too.
2 Comments