caret-navigation
Purpose
Explains the difference between “Move Caret to Page Bottom/Top” (visible area) vs “Move Caret to Text End/Start” (entire file) in WebStorm and other JetBrains IDEs on macOS.
Key Findings
- “Page” navigation moves within visible area only - not to file boundaries
- “Text Start/End” navigation moves to file boundaries - beginning or end of entire document
- Mac keyboards lack Home/End keys, requiring Fn-based shortcuts
- Different actions exist for line-level, page-level, and file-level navigation
The Confusion Explained
Why “Move Caret to Page Bottom” Doesn’t Go to End of File
Critical distinction:
“Move Caret to Page Bottom” only moves the caret to the bottom of the visible portion of the page. If the page is longer than what you can see in the window at that moment, it won’t reach the bottom of the file.
This is working as designed - “page” refers to the viewport (what’s currently visible), not the entire document.
Navigation Levels
WebStorm has THREE levels of caret navigation:
1. Line-Level Navigation
| Action | Mac Shortcut |
|---|---|
| Beginning of line | Fn + ← |
| End of line | Fn + → |
2. Page-Level Navigation (Visible Area)
| Action | Mac Shortcut |
|---|---|
| Top of visible page | Ctrl + Page Up or Fn + Cmd + ↑ |
| Bottom of visible page | Ctrl + Page Down or Fn + Cmd + ↓ |
These move only within what’s currently visible on screen.
3. File-Level Navigation (Entire Document)
| Action | Mac Shortcut | Keymap Action Name |
|---|---|---|
| Beginning of file | Fn + Cmd + ← or Cmd + Home | ”Move Caret to Text Start” |
| End of file | Fn + Cmd + → or Cmd + End | ”Move Caret to Text End” |
These move to the absolute start/end of the file.
Complete Keyboard Shortcuts Reference (Mac)
Basic Navigation
| Action | Shortcut | Notes |
|---|---|---|
| Beginning of line | Fn + ← | First character of current line |
| End of line | Fn + → | Last character of current line |
| Top of visible page | Ctrl + Page Up | Top of viewport |
| Bottom of visible page | Ctrl + Page Down | Bottom of viewport |
| Beginning of file | Fn + Cmd + ← | First line of document |
| End of file | Fn + Cmd + → | Last line of document |
With Selection (Add Shift)
Adding Shift to any navigation shortcut selects text from current position to target:
| Action | Shortcut |
|---|---|
| Select to line start | Shift + Fn + ← |
| Select to line end | Shift + Fn + → |
| Select to file start | Shift + Fn + Cmd + ← |
| Select to file end | Shift + Fn + Cmd + → |
Keymap action name: “Move Caret to Text End/Start with Selection”
Alternative: Go to Line
If you don’t have Home/End keys or shortcuts aren’t working:
Cmd + GOpens “Go to Line” dialog:
- Enter
1for beginning of file - Enter last line number for end of file
Why Mac Keyboards Are Different
Mac keyboards (especially MacBook) lack dedicated Home/End keys, requiring:
Fnkey combinations to emulate missing keys- Different muscle memory than Windows/Linux
Default WebStorm shortcuts assume:
Cmd + Homefor file startCmd + Endfor file end
But without physical Home/End keys, you must use:
Fn + Cmd + ←(emulates Cmd+Home)Fn + Cmd + →(emulates Cmd+End)
Customizing Shortcuts
Opening Keymap Settings
Cmd + , (Settings)→ KeymapOr:
Ctrl + Alt + S (on Mac: Cmd + ,)→ KeymapFinding Actions to Remap
Search for these action names in Keymap settings:
| Action Name | Default Mac Shortcut |
|---|---|
| Move Caret to Text Start | Cmd + Home or Fn + Cmd + ← |
| Move Caret to Text End | Cmd + End or Fn + Cmd + → |
| Move Caret to Text Start with Selection | Shift + Cmd + Home |
| Move Caret to Text End with Selection | Shift + Cmd + End |
| Move Caret to Page Top | Ctrl + Page Up |
| Move Caret to Page Bottom | Ctrl + Page Down |
Recommended Custom Shortcuts
If the default Fn + Cmd + ←/→ feels awkward, consider remapping to:
Cmd + ↑for file start (may conflict with “Move Caret to Page Top”)Cmd + ↓for file end (may conflict with “Move Caret to Page Bottom”)
Trade-off: Easier file navigation but loses page-level shortcuts.
Common Issues
Issue: Shortcut Does Nothing
Possible causes:
- Keymap conflict - another action is using the same shortcut
- “Fn” key not working - check System Settings > Keyboard
- External keyboard may have different key layout
Solution:
Settings (Cmd + ,) → Keymap→ Search for "Move Caret to Text Start"→ Check assigned shortcuts→ Add new shortcut if neededIssue: Goes to Wrong Location
Check which action you’re using:
- Page Bottom = bottom of visible area (viewport)
- Text End = end of file
Use Fn + Cmd + → for true end-of-file navigation.
Issue: Fn Key Not Working
macOS System Settings:
System Settings→ Keyboard→ Keyboard Shortcuts→ Function Keys→ Ensure "Use F1, F2, etc. as standard function keys" is configured correctlyQuick Reference Card
Print-friendly cheat sheet:
╔════════════════════════════════════════════════╗║ WebStorm Caret Navigation (Mac) ║╠════════════════════════════════════════════════╣║ Line Start: Fn + ← ║║ Line End: Fn + → ║║ Page Top: Ctrl + Page Up ║║ Page Bottom: Ctrl + Page Down ║║ File Start: Fn + Cmd + ← ║║ File End: Fn + Cmd + → ║║ ║║ Add Shift to any shortcut to SELECT text ║║ ║║ Alternative: Cmd + G (Go to Line) ║╚════════════════════════════════════════════════╝Sources
- Keyboard Shortcut - Select text to the beginning/end of document - JetBrains Support
- How to move cursor to top of document on MacBook Pro - JetBrains Support
- Configure keyboard shortcuts - WebStorm Documentation
- Predefined macOS keymap - IntelliJ IDEA Documentation
- WebStorm keyboard shortcuts - WebStorm Documentation