-
-
Notifications
You must be signed in to change notification settings - Fork 797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add plugin aliases #5820
Open
MLFlexer
wants to merge
9
commits into
wez:main
Choose a base branch
from
MLFlexer:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add plugin aliases #5820
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
51a2bae
add lua API require_with_alias and alias to plugin spec
MLFlexer d923571
update path, and use append instead of insert for prefix_path()
MLFlexer 8f84d7e
update require with alias and add wezterm.plugin.plugin_dir
MLFlexer a5a3b50
update config directory path to push instead of insert
MLFlexer cfc93a2
add docs for wezterm.plugin module
MLFlexer e6190f8
add index.markdown
MLFlexer 800b0dc
fix formatting
MLFlexer a05f37c
Update require_as_alias.md
MLFlexer 0d05a44
Merge branch 'wez:main' into main
MLFlexer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# `wezterm.plugin` module | ||
|
||
{{since('???')}} | ||
|
||
The `wezterm.plugin` module exposes functions that allow working with plugins, among other things installing and updating plugin. | ||
|
||
## Available functions | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# `wezterm.plugin.list()` | ||
|
||
{{since('???')}} | ||
|
||
Returns an array of all the plugins within the plugin directory. | ||
|
||
The elements consists of tables with: | ||
`url` from where the git repository is hosted. | ||
`component`, that is the name of the local root repository root directory. | ||
`plugin_dir` the full path to the repository root directory. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# `wezterm.plugin.plugin_dir()` | ||
|
||
{{since('???')}} | ||
|
||
Returns the path of the plugin root directory. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# `wezterm.plugin.require()` | ||
|
||
{{since('???')}} | ||
|
||
Takes a `url` string as argument, which it will use to clone the git repository if not already cloned, and then require the lua files. | ||
|
||
It will do so by making a directory based on the `url` but with `/` and `\` replaced by `sZs`, `:` replaced by `sCs` and `.` replaced by `sDs`. | ||
It will place this directory in the plugins directory and then clone the repository into it. | ||
|
||
It will try to require `init.lua` from the repository root or in the `plugin/` sub directory. | ||
|
||
It is recommended to use [require_as_alias](./require_as_alias.md) instead to make it easy to require lua files via the alias instead of the modified url name. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# `wezterm.plugin.require_as_alias()` | ||
|
||
{{since('???')}} | ||
|
||
Takes a `url` string and a `alias` string as argument. The alias cannot contain `\`, `/`, `:` or `,`. | ||
|
||
It will make a sub directory with the name of the alias in the plugins sub directory and then clone the git repository from the url into this directory. | ||
|
||
It is assumed that the lua files are placed in a `init.lua` in the repository root or in the `plugin/` sub-directory of the repository root. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# `wezterm.plugin.update_all()` | ||
|
||
{{since('???')}} | ||
|
||
Will update each plugin in the plugin directory, by first fetching, then merging if there are any changes. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am unsure of how to get the correct version for these.