wezterm-types

repository·main·Indexed 42 days ago

https://github.com/drkjeff16/wezterm-types

LuaCATS-style type annotations for WezTerm configurations and a wide variety of community plugins. It enables enhanced autocompletion and type checking in editors like Neovim (via lazydev.nvim or lua_ls) and VSCode.

Tokens
9.3K
Snippets
59
Records
67
Agent score
53%

What's inside wezterm-types

  1. Overview of wezterm-types plugins

    main
    The wezterm-types project provides type support and documentation for a wide variety of community plugins designed for WezTerm. This allows developers to interact with these plugins using typed interfaces, improving configuration reliability and developer experience.
  2. Overview of wezterm-types features

    main

    What is wezterm-types?

    wezterm-types provides LuaCATS-like LuaLS type annotations for your WezTerm configuration. This enables better autocompletion and type checking in your editor.

    Key Features

    • LuaCATS-like type annotations: Provides structured type information for WezTerm configurations.
    • Built-in colorschemes: Includes annotations for config.color_scheme.
    • Up-to-date descriptions: Provides context for configuration keys.
    • Community plugin annotations: Includes type support for various community plugins.
    • Neovim support: Works via lazydev.nvim or the built-in LSP API.
    • VSCode/VSCodium support: Can be used by cloning the repository into your ~/.config/wezterm directory and editing your config from there.
  3. Explore featured WezTerm plugins with wezterm-types

    main

    The wezterm-types repository provides type definitions and documentation for various WezTerm plugins. You can find specific documentation and type information for the following featured plugins:

    • tabline.wez: Tabline management.
    • tabsets.wezterm: Tabset functionality.
    • toggle_terminal.wez: Terminal toggling.
    • warp.wz: Warp integration.
    • wez-pain-control: Pane control.
    • wez-tmux: Tmux-like behavior.
    • wezterm-agent-deck: Agent deck management.
    • wezterm-attention: Attention/notification features.
    • wezterm-cmd-sender: Command sending.
    • wezterm-cmdpicker: Command picking.
    • wezterm-config.nvim: Neovim configuration integration.
    • wezterm-quota-limit: Quota limiting.
    • wezterm-replay: Replay functionality.
    • wezterm-sessions: Session management.

    Each plugin has dedicated documentation files within the docs/ directory of this repository and corresponding type definitions in the doc/ directory.

  4. Type definitions for featured WezTerm plugins

    main

    This project provides type definitions for a wide variety of WezTerm plugins. If you are developing or configuring any of the following plugins, you can use wezterm-types to get autocompletion and type safety in your Lua configuration:

    • pinned-tabs.wezterm
    • pivot_panes.wezterm
    • presentation.wez
    • quick_domains.wezterm
    • quickselect.wezterm
    • resurrect.wezterm
    • ribbon.wz
    • rosepine
    • sessionizer.wezterm
    • sigil.wz
    • smart-splits.nvim
    • smart_workspace_switcher.wezterm
    • stack.wez
    • sync-panes.wez
  5. Use type annotations for WezTerm plugins

    main
    The wezterm-types project provides type annotations for various WezTerm plugins to improve developer experience through autocompletion and type checking. If you are using a plugin that is supported by this project, you can leverage these type definitions in your WezTerm configuration.
  6. Configure lazydev.nvim for wez-pain-control types

    main

    If you use lazydev.nvim and have wez-pain-control installed locally, you can enable type completion by adding wezterm-types as a dependency and configuring the library paths in your lazydev.nvim setup. You must map the wez-pain-control path to the wez-pain-control module.

    {
      'folke/lazydev.nvim',
      ft = 'lua',
      dependencies = { 'DrKJeff16/wezterm-types' },
      opts = {
        library = {
          -- Other library configs...
          { path = 'wezterm-types', mods = { 'wezterm' } },
          { path = 'wez-pain-control', mods = { 'wez-pain-control' } },
        },
      },
    }
  7. Import type annotations for wezterm-status

    main

    To get Lua language server autocompletion and type checking for the yriveiro/wezterm-status plugin, use the ---@type WeztermStatus annotation when requiring the plugin via wezterm.plugin.require.

    ---@type WeztermStatus
    local status = wezterm.plugin.require("https://github.com/yriveiro/wezterm-status")
  8. Import type annotations for neapsix/wezterm

    main

    To use type annotations for the neapsix/wezterm plugin in your WezTerm configuration, use wezterm.plugin.require with the plugin's GitHub URL and annotate the resulting variable with the RosePine type. This enables Lua Language Server (LLS) autocompletion and type checking for that plugin.

    ---@type RosePine
    local rosepine = wezterm.plugin.require("https://github.com/neapsix/wezterm")
  9. Import type annotations for wez-tmux

    main

    To get Lua language server autocompletion and type checking for the wez-tmux plugin, use the ---@type WezTmux annotation when requiring the plugin.

    If you are loading the plugin directly from its GitHub repository via WezTerm's plugin system:

    ---@type WezTmux
    local wez_tmux = wezterm.plugin.require("https://github.com/sei40kr/wez-tmux")

    If you have installed the plugin locally:

    ---@type WezTmux
    local wez_tmux = require("wez-tmux.plugin")
    ---@type WezTmux
    local wez_tmux = wezterm.plugin.require("https://github.com/sei40kr/wez-tmux")
  10. Import type annotations for chord.wz

    main

    To get Lua language server type annotations for the chord.wz plugin, use the ---@type Chord annotation when requiring the plugin via wezterm.plugin.require. This allows your editor to provide autocompletion and type checking for the plugin's API.

    ---@type Chord
    local chord = wezterm.plugin.require("https://github.com/sravioli/chord.wz")
  11. Configure lazydev.nvim for wezterm-types

    main

    If you use lazydev.nvim in Neovim, you can automatically load the wezterm-types library. Add DrKJeff16/wezterm-types as a dependency and configure the library option to map the wezterm module to the plugin path.

    If you have renamed the repository directory locally, ensure the name in the dependency and the path in the library configuration match your custom directory name.

    -- Standard installation
    {
      'folke/lazydev.nvim',
      ft = 'lua',
      dependencies = { 'DrKJeff16/wezterm-types' },
      opts = {
        library = {
          -- Other library configs...
          { path = 'wezterm-types', mods = { 'wezterm' } },
        },
      },
    }
    
    -- Installation with a custom directory name
    {
      'folke/lazydev.nvim',
      ft = 'lua',
      dependencies = {
        {
          'DrKJeff16/wezterm-types',
          name = '<my_custom_name>', -- CUSTOM DIRECTORY NAME
        },
      },
      opts = {
        library = {
          -- MAKE SURE TO MATCH THE PLUGIN DIRECTORY'S NAME
          { path = '<my_custom_name>', mods = { 'wezterm' } },
        },
      },
    }
  12. Import type annotations for workspacesionizer.wezterm

    main

    To enable type annotations and autocompletion for the workspacesionizer.wezterm plugin in your WezTerm configuration, use the ---@type Workspacesionizer annotation when requiring the plugin via wezterm.plugin.require.

    ---@type Workspacesionizer
    local wpr = wezterm.plugin.require("https://github.com/vieitesss/workspacesionizer.wezterm")