Files
iris-context/internal/config/defaults.go
Kenny B 0b2221d5e9 feat(cd): optionally complete from zoxide's database
`cd` completes from FileGenerator, which reads one directory: the one you
are standing in. So `cd proj` only ever resolves when proj happens to be
a child of the current directory, and returns nothing at all otherwise --
including for directories visited constantly. That is the opposite of
what cd is normally reached for, and it reads as completion being broken
rather than as a scope limit.

zoxide.extend-cd routes `cd` through the generator `z` already uses, so
local children are offered first and zoxide's frecency database fills in
everything else, reachable by name from anywhere.

Off by default: it shells out to zoxide, and offering absolute paths from
outside the current directory is a real change in what `cd` proposes.

The query is also cached for two seconds. Generators run on every
keystroke and `zoxide query -l` is a subprocess costing ~11ms here, which
is the whole redraw budget; the list only changes when the user changes
directory, so the window costs nothing. This applies to `z` and `zi` too,
which were paying it per keystroke already.
2026-08-14 13:01:02 +03:00

75 lines
1.5 KiB
Go

package config
import (
"time"
)
func DefaultConfig() *Config {
return &Config{
Core: CoreConfig{
Version: 1,
Shell: "",
ShellLogin: false,
Mode: "last",
Debug: false,
ExpandAlias: true,
AutoExecute: false,
CobraProbeEnabled: true,
},
UI: UIConfig{
Style: "modern",
GhostText: true,
ShowHiddenFiles: false,
MaxSuggestions: 100,
MaxHeight: 15,
MaxWidth: 0, // 0 means no limit, fallback to terminal width
NerdFonts: true,
},
Git: GitConfig{
FilterActiveBranch: true,
DeduplicateBranches: true,
},
Updater: UpdaterConfig{
CheckOnStartup: true,
Channel: "stable",
CheckInterval: Duration(24 * time.Hour),
AutoUpdate: 0,
},
AI: AIConfig{
Enabled: false,
Provider: "",
DebounceMS: 500,
MinIntervalMS: 1000,
Providers: nil,
SuggestOnEmpty: SuggestOnEmptyConfig{
Enabled: false,
DebounceMS: 800,
MinIntervalMS: 5000,
},
},
Zoxide: ZoxideConfig{
ExtendCd: false,
},
Keybindings: KeybindingsConfig{
ToggleMode: "ctrl+r",
ToggleMenu: "shift+tab",
SelectSuggestion: "tab",
NavigateUp: "up",
NavigateDown: "down",
},
}
}
func DefaultState() *State {
return &State{
LastMode: "spec",
Updater: UpdaterState{
LastCheckTime: time.Time{},
SeenVersion: "",
AutoUpdateTarget: "",
AutoUpdateAttempt: 0,
DeclinedVersion: "",
},
}
}