> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/sinelaw/fresh/llms.txt
> Use this file to discover all available pages before exploring further.

# Navigation

> Master code navigation in Fresh with go to line, word movement, bookmarks, position history, and split views

Fresh provides powerful navigation features to help you move quickly through your codebase, whether you're working with small files or multi-gigabyte documents.

## Basic Navigation

### Cursor Movement

Navigate through your code with these essential shortcuts:

| Shortcut            | Action                                                     |
| ------------------- | ---------------------------------------------------------- |
| `←` `→` `↑` `↓`     | Move cursor by character/line                              |
| `Ctrl+←` / `Ctrl+→` | Move by word                                               |
| `Home`              | Toggle between first non-whitespace character and column 0 |
| `End`               | Move to end of line                                        |
| `Ctrl+Home`         | Move to start of document                                  |
| `Ctrl+End`          | Move to end of document                                    |
| `PgUp` / `PgDn`     | Move up/down by page                                       |

<Tip>
  The **Home** key is "smart" — it toggles between the first non-whitespace character and column 0, making indented code navigation more efficient.
</Tip>

### Go to Line

Jump directly to any line number:

<Steps>
  <Step title="Open Go to Line">
    Press `Ctrl+G` or open the command palette (`Ctrl+P`) and type `:`
  </Step>

  <Step title="Enter line number">
    Type the line number and press Enter
  </Step>

  <Step title="Jump">
    The cursor moves to the beginning of that line
  </Step>
</Steps>

<Tip>
  **Command Palette Shortcut**: Type `:` in the command palette (`Ctrl+P`) to quickly access Go to Line mode.
</Tip>

## Position History

Fresh automatically tracks your cursor positions as you navigate and edit, allowing you to move backward and forward through your navigation history — similar to a web browser.

| Shortcut | Action                      |
| -------- | --------------------------- |
| `Alt+←`  | Navigate back in history    |
| `Alt+→`  | Navigate forward in history |

### How Position History Works

<Accordion title="When is a position recorded?">
  Fresh records your position in these scenarios:

  * When you jump to a different location (go to definition, search results, etc.)
  * When you move more than a few lines away from your current position
  * When you switch to a different file
  * When you make an edit

  This ensures the history contains meaningful navigation points, not every arrow key press.
</Accordion>

<Steps>
  <Step title="Work normally">
    Edit files, jump to definitions, search for text, switch between files
  </Step>

  <Step title="Navigate back">
    Press `Alt+←` to return to your previous position
  </Step>

  <Step title="Navigate forward">
    Press `Alt+→` to move forward in history
  </Step>
</Steps>

<Note>
  Position history works across files — you can navigate back to a position in a different file.
</Note>

## Bookmarks

Set bookmarks to quickly jump between important locations in your code:

| Shortcut         | Action                               |
| ---------------- | ------------------------------------ |
| `Ctrl+Shift+0-9` | Set bookmark 0-9 at current position |
| `Alt+0-9`        | Jump to bookmark 0-9                 |

### Bookmark Workflow

<Steps>
  <Step title="Set bookmark">
    Position your cursor at an important location and press `Ctrl+Shift+5` (for bookmark 5)
  </Step>

  <Step title="Work elsewhere">
    Navigate to other parts of the file or even other files
  </Step>

  <Step title="Jump back">
    Press `Alt+5` to instantly return to bookmark 5
  </Step>

  <Step title="List bookmarks">
    Use "List Bookmarks" from the command palette to see all set bookmarks
  </Step>
</Steps>

### Advanced Bookmark Commands

Access these from the command palette (`Ctrl+P`):

<CardGroup cols={3}>
  <Card title="Set Bookmark" icon="bookmark">
    Set a bookmark at the current cursor position (prompts for 0-9)
  </Card>

  <Card title="Jump to Bookmark" icon="location-dot">
    Jump to a previously set bookmark (prompts for 0-9)
  </Card>

  <Card title="List Bookmarks" icon="list">
    View all bookmarks across all open files
  </Card>
</CardGroup>

<Note>
  Bookmarks are saved in your workspace session and persist when you close and reopen Fresh.
</Note>

## Bracket Navigation

Quickly jump between matching brackets, braces, and parentheses:

<Steps>
  <Step title="Position cursor">
    Place your cursor on an opening or closing bracket: `(`, `)`, `{`, `}`, `[`, `]`
  </Step>

  <Step title="Open command palette">
    Press `Ctrl+P` and search for "Go to Matching Bracket"
  </Step>

  <Step title="Jump">
    The cursor jumps to the matching bracket
  </Step>
</Steps>

<Tip>
  Matching brackets are highlighted automatically when your cursor is near them. You can disable this with the `highlight_matching_brackets` setting.
</Tip>

## Error Navigation

When working with LSP-enabled languages, quickly jump between errors and diagnostics:

| Shortcut   | Action                            |
| ---------- | --------------------------------- |
| `F8`       | Jump to next error/diagnostic     |
| `Shift+F8` | Jump to previous error/diagnostic |

<Note>
  Error navigation requires an active LSP server. See the [LSP Configuration](/features/lsp) guide for setup instructions.
</Note>

## Large File Navigation

Fresh handles large files (multi-gigabyte) with minimal memory overhead. When you open a large file, Fresh shows **byte offsets** instead of line numbers for performance.

### Working with Large Files

<Steps>
  <Step title="Open large file">
    Fresh automatically detects large files and uses byte offset mode
  </Step>

  <Step title="Scan for line numbers (optional)">
    If you need exact line numbers, use "Go to Line" from the command palette — Fresh will offer to scan the file
  </Step>

  <Step title="Wait for scan">
    Only the line index is kept in memory, not the file contents. Over SSH, the scan runs server-side.
  </Step>
</Steps>

<Tip>
  You can manually trigger line scanning with "Scan Line Index" from the command palette.
</Tip>

## Split Views

Work with multiple files (or the same file) side-by-side:

### Split View Commands

All split commands are available from the command palette (`Ctrl+P`):

<CardGroup cols={2}>
  <Card title="Split Vertical" icon="grip-lines-vertical">
    Create a vertical split (side-by-side panes)
  </Card>

  <Card title="Split Horizontal" icon="grip-lines">
    Create a horizontal split (top and bottom panes)
  </Card>

  <Card title="Next Split" icon="arrow-right">
    Move focus to the next split pane
  </Card>

  <Card title="Previous Split" icon="arrow-left">
    Move focus to the previous split pane
  </Card>

  <Card title="Close Split" icon="xmark">
    Close the current split pane
  </Card>

  <Card title="Toggle Maximize" icon="maximize">
    Maximize/restore the current split pane
  </Card>
</CardGroup>

### Split View Workflow

<Steps>
  <Step title="Create split">
    Open command palette and select "Split Vertical" or "Split Horizontal"
  </Step>

  <Step title="Open files">
    Each split can have its own file (or the same file for comparison)
  </Step>

  <Step title="Navigate between splits">
    Use "Next Split" / "Previous Split" or click with the mouse
  </Step>

  <Step title="Close when done">
    Use "Close Split" to remove the current pane
  </Step>
</Steps>

<Tip>
  **Comparing Changes**: Open the same file in both splits to compare different sections or edits.
</Tip>

### Scroll Sync

When viewing the same buffer in multiple splits, you can synchronize scrolling:

<Steps>
  <Step title="Open same file in splits">
    Create a split and open the same file in both panes
  </Step>

  <Step title="Enable scroll sync">
    Open command palette and search for "Toggle Scroll Sync"
  </Step>

  <Step title="Scroll together">
    Both panes now scroll in unison
  </Step>
</Steps>

<Note>
  Scroll sync only works when the same buffer is open in multiple splits. Each split maintains its own cursor and fold state.
</Note>

## LSP-Powered Navigation

When working with LSP-enabled languages, you get IDE-level navigation:

<CardGroup cols={2}>
  <Card title="Go to Definition" icon="diamond-turn-right">
    Jump to where a symbol is defined
  </Card>

  <Card title="Find References" icon="magnifying-glass">
    Find all usages of a symbol
  </Card>

  <Card title="Go to Type Definition" icon="cube">
    Jump to the type definition of a symbol
  </Card>

  <Card title="Go to Implementation" icon="code">
    Find implementations of an interface or trait
  </Card>
</CardGroup>

<Steps>
  <Step title="Position cursor">
    Place cursor on a function name, variable, type, etc.
  </Step>

  <Step title="Open command palette">
    Press `Ctrl+P` and type `>` to enter command mode
  </Step>

  <Step title="Search for command">
    Type "Go to Definition" or "Find References"
  </Step>

  <Step title="Navigate">
    Fresh jumps to the definition or shows a list of references
  </Step>
</Steps>

<Note>
  LSP navigation requires a language server. See [LSP Configuration](/features/lsp) for supported languages and setup.
</Note>

## Fuzzy Finding

Quickly find and open files with fuzzy matching:

<Steps>
  <Step title="Open command palette">
    Press `Ctrl+P` (opens in file finder mode by default)
  </Step>

  <Step title="Type to search">
    Type parts of the filename — space-separated terms match independently
  </Step>

  <Step title="Select and open">
    Use arrow keys to select a file and press Enter to open it
  </Step>
</Steps>

<Tip>
  **Fuzzy Matching Example**: Typing `feat group` matches `features/groups/view.tsx` because both "feat" and "group" appear in the path.
</Tip>

See the [Command Palette](/features/command-palette) guide for more details.

## File Explorer Navigation

Browse your project structure with the built-in file explorer:

| Shortcut     | Action                                        |
| ------------ | --------------------------------------------- |
| `Ctrl+B`     | Toggle file explorer visibility               |
| `Ctrl+E`     | Switch focus between file explorer and editor |
| `↑` / `↓`    | Navigate up/down in file tree                 |
| `Enter`      | Open selected file (keeps focus on explorer)  |
| Double-click | Open file and focus editor                    |

<Note>
  The file explorer respects your `.gitignore` file by default. Use "Toggle Gitignored Files" from the command palette to show ignored files.
</Note>

See the [File Explorer](/features/file-explorer) guide for detailed usage.

## Navigation Tips

<AccordionGroup>
  <Accordion title="Combine navigation methods for efficiency">
    Use position history (`Alt+←`) after jumping to definitions or search results to quickly return to where you were. Set bookmarks at key locations before exploring unfamiliar code.
  </Accordion>

  <Accordion title="Use splits for reference">
    Open documentation or related code in a split while working in the main pane. This is especially useful when implementing interfaces or following patterns from existing code.
  </Accordion>

  <Accordion title="Leverage fuzzy finding">
    The fuzzy file finder (`Ctrl+P`) is often faster than navigating the file tree. Just type a few characters of the filename.
  </Accordion>
</AccordionGroup>

## Related Documentation

<CardGroup cols={3}>
  <Card title="Command Palette" icon="terminal" href="/features/command-palette">
    Quick access to all commands and files
  </Card>

  <Card title="File Explorer" icon="folder-tree" href="/features/file-explorer">
    Browse your project structure
  </Card>

  <Card title="LSP Features" icon="server" href="/features/lsp">
    IDE-level code intelligence
  </Card>
</CardGroup>
