[doc] shell-scripts: explain backend auto-select

This commit is contained in:
Tim Ruffing 2022-06-07 12:17:45 +02:00 committed by Maxi Wolff
parent 02c667e8d8
commit 2556ecd31c

View file

@ -66,13 +66,19 @@ To enable automatic formatting on save, set the layer variable
You have the choice between two different backends You have the choice between two different backends
with different setup instructions and different capabilities. with different setup instructions and different capabilities.
The LSP backend is automatically selected when the =lsp= layer is used.
*** Shell-script-mode *** Shell-script-mode
This is the recommended way for working with shell scripts in emacs. It works This is the recommended way for working with shell scripts in emacs. It works
by using an emacs major mode. by using an emacs major mode.
It supports =bash= and =fish= shell scripts. It supports =bash= and =fish= shell scripts.
No additional setup is necessary. Set =shell-scripts-backend= to =nil= explicitly to use this simple backend even when the =lsp= layer is loaded.
#+BEGIN_SRC elisp
(shell-scripts :variables shell-scripts-backend nil)
#+END_SRC
*** LSP *** LSP
This backend uses an external server to provide the various IDE integrations This backend uses an external server to provide the various IDE integrations
@ -86,15 +92,15 @@ It requires installing the external server via:
npm i -g bash-language-server npm i -g bash-language-server
#+END_SRC #+END_SRC
Enable the =lsp= layer to activate this backend as well as setting the layer You can find further information about the project at its [[https://github.com/mads-hartmann/bash-language-server][GitHub page]].
variable =shell-scripts-backend=:
Set the variable =shell-scripts-backend= to select the LSP backend explicitly.
This will result in the =lsp= layer being loaded.
#+BEGIN_SRC elisp #+BEGIN_SRC elisp
(shell-scripts :variables shell-scripts-backend 'lsp) (shell-scripts :variables shell-scripts-backend 'lsp)
#+END_SRC #+END_SRC
You can find further information about the project at its [[https://github.com/mads-hartmann/bash-language-server][GitHub page]].
* Key bindings * Key bindings
| Key binding | Description | | Key binding | Description |