kevinsilvester/wezterm-config

repository·master·Indexed 20 days ago

https://github.com/kevinsilvester/wezterm-config

A customized WezTerm configuration featuring a background image selector with fuzzy search and cycling, a GPU adapter selector for optimizing graphics APIs, and a comprehensive set of organized keybindings using SUPER and SUPER_REV modifiers for cross-platform consistency.

Tokens
1.5K
Snippets
1
Records
5
Agent score
28%

What's inside wezterm-config

  1. Use the GPU Adapter Selector

    master

    The configuration includes a utility to select the optimal GPU and graphics API (Adapter) combination.

    Requirement: This only works if the front_end option is set to WebGpu in your configuration.

    Selection Logic:

    1. GPU Priority: Discrete > Integrated > Other (OpenGl on Discrete) > Cpu
    2. Graphics API Priority:
      • Windows: Dx12 > Vulkan > OpenGl
      • Linux: Vulkan > OpenGl
      • Mac: Metal
  2. Understand the key modifier mappings

    master

    This configuration uses specific mappings for the SUPER and SUPER_REV keys to maintain consistency across different operating systems and avoid conflicts with OS-level shortcuts.

    OSSUPERSUPER_REV
    MacOSSuperSuper + Ctrl
    Windows/LinuxAltAlt + Ctrl

    Leader Key: On all platforms, the LEADER key is mapped to SUPER_REV + Space.

  3. Install WezTerm and this configuration

    master

    To use this configuration, you must first install WezTerm (minimum version 20240127-113634-bbcac864, though Nightly is recommended) and the JetBrainsMono Nerd Font.

    1. Install WezTerm

    Windows

    • Stable (Scoop non-portable): scoop bucket add extras then scoop install wezterm
    • Stable (Scoop portable): scoop bucket add k https://github.com/KevinSilvester/scoop-bucket then scoop install k/wezterm
    • Stable (winget): winget install wez.wezterm
    • Stable (choco): choco install wezterm -y
    • Nightly (Scoop non-portable): scoop bucket add versions then scoop install wezterm-nightly
    • Nightly (Scoop portable): scoop bucket add k https://github.com/KevinSilvester/scoop-bucket then scoop install k/wezterm-nightly

    MacOS

    • Stable (Homebrew): brew install --cask wezterm
    • Stable (MacPort): sudo port selfupdate then sudo port install wezterm
    • Nightly (Homebrew): brew install --cask wezterm@nightly
    • Upgrade Nightly: brew install --cask wezterm@nightly --no-quarantine --greedy-latest

    Linux

    • Follow the official WezTerm Linux installation guide.

    2. Install JetBrainsMono Nerd Font

    • MacOS (Homebrew): brew install --cask font-jetbrains-mono-nerd-font
    • Windows (Scoop): scoop bucket add nerd-fonts then scoop install JetBrainsMono-NF

    3. Apply the Configuration

    Clone this repository into your WezTerm configuration directory:

    git clone https://github.com/KevinSilvester/wezterm-config.git ~/.config/wezterm

    4. Post-Installation Setup

    Update the following files to match your environment:

    • ./config/launch.lua: Configure preferred shells and their paths.
    • ./config/domains.lua: Configure custom SSH or WSL domains.
  4. Use Background Image Selector features

    master

    The configuration includes a background image selector utility that allows you to:

    • Cycle through images
    • Fuzzy search for a specific image
    • Toggle the background image visibility

    Key Bindings:

    KeysAction
    SUPER + /Select Random Image
    SUPER + ,Cycle to next Image
    SUPER + .Cycle to previous Image
    SUPER_REV + /Fuzzy select Image
    SUPER + bToggle background focus mode
  5. Reference all key bindings

    master

    This configuration uses SUPER and SUPER_REV (as defined in the modifier mapping guide) for most actions.

    Miscellaneous

    KeysAction
    F1ActivateCopyMode
    F2ActivateCommandPalette
    F3ShowLauncher
    F4ShowLauncher (tabs only)
    F5ShowLauncher (workspaces only)
    F11ToggleFullScreen
    F12ShowDebugOverlay
    SUPER + fSearch Text
    SUPER_REV + uOpen URL

    Copy/Paste

    KeysAction
    Ctrl + Shift + cCopy to Clipboard
    Ctrl + Shift + vPaste from Clipboard

    Cursor Movements

    KeysAction
    SUPER + LeftArrowMove cursor to Line Start
    SUPER + RightArrowMove cursor to Line End
    SUPER + BackspaceClear Line (Note: does not work in PowerShell or cmd)

    Tabs

    KeysAction
    SUPER + tSpawnTab (DefaultDomain)
    SUPER_REV + tSpawnTab (WSL:Ubuntu)
    SUPER_REV + wCloseCurrentTab
    SUPER + [Next Tab
    SUPER + ]Previous Tab
    SUPER_REV + [Move Tab Left
    SUPER_REV + ]Move Tab Right
    SUPER + 9Toggle tab bar
    SUPER + 0Rename Current Tab
    SUPER_REV + 0Undo Rename

    Windows

    KeysAction
    SUPER + nSpawnWindow
    SUPER + =Increase Window Size (Disabled on Windows due to bug)
    SUPER + -Decrease Window Size (Disabled on Windows due to bug)

    Panes

    KeysAction
    SUPER + \SplitVertical (CurrentPaneDomain)
    SUPER_REV + \SplitHorizontal (CurrentPaneDomain)
    SUPER + EnterTogglePaneZoomState
    SUPER + wCloseCurrentPane
    SUPER_REV + kMove to Pane (Up)
    SUPER_REV + jMove to Pane (Down)
    SUPER_REV + hMove to Pane (Left)
    SUPER_REV + lMove to Pane (Right)
    SUPER_REV + pSwap with selected Pane
    SUPER + uScroll Lines up (5 lines)
    SUPER + dScroll Lines down (5 lines)
    PageUpScroll Page up
    PageDownScroll Page down

    Key Tables (Leader Mode)

    resize_font table

    KeysAction
    LEADER + fEnter resize_font table
    kIncreaseFontSize
    jDecreaseFontSize
    rResetFontSize
    qPopKeyTable (exit)
    EscPopKeyTable (exit)

    resize_pane table

    KeysAction
    LEADER + pEnter resize_pane table
    kAdjustPaneSize (Up)
    jAdjustPaneSize (Down)
    hAdjustPaneSize (Left)
    lAdjustPaneSize (Right)
    qPopKeyTable (exit)
    EscPopKeyTable (exit)