DrKJeff16/wezterm-types

website github github
neovim-lua-development
stars 176
issues 1
subscribers 3
forks 24
CREATED

UPDATED


wezterm-types

Mentioned in Awesome WezTerm | Mentioned in Awesome Neovim

This project aims to provide LuaCATS-like Lua Language Server type annotations for your WezTerm config.

Example videos can be found in EXAMPLES.md.

NOTE: For any missing or unclear types you should always double-check the WezTerm Lua Reference. If using an annotated plugin featured in this repository please refer to its author for any unclear types.

Features


Table of Contents


Installation

LuaRocks

You can install wezterm-types using LuaRocks:

luarocks install wezterm-types # Global install
luarocks install --local wezterm-types # Local install

To get it running in Neovim please refer to this discussion.

Neovim

We recommend using folke/lazy.nvim as a package manager:

{
  'DrKJeff16/wezterm-types',
  version = false, -- Get the latest version
},

Featured Plugins

This project also features type annotations for various WezTerm plugins.

If you want to have your plugin featured please request it through an issue.

Plugin Documentation Neovim Help
ai-commander.wezterm docs/ai-commander.md :h wezterm-types-ai-commander.txt
ai-helper.wezterm docs/ai-helper.md :h wezterm-types-ai-helper.txt
bar.wezterm docs/bar_wezterm.md :h wezterm-types-bar_wezterm.txt
dev.wezterm docs/dev-wezterm.md :h wezterm-types-dev-wezterm.txt
lib.wezterm docs/lib-wezterm.md :h wezterm-types-lib-wezterm.txt
modal.wezterm docs/modal_wezterm.md :h wezterm-types-modal_wezterm.txt
pinned-tabs.wezterm docs/pinned-tabs.md :h wezterm-types-pinned-tabs.txt
pivot_panes.wezterm docs/pivot_panes.md :h wezterm-types-pivot_panes.txt
presentation.wez docs/presentation_wez.md :h wezterm-types-presentation_wez.txt
quick_domains.wezterm docs/quick_domains.md :h wezterm-types-quick_domains.txt
resurrect.wezterm docs/resurrect.md :h wezterm-types-resurrect.txt
rosepine docs/rosepine.md :h wezterm-types-rosepine.txt
sessionizer.wezterm docs/sessionizer.md :h wezterm-types-sessionizer.txt
smart-splits.nvim docs/smart-splits.md :h wezterm-types-smart-splits.txt
stack.wez docs/stack-wez.md :h wezterm-types-stack-wez.txt
tabline.wez docs/tabline_wez.md :h wezterm-types-tabline_wez.txt
wez-pain-control docs/wez-pain-control.md :h wezterm-types-wez-pain-control.txt
wez-tmux docs/wez-tmux.md :h wezterm-types-wez-tmux.txt
wezterm-config.nvim docs/wezterm-config.md :h wezterm-types-wezterm-config.txt
wezterm-theme-rotator docs/wezterm-theme-rotator.md :h wezterm-types-wezterm-theme-rotator.txt
workspace-picker.wezterm docs/workspace-picker.md :h wezterm-types-workspace-picker.txt

Usage

After installing the types, add the type annotations to wezterm and config respectively when running require("wezterm") in your configuration.

A useful example:

local wezterm = require("wezterm") ---@type Wezterm
local config = wezterm.config_builder() ---@type Config

config.window_decorations = "RESIZE|MACOS_FORCE_DISABLE_SHADOW"

return config

These annotations enable the Lua Language Server to provide proper type checking and autocompletion for WezTerm configuration options.

Using lazydev.nvim

Install lazydev.nvim as suggested:

{
  'folke/lazydev.nvim',
  ft = 'lua',
  dependencies = { 'DrKJeff16/wezterm-types' },
  opts = {
    library = {
      -- Other library configs...
      { path = 'wezterm-types', mods = { 'wezterm' } },
    },
  },
}

If you download this repo under a diferent name, you can use the following instead:

{
  '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' } },
    },
  },
}

Using The Built-in Neovim LSP

Add the install path of wezterm-types in your lua_ls config.

return {
  cmd = { 'lua-language-server' },
  filetypes = { 'lua' },
  settings = {
    Lua = {
      workspace = {
        library = {
          -- Other library paths...
          '</path/to/wezterm-types>',
        },
      },
    },
  },
}

Collaborators

Contributors


License

MIT