yara mode for GNU Emacs to edit yara related files.
(require ‘yara-mode)
Install the official YARA-X Language Server (yr-ls) from VirusTotal/yara-x:
cargo install yara-x-lsyara-mode automatically registers yr-ls with eglot. Simply call M-x eglot or add to your init.el:
(add-hook 'yara-mode-hook #'eglot-ensure)To use lsp-mode, add the following to your init.el:
(with-eval-after-load 'lsp-mode
(add-to-list 'lsp-language-id-configuration
'(yara-mode . "yara"))
(lsp-register-client
(make-lsp-client :new-connection (lsp-stdio-connection '("yr-ls"))
:activation-fn (lsp-activate-on-modes 'yara-mode)
:server-id 'yara-x-ls)))
(add-hook 'yara-mode-hook #'lsp-deferred)