### setup(config, opts) Source: https://context7.com/bugii/workspace-picker-plugin/llms.txt Initializes the workspace picker with user-defined workspace configurations and custom options. This function must be called before applying configurations to register workspaces. ```APIDOC ## setup(config, opts) ### Description Initializes the workspace picker with user-defined workspace configurations and options. Validates entries and merges custom icons. ### Parameters - **config** (table) - Required - A list of workspace definitions containing path, type, and tab/pane layouts. - **opts** (table) - Optional - Configuration options including custom icons for different workspace types. ### Request Example workspace_picker.setup({ { path = "~/dotfiles", tabs = { { name = "editor", command = "nvim" } } } }, { icons = { directory = "📁" } }) ``` -------------------------------- ### Configure and Initialize Workspace Picker Source: https://github.com/bugii/workspace-picker-plugin/blob/main/README.md Demonstrates the basic setup of the workspace picker plugin by defining workspace paths and applying the default keybinding to the WezTerm configuration. ```lua local workspace_picker = wezterm.plugin.require("https://github.com/bugii/workspace-picker-plugin") -- Configure workspaces workspace_picker.setup({ { path = "~/projects/my-project", type = "directory" }, { path = "~/projects/worktrees", type = "worktreeroot" }, }) -- Apply default keybinding (LEADER + f) workspace_picker.apply_to_config(config) ``` -------------------------------- ### Initialize Workspace Picker with setup() Source: https://context7.com/bugii/workspace-picker-plugin/llms.txt Configures the plugin with workspace definitions including static paths, Git worktrees, and custom tab layouts. This function must be called to register workspaces and define custom icons before applying configurations. ```lua local wezterm = require("wezterm") local workspace_picker = wezterm.plugin.require("https://github.com/bugii/workspace-picker-plugin") -- Basic setup with multiple workspace types workspace_picker.setup({ -- Static directory workspace { path = "~/dotfiles", type = "directory", -- optional, defaults to "directory" tabs = { { name = "editor", command = "nvim" }, { name = "terminal" }, } }, -- Git worktree root (lists all worktrees automatically) { path = "~/Projects/my-repo.git", type = "worktreeroot", tabs = { { name = "development", direction = "Bottom", panes = { { name = "editor", command = "nvim", size = 3 }, { direction = "Right", panes = { { name = "server", command = "npm run dev", size = 2 }, { name = "tests", command = "npm run test:watch" } } } } }, { name = "git", command = "lazygit" } } }, -- Simple project path { path = "~/Projects/another-project" } }, { -- Custom icons (optional) icons = { directory = "📁", worktree = "🌳", zoxide = "⚡", workspace = "🖥️", } }) ``` -------------------------------- ### Configure Workspace Picker in WezTerm Source: https://context7.com/bugii/workspace-picker-plugin/llms.txt Demonstrates the full setup of the workspace picker, including defining project paths, custom tab/pane layouts, and registering direct keybindings for specific workspaces. ```lua local wezterm = require("wezterm") local config = wezterm.config_builder() local workspace_picker = wezterm.plugin.require("https://github.com/bugii/workspace-picker-plugin") config.leader = { key = "a", mods = "CTRL", timeout_milliseconds = 1000 } workspace_picker.setup({ { path = "~/dotfiles", tabs = { { name = "config", command = "nvim" }, { name = "shell" } } }, { path = "~/Projects/main-app", tabs = { { name = "dev", direction = "Bottom", panes = { { name = "editor", command = "nvim .", size = 3 }, { direction = "Right", size = 1, panes = { { name = "server", command = "npm run dev" }, { name = "terminal" } } } } }, { name = "git", command = "lazygit" }, { name = "logs", command = "tail -f logs/app.log" } } }, { path = "~/Projects/monorepo.git", type = "worktreeroot", tabs = { { name = "code", command = "nvim ." }, { name = "build", command = "pnpm run build:watch" }, { name = "test", command = "pnpm run test:watch" } } }, { path = "~/Projects/scripts" }, { path = "~/Documents/notes" } }, { icons = { directory = "", worktree = "", zoxide = "", workspace = "", } }) workspace_picker.apply_to_config(config) config.keys = config.keys or {} table.insert(config.keys, { key = "d", mods = "LEADER", action = workspace_picker.switch_to_workspace("~/dotfiles") }) return config ``` -------------------------------- ### Configure Pane Size Weights in WezTerm Source: https://github.com/bugii/workspace-picker-plugin/blob/main/README.md Demonstrates how to define pane layouts using the 'size' property. The total weight is the sum of all specified sizes, with omitted sizes defaulting to 1. ```lua panes = { { name = "editor", command = "vim", size = 3 }, { name = "terminal", size = 1 }, { name = "logs" }, -- implicit weight 1 } -- Total weight = 3 + 1 + 1 = 5 -- Final fractions: editor 3/5, terminal 1/5, logs 1/5 ``` ```lua panes = { { name = "left", size = 8 }, { name = "right" }, -- weight 1 } -- Fractions: left 8/9 (~0.888...), right 1/9 (~0.111...) ``` -------------------------------- ### Advanced Workspace Layout Configuration Source: https://github.com/bugii/workspace-picker-plugin/blob/main/README.md Defines complex tab and pane layouts for specific directories or Git worktree roots. Includes custom icon mapping and specific keybinding overrides. ```lua local workspace_picker = wezterm.plugin.require("https://github.com/bugii/workspace-picker-plugin") workspace_picker.setup({ -- Static directory { path = "~/dotfiles", tabs = { { name = "editor", command = "vim" }, { name = "terminal" }, } }, -- Git worktree root { path = "~/Projects/my-repo.git", type = "worktreeroot", tabs = { { name = "my-repo", direction = "Bottom", panes = { { name = "editor", command = "vim" }, { direction = "Right", panes = { { name = "dev", command = "npm run dev" }, { name = "test", command = "npm run test" } } } } } } } }, { icons = { directory = "📁", worktree = "🌳", zoxide = "⚡", workspace = "🖥️", } }) -- Apply to config with custom keybinding workspace_picker.apply_to_config(config, "f", "CTRL") ``` -------------------------------- ### Create Direct Workspace Shortcuts with switch_to_workspace() Source: https://context7.com/bugii/workspace-picker-plugin/llms.txt Generates a WezTerm action callback to switch directly to a specific workspace path, bypassing the fuzzy-search interface. This is useful for creating dedicated hotkeys for frequently accessed projects. ```lua local wezterm = require("wezterm") local config = wezterm.config_builder() local workspace_picker = wezterm.plugin.require("https://github.com/bugii/workspace-picker-plugin") -- Setup workspaces with tab configurations workspace_picker.setup({ { path = "~/dotfiles", tabs = { { name = "config", command = "nvim" }, { name = "shell" } } }, { path = "~/Projects/main-app", tabs = { { name = "code", command = "nvim ." }, { name = "server", command = "npm run dev" }, { name = "terminal" } } } }) -- Create direct keybindings for quick access config.keys = { -- LEADER + d switches directly to dotfiles { key = "d", mods = "LEADER", action = workspace_picker.switch_to_workspace("~/dotfiles") }, -- LEADER + m switches directly to main app { key = "m", mods = "LEADER", action = workspace_picker.switch_to_workspace("~/Projects/main-app") }, -- LEADER + h switches to home directory { key = "h", mods = "LEADER", action = workspace_picker.switch_to_workspace("~") } } workspace_picker.apply_to_config(config) return config ``` -------------------------------- ### Define Complex Nested Pane Layouts Source: https://context7.com/bugii/workspace-picker-plugin/llms.txt Demonstrates recursive pane configuration to create sophisticated IDE-style layouts. By nesting pane objects with specific directions and relative sizes, users can create multi-window terminal arrangements. ```lua workspace_picker.setup({ { path = "~/Projects/complex-app", tabs = { { name = "development", direction = "Bottom", panes = { { name = "editor", command = "nvim .", size = 7 }, { direction = "Right", size = 3, panes = { { name = "dev-server", command = "npm run dev", size = 3 }, { direction = "Bottom", size = 2, panes = { { name = "tests", command = "npm run test:watch" }, { name = "terminal" } } } } } } } } } }) ``` -------------------------------- ### apply_to_config(config, key, mods) Source: https://context7.com/bugii/workspace-picker-plugin/llms.txt Registers the fuzzy-search workspace picker interface into the WezTerm configuration with customizable keybindings. ```APIDOC ## apply_to_config(config, key, mods) ### Description Adds a keybinding to the WezTerm configuration that triggers the workspace picker fuzzy search interface. ### Parameters - **config** (table) - Required - The WezTerm config object. - **key** (string) - Optional - The key to trigger the picker (default: 'f'). - **mods** (string) - Optional - The modifier keys (default: 'LEADER'). ### Request Example workspace_picker.apply_to_config(config, "p", "CTRL") ``` -------------------------------- ### Integrate Git Worktrees Source: https://context7.com/bugii/workspace-picker-plugin/llms.txt Configures the plugin to automatically discover and apply layouts to Git worktrees. By setting the type to 'worktreeroot', the plugin applies the defined tab and pane configuration to every detected branch worktree. ```lua workspace_picker.setup({ { path = "~/Projects/my-project.git", type = "worktreeroot", tabs = { { name = "code", direction = "Bottom", panes = { { name = "editor", command = "nvim .", size = 4 }, { direction = "Right", size = 1, panes = { { name = "build", command = "npm run build:watch" }, { name = "test", command = "npm run test:watch" } } } } }, { name = "git", command = "lazygit" }, { name = "terminal" } } } }) ``` -------------------------------- ### switch_to_workspace(path) Source: https://context7.com/bugii/workspace-picker-plugin/llms.txt Creates a WezTerm action callback to switch directly to a specific workspace, bypassing the fuzzy picker interface. ```APIDOC ## switch_to_workspace(path) ### Description Returns a WezTerm action callback that directly switches to a specific workspace by path, useful for dedicated hotkeys. ### Parameters - **path** (string) - Required - The filesystem path of the workspace to switch to. ### Request Example { key = "d", mods = "LEADER", action = workspace_picker.switch_to_workspace("~/dotfiles") } ``` -------------------------------- ### Register Keybindings with apply_to_config() Source: https://context7.com/bugii/workspace-picker-plugin/llms.txt Integrates the workspace picker into the WezTerm configuration by assigning a keybinding to trigger the fuzzy search interface. Supports customization of the trigger key and modifier keys. ```lua local wezterm = require("wezterm") local config = wezterm.config_builder() local workspace_picker = wezterm.plugin.require("https://github.com/bugii/workspace-picker-plugin") -- Configure workspaces first workspace_picker.setup({ { path = "~/dotfiles" }, { path = "~/Projects/webapp", type = "directory" }, }) -- Apply with default keybinding (LEADER + f) workspace_picker.apply_to_config(config) -- Or apply with custom keybinding (CTRL + p) workspace_picker.apply_to_config(config, "p", "CTRL") -- Or use LEADER|SHIFT + w workspace_picker.apply_to_config(config, "w", "LEADER|SHIFT") return config ``` -------------------------------- ### Direct Workspace Switching Shortcut Source: https://github.com/bugii/workspace-picker-plugin/blob/main/README.md Binds a specific workspace to a custom keyboard shortcut within the WezTerm configuration. The path must match a previously defined workspace configuration to inherit its layout settings. ```lua config.keys = { { key = "d", mods = "LEADER", action = workspace_picker.switch_to_workspace("~/dotfiles") } } ``` -------------------------------- ### Configure Workspace Tabs and Panes in Lua Source: https://context7.com/bugii/workspace-picker-plugin/llms.txt Defines the basic tab structure for a workspace, including command execution and simple horizontal or vertical pane splits. This configuration allows users to define specific terminal environments that spawn automatically upon workspace selection. ```lua workspace_picker.setup({ { path = "~/Projects/fullstack-app", tabs = { { name = "editor", command = "nvim ." }, { name = "servers", direction = "Right", panes = { { name = "frontend", command = "npm run dev", size = 1 }, { name = "backend", command = "npm run server", size = 1 } } }, { name = "logs", direction = "Bottom", panes = { { name = "app-logs", command = "tail -f logs/app.log", size = 2 }, { name = "error-logs", command = "tail -f logs/error.log", size = 1 } } }, { name = "terminal" } } } }) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.