Editor Setup
Emacs (Eglot)
Important
Syntax highlighting needs Eglot >= 1.20 (introduced
eglot-semantic-tokens-mode). Older Eglot still gets diagnostics, just no colors.Check via
M-x list-packages(findeglot). If too old, install the latest from GNU ELPA:M-x package-refresh-contents M-x package-install RET eglot RETThe ELPA copy shadows the bundled one.
Emacs support is one file, editors/emacs/tango-included-icons.el: a dedicated major mode for included_icons.txt plus the Eglot wiring. There is nothing to install -- pick one of the two ways to load it.
Option A: per file, inside included_icons.txt (recommended)
Put this on the first line of your included_icons.txt. The path is relative to the file's own directory; adjust it to where you keep the submodule.
# -*- eval: (load-file "tango-remixer/editors/emacs/tango-included-icons.el") -*-
It combines with the usual mode cookie, which then serves as the fallback when the eval is declined:
# -*- mode: conf; eval: (load-file "tango-remixer/editors/emacs/tango-included-icons.el") -*-
The same thing as a block at the end of the file (Emacs only looks for this block near the end, so keep it last):
# Local Variables:
# eval: (load-file "tango-remixer/editors/emacs/tango-included-icons.el")
# End:
On first visit Emacs asks whether to run that eval. Press !: the form is then saved to your custom-file and never asked again, and later changes to the .el file don't re-trigger the prompt. Answering y works too, but you'll be asked twice per visit (switching major mode makes Emacs re-read the local variables) and again on every visit.
The prompt is not a defect: it is the only thing standing between "opening a file" and "running code shipped in the repository". Nothing here runs without that one-time consent. If your enable-local-variables is :safe, Emacs silently skips the form instead of asking; allow exactly this form with:
(add-to-list 'safe-local-eval-forms
'(load-file "tango-remixer/editors/emacs/tango-included-icons.el"))
Option B: global init.el setup
Load the file from your init file with an absolute path. It registers auto-mode-alist, so every included_icons.txt you open gets the mode and Eglot; the server is located relative to the .el file itself.
(load "/absolute/path/to/tango-remixer/editors/emacs/tango-included-icons.el")
Trade-off: pins one checkout. Use Option A when each project carries its own tango-remixer/ submodule.
A # -*- mode: conf -*- cookie on the first line of included_icons.txt takes precedence over auto-mode-alist, so with Option B either remove the cookie or change it to # -*- mode: tango-included-icons -*-.
Notes
- The mode starts the server as
python3 lsp/server.pydirectly: no wrapper script, no cwd dependency, works on Windows. If pygls lives in a venv, pointtango-included-icons-pythonat that interpreter in your init file. - Why a dedicated mode instead of
text-mode: Eglot attaches the running server to every buffer in the same project whose major mode derives from the managed one (provided-mode-derived-p). Bound totext-mode, it would grab magit's commit message buffer and spam it with bogus diagnostics.tango-included-icons-modederives fromtext-modebut nothing derives from it, so onlyincluded_icons.txtis managed.
Neovim (nvim-lspconfig)
Bind a custom filetype to the included_icons.txt filename so Neovim only loads the LSP for that one file (not every .txt you open):
-- Map the filename to its own filetype.
vim.filetype.add({
filename = { ["included_icons.txt"] = "included_icons" },
})
-- Register the server, scoped to that filetype.
local lspconfig = require("lspconfig")
local configs = require("lspconfig.configs")
if not configs.tango_icons_lsp then
configs.tango_icons_lsp = {
default_config = {
cmd = { "./resources/tango-remixer/included-icons-lsp" },
filetypes = { "included_icons" },
root_dir = lspconfig.util.root_pattern("included_icons.txt"),
},
}
end
lspconfig.tango_icons_lsp.setup({})
Helix
In ~/.config/helix/languages.toml (or per-project .helix/languages.toml). Register a dedicated language matched by the filename only, so other text files keep their normal treatment:
[language-server.tango-icons]
command = "./resources/tango-remixer/included-icons-lsp"
[[language]]
name = "included-icons"
scope = "text.included-icons"
file-types = [{ glob = "included_icons.txt" }]
language-servers = ["tango-icons"]
VSCode
No first-class support. You need a generic-LSP-client extension, or to write a small wrapper extension yourself. Not documented here.