diff --git a/bangs.yaml b/bangs.yaml index 281a87b..1a88ab6 100644 --- a/bangs.yaml +++ b/bangs.yaml @@ -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 @@ -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 @@ -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={}' @@ -439,4 +445,3 @@ Thangs: url: 'https://thangs.com/search/{}' description: 'Search engine for 3D models' category: '3D Printing' - diff --git a/pkg/bangs/registry_test.go b/pkg/bangs/registry_test.go index 0d05194..aaa4283 100644 --- a/pkg/bangs/registry_test.go +++ b/pkg/bangs/registry_test.go @@ -7,6 +7,7 @@ import ( "net/http" "net/http/httptest" "os" + "path/filepath" "strings" "testing" ) @@ -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)