### Install and Configure Quick Domains Source: https://github.com/davidrr-f/quick_domains.wezterm/blob/main/README.md Demonstrates how to import the plugin and apply the default configuration to the Wezterm config object. ```lua local domains = wezterm.plugin.require("https://github.com/DavidRR-F/quick_domains.wezterm") domains.apply_to_config(config) ``` -------------------------------- ### Integrate Quick Domains with WezTerm Key Tables Source: https://context7.com/davidrr-f/quick_domains.wezterm/llms.txt Configures the Quick Domains plugin to use WezTerm's key tables for modal keybindings. This example demonstrates setting up a leader key and a 'tmux' key table, then assigning domain selector actions (attach, vsplit, hsplit) to specific keys within that table. ```lua local wezterm = require 'wezterm' local config = wezterm.config_builder() local domains = wezterm.plugin.require("https://github.com/DavidRR-F/quick_domains.wezterm") -- Define a leader key for tmux-style bindings config.leader = { key = 'a', mods = 'CTRL', timeout_milliseconds = 1000 } -- Set up key tables first config.key_tables = { tmux = { -- Your other tmux-mode bindings here }, } config.keys = { -- Enter tmux mode with leader { key = 't', mods = 'LEADER', action = wezterm.action.ActivateKeyTable { name = 'tmux', one_shot = false } }, } -- Add domain bindings to the tmux key table domains.apply_to_config(config, { keys = { attach = { key = 's', mods = 'NONE', tbl = 'tmux', -- Bindings added to tmux key table }, vsplit = { key = 'v', mods = 'SHIFT', tbl = 'tmux', }, hsplit = { key = 'h', mods = 'SHIFT', tbl = 'tmux', }, }, }) return config ``` -------------------------------- ### Configure auto-discovery for domains Source: https://context7.com/davidrr-f/quick_domains.wezterm/llms.txt Configuration setup for automatically discovering SSH, Docker, and Kubernetes domains. Requires the plugin to be required and applied to the WezTerm configuration builder. ```lua local wezterm = require 'wezterm' local config = wezterm.config_builder() local domains = wezterm.plugin.require("https://github.com/DavidRR-F/quick_domains.wezterm") domains.apply_to_config(config, { auto = { ssh_ignore = false, exec_ignore = { ssh = false, docker = false, kubernetes = false, }, }, docker_shell = '/bin/bash', kubernetes_shell = '/bin/bash', }) return config ``` -------------------------------- ### Customize Domain Display with WezTerm Format Specification Source: https://context7.com/davidrr-f/quick_domains.wezterm/llms.txt Overrides the default formatter for domain entries in the fuzzy selector. This allows for custom styling, colors, and information displayed for each domain using WezTerm's format specification. Examples include default formatting, custom colors, and a minimal display. ```lua local wezterm = require 'wezterm' local domains = wezterm.plugin.require("https://github.com/DavidRR-F/quick_domains.wezterm") -- Default formatter (lowercase name with icon) domains.formatter = function(icon, name, _) return wezterm.format({ { Text = icon .. ' ' .. string.lower(name) } }) end -- Custom formatter with colors and styling domains.formatter = function(icon, name, label) return wezterm.format({ { Attribute = { Italic = true } }, { Foreground = { AnsiColor = 'Fuchsia' } }, { Background = { Color = 'blue' } }, { Text = icon .. ' ' .. name .. ': ' .. label }, }) end -- Minimal formatter showing only the name domains.formatter = function(icon, name, label) return wezterm.format({ { Foreground = { Color = '#89b4fa' } }, { Text = icon }, { Foreground = { Color = '#cdd6f4' } }, { Text = ' ' .. name }, }) end domains.apply_to_config(config) ``` -------------------------------- ### Configure Quick Domains Plugin in WezTerm Source: https://context7.com/davidrr-f/quick_domains.wezterm/llms.txt Demonstrates how to import the plugin, define a custom UI formatter, apply configuration options for keys and icons, and hook into lifecycle events for status bar updates. ```lua local wezterm = require 'wezterm' local config = wezterm.config_builder() local domains = wezterm.plugin.require("https://github.com/DavidRR-F/quick_domains.wezterm") -- Custom formatter with Catppuccin-style colors domains.formatter = function(icon, name, label) return wezterm.format({ { Foreground = { Color = '#cba6f7' } }, { Text = icon .. ' ' }, { Foreground = { Color = '#cdd6f4' } }, { Attribute = { Intensity = 'Bold' } }, { Text = string.lower(name) }, }) end -- Full configuration with all options domains.apply_to_config(config, { keys = { attach = { mods = 'CTRL|SHIFT', key = 'd', tbl = '' }, vsplit = { mods = 'CTRL|SHIFT', key = 'v', tbl = '' }, hsplit = { mods = 'CTRL|SHIFT', key = 'h', tbl = '' }, }, icons = { mux = '', wsl = '', ssh = '󰣀', tls = '󰢭', unix = '', bash = '', zsh = '', fish = '', pwsh = '󰨊', powershell = '󰨊', cmd = '', docker = '', kubernetes = '󱃾', exec = '', }, auto = { ssh_ignore = false, exec_ignore = { ssh = true, docker = false, kubernetes = false }, }, docker_shell = '/bin/zsh', kubernetes_shell = '/bin/sh', }) -- Event handlers for domain selection lifecycle wezterm.on('quick_domain.fuzzy_selector.opened', function(window, pane) window:set_right_status(wezterm.format({ { Foreground = { Color = '#f9e2af' } }, { Text = '󰍉 Select Domain ' }, })) end) wezterm.on('quick_domain.fuzzy_selector.selected', function(window, pane, id) window:set_right_status(wezterm.format({ { Foreground = { Color = '#a6e3a1' } }, { Text = ' ' .. id .. ' ' }, })) end) wezterm.on('quick_domain.fuzzy_selector.canceled', function(window, pane) window:set_right_status('') end) return config ``` -------------------------------- ### Customize Plugin Options Source: https://github.com/davidrr-f/quick_domains.wezterm/blob/main/README.md Shows how to override default keybindings and enable automatic domain configuration for SSH and container runtimes. ```lua domains.apply_to_config( config, { keys = { attach = { key = 's', mods = 'SHIFT', tbl = 'tmux' }, vsplit = { key = 'v', mods = 'SHIFT', tbl = 'tmux' }, hsplit = { key = 'h', mods = 'SHIFT', tbl = 'tmux' } } } ) -- Enabling auto configuration { auto = { ssh_ignore = false, exec_ignore = { ssh = false, docker = false, kubernetes = false }, } } ``` -------------------------------- ### Default Plugin Configuration Source: https://github.com/davidrr-f/quick_domains.wezterm/blob/main/README.md Reference for the default settings, including key mappings, icon definitions, and auto-discovery ignore lists. ```lua { keys = { attach = { mods = 'CTRL', key = 'd', tbl = '' }, vsplit = { key = 'v', mods = 'CTRL', tbl = '' }, hsplit = { key = 'h', mods = 'CTRL', tbl = '' } }, icons = { hosts = '', ssh = '󰣀', tls = '󰢭', unix = '', exec = '', bash = '', zsh = '', fish = '', pwsh = '󰨊', powershell = '󰨊', wsl = '', windows = '', docker = '', kubernetes = '󱃾' }, auto = { ssh_ignore = true, exec_ignore = { ssh = true, docker = true, kubernetes = true } }, docker_shell = '/bin/bash', kubernetes_shell = '/bin/bash' } ``` -------------------------------- ### Configure Quick Domains Plugin with Default and Custom Settings Source: https://context7.com/davidrr-f/quick_domains.wezterm/llms.txt Applies the Quick Domains plugin to the WezTerm configuration. It can be used with default key bindings and icons, or customized with specific key mappings, icons for different domain types, auto-configuration options, and default shells for Docker and Kubernetes. ```lua local wezterm = require 'wezterm' local config = wezterm.config_builder() -- Import the quick_domains plugin local domains = wezterm.plugin.require("https://github.com/DavidRR-F/quick_domains.wezterm") -- Basic usage with defaults (CTRL+d for attach, CTRL+v for vsplit, CTRL+h for hsplit) domains.apply_to_config(config) -- Or with custom configuration domains.apply_to_config(config, { keys = { attach = { key = 's', mods = 'CTRL|SHIFT', tbl = '', -- empty string for global keys, or specify a key_table name }, vsplit = { key = 'v', mods = 'CTRL|SHIFT', tbl = '', }, hsplit = { key = 'h', mods = 'CTRL|SHIFT', tbl = '', }, }, icons = { ssh = '󰣀', docker = '', kubernetes = '󱃾', bash = '', zsh = '', }, auto = { ssh_ignore = false, -- Enable SSH domain auto-configuration exec_ignore = { ssh = false, -- Enable SSH exec domains docker = false, -- Enable Docker container domains kubernetes = false -- Enable Kubernetes pod domains }, }, docker_shell = '/bin/bash', kubernetes_shell = '/bin/bash', }) return config ``` -------------------------------- ### Handle fuzzy selector events in WezTerm Source: https://context7.com/davidrr-f/quick_domains.wezterm/llms.txt Hooks for managing the lifecycle of the fuzzy domain selector, including opening, selection, and cancellation events. These allow for custom UI updates and logging during the domain switching process. ```lua local wezterm = require 'wezterm' wezterm.on('quick_domain.fuzzy_selector.opened', function(window, pane) wezterm.log_info('Domain selector opened in pane: ' .. pane:pane_id()) window:set_right_status(wezterm.format({ { Foreground = { Color = '#fab387' } }, { Text = ' Selecting domain...' }, })) end) wezterm.on('quick_domain.fuzzy_selector.selected', function(window, pane, id) wezterm.log_info('Selected domain: ' .. id) window:set_right_status(wezterm.format({ { Foreground = { Color = '#a6e3a1' } }, { Text = ' Connected to: ' .. id }, })) end) wezterm.on('quick_domain.fuzzy_selector.canceled', function(window, pane) wezterm.log_info('Domain selection canceled') window:set_right_status('') end) ``` -------------------------------- ### Define Custom Domain Formatter Source: https://github.com/davidrr-f/quick_domains.wezterm/blob/main/README.md Allows users to define a custom function to format the appearance of domain items in the fuzzy selector using Wezterm's format API. ```lua domains.formatter = function(icon, name, label) return wezterm.format({ { Attribute = { Italic = true } }, { Foreground = { AnsiColor = 'Fuchsia' } }, { Background = { Color = 'blue' } }, { Text = icon .. ' ' .. name .. ': ' .. label }, }) end ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.