API ReferenceKeyboard Shortcuts

Keyboard Shortcuts Reference

Complete reference for all keyboard shortcuts in Lokus. Shortcuts are customizable and work across macOS, Windows, and Linux with platform-appropriate modifiers.

Platform Modifiers

Lokus uses cross-platform modifier keys that adapt to your operating system:

ModifiermacOSWindows/Linux
CommandOrControl⌘ CmdCtrl
Control⌃ ControlCtrl
Alt / Option⌥ OptionAlt
Shift⇧ ShiftShift

File Operations

ActionShortcutDescription
Save FileCmd/Ctrl+SSave current file
New FileCmd/Ctrl+NCreate new file
New FolderCmd/Ctrl+Shift+NCreate new folder
PrintCmd/Ctrl+PPrint current file
Refresh FilesF5Refresh file tree

Edit Operations

ActionShortcutDescription
UndoCmd/Ctrl+ZUndo last action
RedoCmd/Ctrl+Shift+ZRedo last undone action
CutCmd/Ctrl+XCut selection
CopyCmd/Ctrl+CCopy selection
PasteCmd/Ctrl+VPaste from clipboard
Select AllCmd/Ctrl+ASelect all content
Find in NoteCmd/Ctrl+FOpen in-file search
Find and ReplaceCmd/Ctrl+HOpen find and replace

View Operations

ActionShortcutDescription
Toggle SidebarCmd/Ctrl+BShow/hide file sidebar
Zoom InCmd/Ctrl++Increase zoom level
Zoom OutCmd/Ctrl+-Decrease zoom level
Actual SizeCmd/Ctrl+0Reset zoom to 100%
Toggle FullscreenF11Enter/exit fullscreen
Toggle Split ViewCmd/Ctrl+\\Enable/disable split panes
Toggle Split DirectionCmd/Ctrl+Shift+\\Switch horizontal/vertical split
Reset Pane SizeCmd/Ctrl+Alt+\\Reset split pane sizes
Toggle Sync ScrollingCmd/Ctrl+Alt+SSync scroll in split view

Formatting

ActionShortcutDescription
BoldCmd/Ctrl+BMake text bold
ItalicCmd/Ctrl+IMake text italic
UnderlineCmd/Ctrl+UUnderline text
StrikethroughCmd/Ctrl+Shift+XStrike through text
Inline CodeCmd/Ctrl+EFormat as inline code
HighlightCmd/Ctrl+Shift+HHighlight text

Insert Operations

ActionShortcutDescription
Insert WikiLinkCmd/Ctrl+LOpen wikilink insert modal
Insert Inline MathCmd/Ctrl+MInsert inline math equation
Insert Math BlockCmd/Ctrl+Shift+MInsert block math equation
Insert TableCmd/Ctrl+Shift+TInsert table
Insert Code BlockCmd/Ctrl+Shift+CInsert code block
ActionShortcutDescription
Command PaletteCmd/Ctrl+KOpen command palette
Global SearchCmd/Ctrl+Shift+FOpen workspace search
Next TabCmd/Ctrl+Alt+→Switch to next tab
Previous TabCmd/Ctrl+Alt+←Switch to previous tab
Close TabCmd/Ctrl+WClose current tab
Reopen Closed TabCmd/Ctrl+Shift+TReopen last closed tab
Graph ViewCmd/Ctrl+Shift+GOpen graph view
Kanban BoardCmd/Ctrl+Shift+KOpen kanban board
New CanvasCmd/Ctrl+Shift+CCreate new canvas

Application

ActionShortcutDescription
Open PreferencesCmd/Ctrl+,Open preferences window
Keyboard Shortcuts HelpF1Show shortcuts help

Customizing Shortcuts

Via Preferences

  1. Open Preferences (Cmd/Ctrl+,)
  2. Navigate to Keyboard Shortcuts section
  3. Click on a shortcut to edit
  4. Press your desired key combination
  5. Click Save to apply

Via Configuration File

Edit the configuration file directly:

Location:

  • macOS: ~/Library/Application Support/com.lokus.app/config.json
  • Windows: %APPDATA%/com.lokus.app/config.json
  • Linux: ~/.config/com.lokus.app/config.json

Format:

{
  "shortcuts": {
    "save-file": "CommandOrControl+S",
    "new-file": "CommandOrControl+N",
    "command-palette": "CommandOrControl+K",
    "custom-action": "CommandOrControl+Shift+X"
  }
}

Programmatic API

import { setShortcut, resetShortcuts } from '@/core/shortcuts/registry';
 
// Set custom shortcut
await setShortcut('save-file', 'CommandOrControl+Alt+S');
 
// Reset all shortcuts to defaults
await resetShortcuts();

Shortcut Conflicts

System Shortcuts

Lokus avoids registering global shortcuts that conflict with system operations:

Never registered globally:

  • Cmd/Ctrl+C (Copy)
  • Cmd/Ctrl+V (Paste)
  • Cmd/Ctrl+X (Cut)
  • Cmd/Ctrl+A (Select All)
  • Cmd/Ctrl+Z (Undo)
  • Cmd/Ctrl+Shift+Z (Redo)

These shortcuts work within the app but don’t override system behavior.

Application Conflicts

If a shortcut conflicts with another application:

  1. Lokus shortcuts take precedence when app is focused
  2. System shortcuts always take precedence
  3. Custom shortcuts can override defaults

Resolving Conflicts

Change conflicting shortcut:

// Change command palette shortcut if Cmd+K conflicts
await setShortcut('command-palette', 'CommandOrControl+Shift+P');

Disable global shortcut:

{
  "shortcuts": {
    "action-id": null
  }
}

Platform-Specific Shortcuts

macOS

Additional macOS-specific shortcuts:

ActionShortcutDescription
Hide AppCmd+HHide Lokus window
Hide OthersCmd+Alt+HHide other apps
MinimizeCmd+MMinimize window
New WindowCmd+Shift+NOpen new window

Windows

Additional Windows-specific shortcuts:

ActionShortcutDescription
MinimizeWin+DownMinimize window
MaximizeWin+UpMaximize window
Close WindowAlt+F4Close application

Linux

Additional Linux-specific shortcuts:

ActionShortcutDescription
MinimizeAlt+F9Minimize window
MaximizeAlt+F10Maximize window
Close WindowAlt+F4Close application

Shortcut Cheat Sheet

Essential Shortcuts

Get Started:

  • Cmd/Ctrl+N - New file
  • Cmd/Ctrl+S - Save
  • Cmd/Ctrl+F - Find in note
  • Cmd/Ctrl+Shift+F - Search workspace

Navigation:

  • Cmd/Ctrl+K - Command palette
  • Cmd/Ctrl+W - Close tab
  • Cmd/Ctrl+Alt+→ - Next tab
  • Cmd/Ctrl+Alt+← - Previous tab

Formatting:

  • Cmd/Ctrl+B - Bold
  • Cmd/Ctrl+I - Italic
  • Cmd/Ctrl+L - Insert link
  • Cmd/Ctrl+E - Inline code

Advanced:

  • Cmd/Ctrl+Shift+G - Graph view
  • Cmd/Ctrl+\\ - Split view
  • F1 - Shortcuts help

Printable Reference

Download or print the keyboard shortcuts reference:

Accessibility

Keyboard Navigation

Lokus is fully keyboard accessible:

  • Tab - Navigate between UI elements
  • Shift+Tab - Navigate backwards
  • Enter - Activate buttons/links
  • Escape - Close dialogs/modals
  • Arrow Keys - Navigate lists and trees

Screen Reader Support

All shortcuts are announced by screen readers with descriptions.

Visual Indicators

  • Shortcut hints in tooltips
  • Active shortcuts highlighted in menus
  • Conflict warnings in preferences

Advanced Customization

Creating Custom Shortcuts

Define custom shortcuts for plugin actions:

import { ACTIONS } from '@/core/shortcuts/registry';
 
// Add custom action
ACTIONS.push({
  id: 'my-custom-action',
  name: 'My Custom Action',
  event: 'custom:action',
  default: 'CommandOrControl+Shift+X'
});
 
// Register shortcut
await registerGlobalShortcuts();
 
// Listen for event
window.addEventListener('custom:action', () => {
  console.log('Custom action triggered!');
});

Context-Specific Shortcuts

Some shortcuts behave differently based on context:

In Editor:

  • Cmd/Ctrl+B - Bold text
  • Cmd/Ctrl+K - Insert link or command palette

In Sidebar:

  • Enter - Open file
  • Delete - Delete file
  • F2 - Rename file

In Search:

  • Enter - Open result
  • Escape - Close search
  • Up/Down - Navigate results

Troubleshooting

Shortcuts Not Working

  1. Check if globally registered

    • Some shortcuts only work when app is focused
    • System shortcuts take precedence
  2. Verify no conflicts

    • Open Preferences → Keyboard Shortcuts
    • Look for warning icons
  3. Reset to defaults

    await resetShortcuts();
  4. Clear configuration cache

    • Quit Lokus
    • Delete config file
    • Restart app

Global Shortcuts Disabled

In development mode, global shortcuts are disabled by default to prevent conflicts.

Enable in development:

// src/core/shortcuts/registry.js
const DISABLE_GLOBAL_SHORTCUTS_IN_DEV = false;

Platform-Specific Issues

macOS:

  • Check System Preferences → Keyboard → Shortcuts
  • Ensure no conflicts with system shortcuts

Windows:

  • Check Windows keyboard settings
  • Disable gaming mode if shortcuts lag

Linux:

  • Check desktop environment shortcuts
  • May need to disable compositor shortcuts

Best Practices

Choosing Shortcuts

  1. Use standard patterns - Follow OS conventions
  2. Avoid system shortcuts - Don’t override Cmd+Q, Alt+F4
  3. Group related actions - Use similar patterns (Cmd+B, Cmd+I)
  4. Add Shift for variations - Cmd+T vs Cmd+Shift+T
  5. Test across platforms - Ensure shortcuts work on all OSes

Teaching Users

  1. Show shortcuts in tooltips
  2. Display in command palette
  3. Provide printable reference
  4. Offer interactive tutorial
  5. Highlight most-used shortcuts

Next Steps