Managing Plugins
Lite XL implements many features as plugins. By default, Lite XL comes with a few built-in plugins for essential features such as treeview and workspace, while the Addons package provides more. All plugins can be found at the plugin repository.
Note
These plugins are contributed by the community. Support are provided on a voluntary basis.
Location
Plugins that come bundled with Lite XL is usually stored in DATADIR/plugins
.
DATADIR
is the directory where Lite XL's Lua code is stored.
On macOS, DATADIR
is always the application resources directory.
On other platforms, Lite XL checks whether lite-xl.exe
is inside a directory called bin
.
If true, Lite XL will set DATADIR
as (path to lite-xl.exe)/../share/lite-xl
.
This is similar to how most programs are structured on Unix-based platforms.
Otherwise, Lite XL sets DATADIR
as (path to lite-xl.exe)/data
.
User plugins should be installed into USERDIR/plugins
.
USERDIR
is the directory where user configuration is stored.
Plugin managers
Recently, we've standardized various aspects of the plugin repository to allow for plugins manager such as lpm and Miq to install and manage plugins.
lpm is a plugin manager more akin to distro package managers such as apt
and dnf
.
It also provides a GUI for installing plugins.
Miq is a declarative plugin manager that allows user to declare plugins
and install/update them all at once.
These two plugin managers use vastly different ways of plugin management, so please consult the main page for each plugin manager for exact instructions.
Installing plugins
To install a plugin, simply drag the related plugin file into Historically, Lite XL does not enforce a specific file structure
for these types of plugins.
Old plugins may not have a USERDIR/plugins
.For plugins that comes in a folder, please consult documentation from the plugins.
init.lua
file, which is used by
Lua to find a plugin.
In this case, you need to follow their install instructions.
To install a plugin with lpm, use lpm plugin install
.
For example, to install lsp, run:
This will install/update the lsp plugin.
To install themes or libraries, you can use lpm color install
and lpm library install
respectively.
To install a plugin with Miq, you need to specify the list of plugins to install
in config.plugins.miq.plugins
.
local config = require "core.config"
config.plugins.miq.plugins = {
-- this allows Miq to manage itself
'TorchedSammy/Miq',
-- install lsp
'lite-xl/lite-xl-lsp',
}
Afterwards, you can run the command miq:install
to install the plugins.
Updating plugins
To update a plugin, you'll need to re-download them. For plugins hosted as separate git repositories, you can simply pull new updates.
If you have a plugin manager installed, updating plugins should be easier.
Uninstalling plugins
To remove a plugin, simply delete the associated file/directory.
Recommended plugins
Here are a list of plugins that most users would want:
Plugin | Use case |
---|---|
align_carets | Align text on multiple carets and selections |
autoinsert | Automatically insert closing brackets and quotes |
autosave | Automatically saves the file when it is modified |
bracketmatch | Highlight matching brackets |
editorconfig | EditorConfig support for Lite XL |
ephemeral_tabs | Ephemeral tabs (previewing files without creating multiple tabs) |
gitdiff_highlight | Git diff gutter |
indentguide | Indent guides |
lint+ | Linter support |
litepresence | Discord rich presence |
lsp | Language Server support for Lite XL |
lspkind | Completion menu kind/type icons for Lite XL LSP |
minimap | Minimap |
selectionhighlight | Highlight code that matches the selection |
settings | Settings GUI for Lite XL (requires the [widget] plugin) |
widgets | Widget toolkit for Lite XL. Needed for lsp and settings. |
Feature / Plugin Requests
If no plugins provide the features you wanted, you can request them in the issue tracker. Plugin developers occasionally browse the issue tracker for requests and implement them.
Alternatively, you can take the opportunity to implement the feature yourself, based on various documentation and existing plugins.