summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorbscan <10503608+bscan@users.noreply.github.com>2023-01-02 20:07:38 -0500
committerbscan <10503608+bscan@users.noreply.github.com>2023-01-02 20:07:38 -0500
commita7b3aaba53820a671a534fdf0b6d6d3c474b2fcc (patch)
treeba04330207affb59b995fe507c563610de7f8e09 /README.md
parentb302fc7cc9ce013255d933c56ff9790a726b6132 (diff)
downloadPerlNavigator-a7b3aaba53820a671a534fdf0b6d6d3c474b2fcc.zip
Adding eglot instructions. Fixes #57
Diffstat (limited to 'README.md')
-rw-r--r--README.md24
1 files changed, 23 insertions, 1 deletions
diff --git a/README.md b/README.md
index 0a1c9a4..c556aad 100644
--- a/README.md
+++ b/README.md
@@ -79,8 +79,30 @@ Sublime Text requires the following minimum settings under LSP settings (modify
![gif of Navigator in sublime](https://raw.githubusercontent.com/bscan/PerlNavigator/main/images/Sublime.gif)
### Emacs
-Emacs requires lsp-mode. You can use something similar to the following configuration.
+You can use perl navigator with either lsp-mode or eglot. Eglot is built-in starting with emacs version 29.
+
+#### Emacs eglot
+The following is a sample configuration file to use the navigator with emacs and a custom perl location.
+This config uses company-mode, but is not required.
+``` lisp
+ (setq-default eglot-workspace-configuration
+ '((:perlnavigator . (:perlPath
+ "/path/to/perl"
+ :enableWarnings t))))
+
+(with-eval-after-load 'eglot
+ (add-to-list 'eglot-server-programs
+ `((cperl-mode perl-mode) . ("/path/to/perlnavigator", "--stdio"))))
+
+(global-company-mode)
+
+(add-hook 'cperl-mode-hook 'eglot-ensure)
+(add-hook 'perl-mode-hook 'eglot-ensure)
```
+
+#### Emacs lsp-mode
+You can also use lsp-mode with emacs if you prefer. You can use something similar to the following configuration. Additional details [here](https://emacs-lsp.github.io/lsp-mode/page/lsp-perlnavigator/)
+``` lisp
(require 'lsp-mode)
(add-to-list 'lsp-language-id-configuration '(perl-mode . "perl"))
(add-to-list 'lsp-language-id-configuration '(cperl-mode . "perl"))