Skip to content
55 changes: 51 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,22 @@ local workspace_picker = wezterm.plugin.require("https://github.com/bugii/worksp
workspace_picker.setup({
{ path = "~/projects/my-project", type = "directory" },
{ path = "~/projects/worktrees", type = "worktreeroot" },
}, {
-- Optional: customize icons, colors, and fuzzy matching
icons = {
directory = "📁",
worktree = "🌳",
zoxide = "⚡",
workspace = "🖥️",
},
colors = {
directory = "#61afef", -- Blue
worktree = "#98c379", -- Green
zoxide = "#e5c07b", -- Yellow
workspace = "#c678dd", -- Purple
},
fuzzy = true, -- Enable/disable fuzzy matching (default: true)
fuzzy_sort = "previous_first",
})

-- Apply default keybinding (LEADER + f)
Expand Down Expand Up @@ -80,11 +96,16 @@ workspace_picker.setup({
worktree = "🌳",
zoxide = "⚡",
workspace = "🖥️",
}
},
colors = {
directory = "#61afef", -- Blue
worktree = "#98c379", -- Green
zoxide = "#e5c07b", -- Yellow
workspace = "#c678dd", -- Purple
},
fuzzy = true, -- Enable/disable fuzzy matching (default: true)
fuzzy_sort = "previous_first",
})

-- Apply to config with custom keybinding
workspace_picker.apply_to_config(config, "f", "CTRL")
```

### Direct Workspace Switching
Expand Down Expand Up @@ -120,6 +141,32 @@ config.keys = {
| `direction` | string | No | Split direction of (child) panes: `"Right"` or `"Bottom"` (default: `"Right"`) |
| `panes` | table | No | Array of pane configurations |

### Color Configuration

You can customize the colors used for different workspace types in the picker:

| Field | Type | Required | Description |
| ------------- | ------ | -------- | ---------------------------------------------------------------------------------- |
| `colors` | table | No | Object mapping workspace types to hex color strings |
| `colors.directory` | string | No | Color for directory workspaces (default: `"#61afef"` - blue) |
| `colors.worktree` | string | No | Color for git worktree workspaces (default: `"#98c379"` - green) |
| `colors.zoxide` | string | No | Color for zoxide directory workspaces (default: `"#e5c07b"` - yellow) |
| `colors.workspace` | string | No | Color for existing Wezterm workspaces (default: `"#c678dd"` - purple) |

### Fuzzy Search Configuration

You can enable or disable fuzzy matching in the workspace selector. When fuzzy mode is enabled, the workspace list can be optionally reordered to prioritize the current and previous workspaces.

| Field | Type | Required | Description |
| ------------- | ------- | -------- | ---------------------------------------------------------------------------------- |
| `fuzzy` | boolean | No | Enable/disable fuzzy matching and workspace reordering (default: `true`) |
| `fuzzy_sort` | string | No | Sort order in fuzzy mode: `"previous_first"`, `"current_first"`, or `"none"` (default: `"previous_first"`) |

**`fuzzy_sort` values:**
- `"previous_first"` — Previous active workspace at top, current second
- `"current_first"` — Current workspace at top, previous second
- `"none"` — No reordering (original priority order preserved)

### Pane Configuration

| Field | Type | Required | Description |
Expand Down
Loading