Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
101 changes: 85 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,6 @@ for any unclear types.
- [Using lazydev.nvim](#using-lazydevnvim)
- [Using The Built-in Neovim LSP](#using-the-built-in-neovim-lsp)
- [Featured Plugins](#featured-plugins)
- [ai-commander.wezterm](#ai-commanderwezterm)
- [ai-helper.wezterm](#ai-helperwezterm)
- [modal.wezterm](#modalwezterm)
- [presentation.wez](#presentationwez)
- [tabline.wez](#tablinewez)
- [wez-pain-control](#wez-pain-control)
- [wez-tmux](#wez-tmux)
- [wezterm-config.nvim](#wezterm-confignvim)
- [License](#license)

---
Expand Down Expand Up @@ -170,7 +162,61 @@ This project also features type annotations for various WezTerm plugins.

**_If you want to have your plugin featured please request it through an issue._**

### ai-commander.wezterm
<details>
<summary><code>dev.wezterm</code> <b>(SPECIAL CASE)</b></summary>

You can import type annotations for
[`ChrisGVE/dev.wezterm`](https://github.com/ChrisGVE/dev.wezterm) as shown below:

```lua
---@type Dev
local dev = wezterm.plugin.require("https://github.com/ChrisGVE/dev.wezterm")
```

This integration also adds the following events to `wezterm.on()`:

- `dev.wezterm-plugin-not-found`
- `dev.wezterm.invalid_hashkey`
- `dev.wezterm.invalid_opts`
- `dev.wezterm.no_keywords`
- `dev.wezterm.require_path_not_set`

```lua
---Either no `hashkey` or an invalid one provided.
---
---@param event "dev.wezterm.invalid_hashkey" This is for `dev.wezterm` only!
---@param callback function
function Wezterm.on(event, callback) end

---Invalid options provided to plugin setup.
---
---@param event "dev.wezterm.invalid_opts" This is for `dev.wezterm` only!
---@param callback function
function Wezterm.on(event, callback) end

---No keywords were provided for searching the plugin.
---
---@param event "dev.wezterm.no_keywords" This is for `dev.wezterm` only!
---@param callback function
function Wezterm.on(event, callback) end

---The plugin was not found and thus `package.path` could not be set.
---
---@param event "dev.wezterm.require_path_not_set" This is for `dev.wezterm` only!
---@param callback function
function Wezterm.on(event, callback) end

---The provided keywords did not allow for the plugin to be found.
---
---@param event "dev.wezterm-plugin-not-found" This is for `dev.wezterm` only!
---@param callback function
function Wezterm.on(event, callback) end
```

</details>
<br />
<details>
<summary><code>ai-commander.wezterm</code></summary>

You can import type annotations for
[`dimao/ai-commander.wezterm`](https://github.com/dimao/ai-commander.wezterm) as shown below:
Expand All @@ -180,7 +226,10 @@ You can import type annotations for
local ai_commander = wezterm.plugin.require("https://github.com/dimao/ai-commander.wezterm")
```

### ai-helper.wezterm
</details>

<details>
<summary><code>ai-helper.wezterm</code></summary>

You can import type annotations for
[`Michal1993r/ai-helper.wezterm`](https://github.com/Michal1993r/ai-helper.wezterm) as shown below:
Expand All @@ -190,7 +239,10 @@ You can import type annotations for
local ai_helper = wezterm.plugin.require("https://github.com/Michal1993r/ai-helper.wezterm")
```

### modal.wezterm
</details>

<details>
<summary><code>modal.wezterm</code></summary>

You can import type annotations for
[`MLFlexer/modal.wezterm`](https://github.com/MLFlexer/modal.wezterm) as shown below:
Expand All @@ -200,7 +252,10 @@ You can import type annotations for
local modal = wezterm.plugin.require("https://github.com/MLFlexer/modal.wezterm")
```

### presentation.wez
</details>

<details>
<summary><code>presentation.wez</code></summary>

You can import type annotations for
[`xarvex/presentation.wez`](https://github.com/xarvex/presentation.wez) as shown below:
Expand All @@ -210,7 +265,10 @@ You can import type annotations for
local presentation = wezterm.plugin.require("https://github.com/xarvex/presentation.wez")
```

### tabline.wez
</details>

<details>
<summary><code>tabline.wez</code></summary>

You can import type annotations for
[`michaelbrusegard/tabline.wez`](https://github.com/michaelbrusegard/tabline.wez) as show below:
Expand All @@ -220,7 +278,10 @@ You can import type annotations for
local tabline = wezterm.plugin.require("https://github.com/michaelbrusegard/tabline.wez")
```

### wez-pain-control
</details>

<details>
<summary><code>wez-pain-control</code></summary>

You can import type annotations for
[`sei40kr/wez-pain-control`](https://github.com/sei40kr/wez-pain-control) as shown below:
Expand All @@ -237,7 +298,10 @@ Or, if you've installed it locally:
local wez_pain_control = require("wez-pain-control.plugin")
```

### wez-tmux
</details>

<details>
<summary><code>wez-tmux</code></summary>

You can import type annotations for [`sei40kr/wez-tmux`](https://github.com/sei40kr/wez-tmux)
as shown below:
Expand All @@ -254,7 +318,10 @@ Or, if you've installed it locally:
local wez_tmux = require("plugins.wez-tmux.plugin")
```

### wezterm-config.nvim
</details>

<details>
<summary><code>wezterm-config.nvim</code></summary>

You can import type annotations for
[`winter-again/wezterm-config.nvim`](https://github.com/winter-again/wezterm-config.nvim)
Expand All @@ -265,6 +332,8 @@ as shown below:
local wezterm_config_nvim = wezterm.plugin.require('https://github.com/winter-again/wezterm-config.nvim')
```

</details>

---

## Collaborators
Expand Down
62 changes: 62 additions & 0 deletions lua/wezterm/types/plugins/dev-wezterm.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---@meta
---@diagnostic disable:unused-local

---@enum (key) Behavior
local behavior = {
error = 1,
keep = 1,
force = 1,
}

---@class DevOpts
---@field keywords? string[]
---@field auto? boolean
---@field ignore_branch? string[]|string
---@field fetch_branch? boolean

---@class CacheElement
---@field keywords? string[]
---@field plugin_path? string
---@field require_path? string
---@field error? boolean
---@field fetch_branch? boolean
---@field auto? boolean
---@field ignore_branch? string[]|string
---@field branch? string
---@field file? string

---@class Dev
---@field dev_cache_element CacheElement
---@field cache table<string, CacheElement>
---@field substitutions table<string, string>|nil
---@field utils boolean
---@field bootstrap boolean
local M = {}

---@param hashkey string
---@return string|nil plugin_path
function M.get_plugin_path(hashkey) end

---@param hashkey string
---@return string|nil require_path
function M.get_require_path(hashkey) end

---Set the wezterm require path for the plugin.
---
---@param hashkey string
function M.set_wezterm_require_path(hashkey) end

---@param url string
---@param opts? DevOpts
---@return any?
function M.require(url, opts) end

---@param opts? DevOpts
---@return string|nil hashkey
---@return string|nil plugin_path
function M.setup(opts) end

---@param substitute_dict table<string, string>
function M.set_substitutions(substitute_dict) end

-- vim: set ts=2 sts=2 sw=2 et ai si sta:
44 changes: 44 additions & 0 deletions lua/wezterm/types/wezterm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1739,6 +1739,50 @@ function Wezterm.on(event, callback) end
---@param callback CallbackWindowPane
function Wezterm.on(event, callback) end

---============================= dev.wezterm =======================================

---This is for `dev.wezterm` only!
------
---Either no `hashkey` or an invalid one provided.
---
---@param event "dev.wezterm.invalid_hashkey" This is for `dev.wezterm` only!
---@param callback function
function Wezterm.on(event, callback) end

---This is for `dev.wezterm` only!
------
---Invalid options provided to plugin setup.
---
---@param event "dev.wezterm.invalid_opts" This is for `dev.wezterm` only!
---@param callback function
function Wezterm.on(event, callback) end

---This is for `dev.wezterm` only!
------
---No keywords were provided for searching the plugin.
---
---@param event "dev.wezterm.no_keywords" This is for `dev.wezterm` only!
---@param callback function
function Wezterm.on(event, callback) end

---This is for `dev.wezterm` only!
------
---The plugin was not found and thus `package.path` could not be set.
---
---@param event "dev.wezterm.require_path_not_set" This is for `dev.wezterm` only!
---@param callback function
function Wezterm.on(event, callback) end

---This is for `dev.wezterm` only!
------
---The provided keywords did not allow for the plugin to be found.
---
---@param event "dev.wezterm-plugin-not-found" This is for `dev.wezterm` only!
---@param callback function
function Wezterm.on(event, callback) end

---=================================================================================

---This function opens the specified `path_or_url` with
---either the specified application or the default application
---if `application` was not passed in.
Expand Down
Loading