Skip to content

Feature Proposal: OmniSearch - Unified Browser Search with MRU Tabs #4818

@fcmiranda

Description

@fcmiranda

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:

  1. Tab switching is not optimized for recency - Results are ranked by relevancy, making it slower to switch back to recently used tabs
  2. Results are mixed together - Hard to distinguish between tabs, bookmarks, and history at a glance
  3. Bookmark folder paths are not searchable - Users who organize bookmarks hierarchically can't search by folder names
  4. No immediate results - Users must type before seeing any suggestions

Use Cases

  1. Quick tab switching: "I was just on that tab, let me get back to it" → MRU ordering makes this instant
  2. Organized bookmark users: "Where did I put that bookmark?" → Full path search helps find it
  3. Visual clarity: "Is this a tab I can switch to or a new page?" → Categorized results make this clear
  4. 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 tab

Feature 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:

  1. Tabs (highest priority - shown first)
  2. Top Sites
  3. Bookmarks
  4. 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

  1. Faster tab switching - MRU ordering means recent tabs are always at the top
  2. Better organization - Categorized results are easier to scan
  3. Powerful bookmark search - Find bookmarks by folder structure
  4. Immediate feedback - See results without typing
  5. Streamlined workflow - Close tabs without leaving the search interface

For the Codebase

  1. Minimal footprint - Single new completer class (~300 lines)
  2. Reuses existing infrastructure - Uses tabRecency, HistoryCache, existing bookmark traversal
  3. Non-breaking - Entirely additive, doesn't modify existing completers
  4. 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.activateOmniSearchInNewTab

Questions for Maintainers

  1. Would this feature be a good fit for Vimium's core functionality?
  2. Are there any concerns about the additional complexity or API usage?
  3. Should result limits be user-configurable via settings?
  4. 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:

  • OmniSearchCompleter class
  • MRU tab ordering
  • Top sites integration
  • Full-path bookmark search
  • Smart deduplication
  • Ctrl+D tab closing
  • Parallel data loading
  • Documentation

Related


I'm happy to discuss any aspects of this proposal or make adjustments based on feedback. Thank you for considering this feature!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions