A powerful documentation viewer for html files generate by Sphinx, MkDocs, Docusaurus, or any static HTML files, with Vimium-C style keyboard navigation and fully customizable shortcuts.
- 🎯 Vim-style Navigation - Browse docs like a pro with keyboard shortcuts
- ⚙️ Fully Customizable - Configure all shortcuts via
.envfile - 🔗 Link Hints - Vimium-C style link selection
- 📝 Text Selection - Mouse drag and Ctrl+A/C always work
- 🌓 Dark Mode - Toggle with Alt+Shift+D
- 🔄 Two-key Commands - Support for
gg,gi,yy, etc. - ⚡ Smart Hints - Intelligent hint matching with timeout
pip install docvpip install pywebview envdot
# or
pip install -r requirements.txtpip install licface # For better color helper in terminal (optional)- Create
.envfile with your documentation directory or copy/rename .env.examples file:
DOCS_DIR=/path/to/your/docs- Run the viewer:
docs mydocsThis will open DOCS_DIR/mydocs/index.html
# View documentation
docs <path>
# View with custom window size
docs <path> --width 1200 --height 800
# Disable Vim mode
docs <path> --no-vim
# Show current shortcuts configuration
docs --show-config
# Debug mode
docs <path> --debug# Open mydocs docs
docs mydocs
# Open specific HTML file
docs path/to/file.html
# Multiple documentation directories (in .env)
DOCS_DIR=/path/to/docs1,/path/to/docs2,/path/to/docs3j- Scroll downk- Scroll uph- Scroll leftl- Scroll rightd- Page downu- Page upgg- Go to top (two-key command)G- Go to bottom
Shift+H- Go back in historyShift+L- Go forward in historyr- Reload pageq- Quit application
f- Show link hints (click in current tab)F- Show link hints (open in new tab)- Type hint letters to activate link
ESC- Cancel hint mode
yy- Copy current URL to clipboard (two-key command)gi- Focus first input field (two-key command)
Alt+Shift+D- Toggle dark modeESC- Cancel current action/clear buffer
- Mouse drag - Select text
- Ctrl+A / Cmd+A - Select all
- Ctrl+C / Cmd+C - Copy
- Shift+Arrow - Extend selection
- Double-click - Select word
- Triple-click - Select paragraph
- Right-click - Context menu (always enabled)
You can customize ALL shortcuts by adding VIM_* variables to your .env file.
VIM_SCROLL_DOWN=j # Default: j
VIM_SCROLL_UP=k # Default: k
VIM_SCROLL_LEFT=h # Default: h
VIM_SCROLL_RIGHT=l # Default: l
VIM_PAGE_DOWN=d # Default: d
VIM_PAGE_UP=u # Default: u
VIM_TOP=gg # Default: gg (two-key)
VIM_BOTTOM=G # Default: GVIM_BACK=H # Default: H (use with Shift)
VIM_FORWARD=L # Default: L (use with Shift)
VIM_RELOAD=r # Default: r
VIM_QUIT=q # Default: qVIM_HINTS=f # Default: f
VIM_HINTS_NEW_TAB=F # Default: FVIM_COPY_URL=yy # Default: yy (two-key)
VIM_FOCUS_INPUT=gi # Default: gi (two-key)VIM_SCROLL_STEP=60 # Pixels to scroll per j/k press
VIM_HINT_CHARS=asdfghjkl # Characters used for hints
VIM_BUFFER_TIMEOUT=1000 # Milliseconds to wait for second key
VIM_HINT_TIMEOUT=500 # Milliseconds to wait in hint mode
VIM_DARK_MODE_TOGGLE=D # Key for dark mode (with Alt+Shift)Create a .env file with your preferences:
# Documentation directories
DOCS_DIR=/home/user/docs,/opt/docs
# Custom Vim shortcuts - Use arrow keys instead of hjkl
VIM_SCROLL_DOWN=s
VIM_SCROLL_UP=w
VIM_PAGE_DOWN=x
VIM_PAGE_UP=e
# Custom two-key commands
VIM_TOP=gt # Type 'gt' to go to top
VIM_COPY_URL=cy # Type 'cy' to copy URL
VIM_FOCUS_INPUT=fi # Type 'fi' to focus input
# Different hint characters (home row only)
VIM_HINT_CHARS=asdfjkl
# Slower scrolling
VIM_SCROLL_STEP=40
# Faster buffer timeout
VIM_BUFFER_TIMEOUT=800Commands like gg, gi, and yy work as follows:
- Press first key (
g,y) - Status bar shows "Buffer: g"
- Press second key within timeout (default 1000ms)
- Command executes if valid, or buffer clears on timeout
Important: The system checks two-key commands BEFORE single-key commands, so gi will always trigger "focus input" rather than pressing g then i separately.
Inspired by Vimium-C:
- Press
fto enter hint mode - Yellow hints appear on all clickable elements
- Type hint letters to filter
- When only one match remains, it activates automatically
- If there's an exact match but also longer possibilities:
- Exact match turns red
- Wait 500ms for auto-activation, or
- Type more letters for longer hints
- Example: Hints
d,df,dkexist- Type
d→ Wait or typef/k - Type
d+ wait 500ms → Activatesd - Type
df→ Activatesdfimmediately
- Type
The app automatically enables text selection on every page. If it doesn't work:
- Check if the page has custom JavaScript blocking selection
- Try opening in
--debugmode to see console messages - Use
Ctrl+Aas fallback - this always works
- Make sure you're not in an input field (Vim mode is disabled in inputs)
- Check if modifier keys are pressed (Ctrl/Alt/Cmd disable Vim mode)
- Verify your
.envconfiguration with--show-config - Check console (F12) for error messages in debug mode
- The page may have no visible links
- Try pressing
fagain - Check
VIM_HINT_CHARSin your.envis valid
The app automatically enables right-click. If it's still disabled:
- The page may be re-disabling it with JavaScript
- Try in debug mode to see console messages
# .env file
DOCS_DIR=/docs/python,/docs/javascript,/docs/rustThen you can open docs from any of these directories:
docs requests # Looks in all three directories
docs axios
docs tokio# Open at specific position and size
docs flask --width 1200 --height 900 --x 100# Use as regular browser without Vim shortcuts
docs django --no-vim- Python Backend: Uses
pywebviewto create native window - JavaScript Frontend: Vim navigation injected into each page
- Configuration: Loaded via
envdotfrom.envfile - Event Handling: Uses event bubbling (not capture) to avoid conflicts
The app ensures text selection works by:
- NOT intercepting Ctrl/Cmd/Alt key combinations
- NOT intercepting Shift combos (except Shift+H/L for navigation)
- Using
stopPropagation()on selection events to prevent page blocking - Injecting CSS to force
user-select: texton all elements
- Uses standard Web APIs (no browser-specific code)
- Should work on any
pywebviewbackend (Qt, GTK, Edge, etc.) - Tested on Windows, Linux, macOS
Q: Why can't I select text after navigating to a new page?
A: The app reinjects the selection enabler on every page load. If it still doesn't work, the page might be using aggressive anti-selection JavaScript.
Q: Can I use Vim mode on any website?
A: Yes! While designed for local documentation, it works on any HTML file or website.
Q: Does it support Visual mode like Vim?
A: No, text selection is handled by the browser natively. Use mouse or Shift+arrows.
Q: Can I have more than two-key commands?
A: Currently limited to one and two-key commands. Three+ key commands would require significant changes.
Q: How do I reset to default shortcuts?
A: Remove all VIM_* variables from your .env file, or delete the .env file.
This project is licensed under the MIT License - see the LICENSE file for details.
Hadi Cahyadi - cumulus13@gmail.com
Found a bug or want a feature? Feel free to:
- Check existing issues
- Create detailed bug report
- Suggest improvements
