Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions bangs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# default: 'https://www.google.com/search?q={}'

# Single bang reference:
default: 'sp'
default: 'kagi'

# Multi-bang reference (opens multiple tabs):
# default: 'ai+g' # AI search + Google
Expand All @@ -16,7 +16,7 @@ default: 'sp'
# Aliases - Custom shortcuts for single bangs or multi-bang combinations
# ================================================================================
aliases:
def: 'ai+sp' # Default search: AI + Google
def: 'ai+kagi' # Default search: AI + Kagi
search: 'g' # Simple search alias for Google
shop: 'a+eb' # Shopping: Amazon + eBay

Expand All @@ -35,6 +35,12 @@ StartPage:
description: 'Anonymous search engine based on Google'
category: 'Search'

Kagi:
bang: 'kagi'
url: 'https://kagi.com/search?q={}'
description: 'Premium privacy-focused search engine'
category: 'Search'

Bing:
bang: 'b'
url: 'https://www.bing.com/search?q={}'
Expand Down Expand Up @@ -439,4 +445,3 @@ Thangs:
url: 'https://thangs.com/search/{}'
description: 'Search engine for 3D models'
category: '3D Printing'

25 changes: 25 additions & 0 deletions pkg/bangs/registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"net/http"
"net/http/httptest"
"os"
"path/filepath"
"strings"
"testing"
)
Expand Down Expand Up @@ -341,6 +342,30 @@ func TestBangList_PrepareInput_WithAliases(t *testing.T) {
}
}

func TestLoad_ProjectRegistryIncludesKagiAsDefault(t *testing.T) {
err := Load(filepath.Join("..", "..", "bangs.yaml"))
if err != nil {
t.Fatalf("failed to load project registry: %v", err)
}

if registry.Default != QueryURL("kagi") {
t.Fatalf("expected default bang to be kagi, got %q", registry.Default)
}

entry, ok := registry.Entries.byBang["kagi"]
if !ok {
t.Fatal("expected Kagi bang to be present in project registry")
}

if entry.URL != QueryURL("https://kagi.com/search?q={}") {
t.Fatalf("expected Kagi URL to be configured, got %q", entry.URL)
}

if entry.Category != "Search" {
t.Fatalf("expected Kagi category to be Search, got %q", entry.Category)
}
}

func BenchmarkPrepareInputPreComp(b *testing.B) {
for _, size := range sizes {
bl := generateRandomBangs(size)
Expand Down
Loading