Complete Guide to Keyboard Shortcuts in Zakirullin Files Web App
Zakirullin Files provides comprehensive keyboard shortcuts including ⌘P for search, ⌘N for new files, ⌘D for deletion, and text commands like "jj" for journal entries, all implemented across web/app.js and server/bot.go.
The Zakirullin Files web app is an open-source markdown-based file manager that prioritizes keyboard-driven workflows. Understanding the available keyboard shortcuts in the Zakirullin Files web app can significantly speed up navigation, file management, and journaling tasks. This guide covers every shortcut mapped in the client-side JavaScript and server-side Go code.
UI Navigation and File Management Shortcuts
All primary interface shortcuts are defined in web/app.js and use the isMetaKey() helper to ensure cross-platform compatibility between macOS (⌘), Windows, and Linux (Ctrl/Alt).
Window and Sidebar Controls
-
⌘W (or CtrlW): Hides the secondary editor pane by invoking
hideEditor2(). Implemented at lines 703-705. -
⌘~ or ⌘§: Toggles the sidebar visibility (lines 790-797).
File Operations
-
⌘N: Creates a new file via
newFile(). Add Shift to create a new folder usingnewFolder()instead (lines 735-745). -
⌘D: Deletes the currently opened file by calling
removeCurrentFile()(lines 728-733).
Modal and Search Shortcuts
-
⌘P or ⌘K: Opens the Search modal and focuses the search input (lines 707-714).
-
⌘M: Opens the Move modal, focusing the move-input field for quick file relocation (lines 721-726).
Chat and Editor Interface Shortcuts
Chat Panel Controls
-
Esc: Context-aware behavior—closes the chat panel if open, deselects messages if selected, or otherwise hides the secondary editor (lines 749-775).
-
⌘Enter: Opens the chat view directly (lines 798-800).
-
⌘ShiftEnter: Toggles the chat modal state (opens if closed, closes if open) (lines 779-788).
Visual Feedback System
When any meta key (⌘, Ctrl, or Alt) is held down, the application adds the cmd-pressed CSS class to the <body> element for visual feedback (lines 802-807). This is handled by the isMetaKey(event) function used throughout the event listeners.
Text Command Shortcuts for Journal and Recent Files
Beyond traditional hotkeys, Zakirullin Files implements textual shortcuts processed server-side in server/bot.go. These allow quick command entry by typing specific character sequences.
The shortcut mappings are defined in the Shortcuts map at lines 200-205:
var Shortcuts = map[string][]string{
CmdAddToJournalShortcut: {"/ж", "jj", "жж"},
CmdAddToJournalAndContinueShortcut: {"жд", "jd", "ja"},
CmdAddToRecentFileShortcut: {"++"},
}
Journal Entry Shortcuts
-
/ж,jj, orжж: Expands to thejcommand, creating a new journal entry. -
/жд,jd, orja: Expands to thejacommand, adding a journal entry while keeping the editor focused for continued writing.
Recent File Shortcuts
++: Expands to the+command, adding the current file to the "Recent" list for quick access later.
Source Code Architecture
The shortcut system spans two main components:
-
Client-side (
web/app.js): Handles global hotkeys using standard JavaScript event listeners. TheisMetaKey()helper normalizes cross-platform modifier keys (Meta, Ctrl, Alt). -
Server-side (
server/bot.go): Parses text input for command shortcuts after messages are sent. This allows for contextual commands that operate on the current file or journal state.
Summary
- Navigation: Use ⌘P for search, ⌘M for move operations, and ⌘~ to toggle the sidebar.
- File Management: Create files with ⌘N, folders with ⌘ShiftN, and delete with ⌘D.
- Chat Interface: Toggle chat with ⌘ShiftEnter, open with ⌘Enter, and use Esc for context-aware closing.
- Text Commands: Type
jjto add journal entries,jato continue journaling, or++to bookmark recent files. - Cross-platform: All shortcuts support macOS (⌘), Windows, and Linux (Ctrl/Alt) through the
isMetaKey()abstraction inweb/app.js.
Frequently Asked Questions
Do these keyboard shortcuts work on Windows and Linux?
Yes. The application uses an isMetaKey(event) helper function in web/app.js that treats ⌘ (Meta), Ctrl, and Alt as command keys, ensuring shortcuts work across macOS, Windows, and Linux operating systems.
How do I create a new folder instead of a new file?
Press ⌘ShiftN (hold Shift while pressing the new file shortcut). This triggers newFolder() instead of newFile(), as implemented in web/app.js lines 740-743.
What happens when I press the Escape key?
The Escape key behavior is context-aware. According to web/app.js lines 749-775, it first checks if the chat panel is open and closes it, then checks if a message is selected and deselects it, and finally falls back to hiding the secondary editor pane.
Where are the "jj" and "++" text shortcuts processed?
These text commands are processed server-side in server/bot.go at lines 200-205. When you type these sequences and send the message, the backend bot matches them against the Shortcuts map and executes the corresponding journal or recent-file commands.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →