-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
I'd like to propose adding an OmniSearch feature to Vimium - a new vomnibar mode that provides a unified, categorized search experience across tabs, top sites, bookmarks, and history with Most Recently Used (MRU) tab ordering.
This feature is inspired by the OmniSearch functionality in Surfing Keys and addresses common use cases where users want quick access to recent tabs and better organized search results.
Motivation
Current Limitations
The existing Vomnibar.activate (omni) command works well for general searches, but has some limitations:
- Tab switching is not optimized for recency - Results are ranked by relevancy, making it slower to switch back to recently used tabs
- Results are mixed together - Hard to distinguish between tabs, bookmarks, and history at a glance
- Bookmark folder paths are not searchable - Users who organize bookmarks hierarchically can't search by folder names
- No immediate results - Users must type before seeing any suggestions
Use Cases
- Quick tab switching: "I was just on that tab, let me get back to it" → MRU ordering makes this instant
- Organized bookmark users: "Where did I put that bookmark?" → Full path search helps find it
- Visual clarity: "Is this a tab I can switch to or a new page?" → Categorized results make this clear
- Speed: "Show me my options immediately" → Results appear on vomnibar open
Proposed Solution
New Commands
Vomnibar.activateOmniSearch // Open in current tab
Vomnibar.activateOmniSearchInNewTab // Open in new tabFeature Comparison
| Feature | Standard Omni (o) |
OmniSearch |
|---|---|---|
| Result Ordering | Mixed by relevancy | Grouped by category |
| Tab Sorting | By relevancy | By Most Recently Used |
| Bookmark Search | Title + URL | Full folder path + title + URL |
| Top Sites | Not included | Included |
| Immediate Results | No | Yes (on vomnibar open) |
| Tab Closing | Not supported | Ctrl+D to close selected tab |
Architecture
┌─────────────────────────────────────────────────────────────┐
│ OmniSearchCompleter │
├─────────────────────────────────────────────────────────────┤
│ │
│ Promise.all([ │
│ tabs.query() + tabRecency, │
│ topSites.get(), │
│ HistoryCache.onLoaded(), │
│ loadBookmarks() │
│ ]) │
│ │ │
│ ▼ │
│ ┌───────────────────────────────────────────────────┐ │
│ │ Deduplication Pipeline │ │
│ │ tabs → topSites → bookmarks → history │ │
│ └───────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌───────────────────────────────────────────────────┐ │
│ │ Final Results (4 per category, 10 total max) │ │
│ └───────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
Key Implementation Details
1. MRU Tab Ordering
getTabsWithMRU(tabs, queryTerms, bookmarksMap) {
// Sort by recency (most recent first)
const sortedTabs = tabs.sort((a, b) => {
const recencyA = bgUtils.tabRecency.recencyScore(a.id);
const recencyB = bgUtils.tabRecency.recencyScore(b.id);
return recencyB - recencyA;
});
// ... filter and return
}2. Full-Path Bookmark Search
Bookmarks are indexed with their full folder path:
Work / Projects / Vimium / GitHub
Users can search by any part: "Work", "Projects", "Vimium", etc.
3. Smart Deduplication
URLs are deduplicated in priority order:
- Tabs (highest priority - shown first)
- Top Sites
- Bookmarks
- History (lowest priority)
4. Parallel Data Loading
All data sources are fetched concurrently using Promise.all() for optimal performance.
5. Tab Closing from Vomnibar
Users can press Ctrl+D to close a selected tab without leaving the vomnibar.
Configuration
| Setting | Default | Description |
|---|---|---|
omniSearchMaxResultsPerCategory |
4 | Max results per category |
omniSearchMaxResults |
10 | Max total results |
Benefits
For Users
- Faster tab switching - MRU ordering means recent tabs are always at the top
- Better organization - Categorized results are easier to scan
- Powerful bookmark search - Find bookmarks by folder structure
- Immediate feedback - See results without typing
- Streamlined workflow - Close tabs without leaving the search interface
For the Codebase
- Minimal footprint - Single new completer class (~300 lines)
- Reuses existing infrastructure - Uses
tabRecency,HistoryCache, existing bookmark traversal - Non-breaking - Entirely additive, doesn't modify existing completers
- Well-tested patterns - Follows established completer patterns
Example Usage
# Map 't' for quick tab/search access
map t Vomnibar.activateOmniSearch
# Map 'T' for opening in new tab
map T Vomnibar.activateOmniSearchInNewTabQuestions for Maintainers
- Would this feature be a good fit for Vimium's core functionality?
- Are there any concerns about the additional complexity or API usage?
- Should result limits be user-configurable via settings?
- Any preferences on the default key mapping?
Implementation Status
I have a working implementation in my fork that I'd be happy to submit as a PR if there's interest. The implementation includes:
-
OmniSearchCompleterclass - MRU tab ordering
- Top sites integration
- Full-path bookmark search
- Smart deduplication
- Ctrl+D tab closing
- Parallel data loading
- Documentation
Related
- Inspired by Surfing Keys OmniSearch
- Related issue: (link to any related issues if applicable)
I'm happy to discuss any aspects of this proposal or make adjustments based on feedback. Thank you for considering this feature!