Previous: Eglot Commands, Up: Using Eglot [Contents][Index]
This section provides a reference for the Eglot user options.
eglot-autoreconnect
¶This option controls the ability to reconnect automatically to the
language server when Eglot detects that the server process terminated
unexpectedly. The default value 3
means to attempt reconnection only
if the previous successful connection lasted for more than that number
of seconds; a different positive value changes the minimal length of
the connection to trigger reconnection. A value of t
means
always reconnect automatically, and nil
means never reconnect
(in which case you will need to reconnect manually using M-x
eglot).
eglot-connect-timeout
¶This specifies the number of seconds before connection attempt to a
language server times out. The value of nil
means never time
out. The default is 30 seconds.
eglot-sync-connect
¶This setting is mainly important for connections which are slow to
establish. Whereas the variable eglot-connect-timeout
controls
how long to wait for, this variable controls whether to block Emacs’s
user interface while waiting. The default value is 3
; a positive
value means block for that many seconds, then wait for the connection
in the background. The value of t
means block during the whole
waiting period. The value of nil
or 0
means don’t block at
all during the waiting period.
eglot-events-buffer-config
¶This configures the size and format of the Eglot events buffer. See eglot-events-buffer, for how to access that buffer. If the value is changed, the connection should be restarted using M-x eglot-reconnect for the new value to take effect. See Troubleshooting Eglot, for when this could be useful.
eglot-autoshutdown
¶If this is non-nil
, Eglot shuts down a language server when the
last buffer managed by it is killed. See Shutting Down LSP Servers.
The default is nil
; if you want to shut down a server, use
M-x eglot-shutdown (see Eglot Commands).
eglot-confirm-server-edits
¶Various Eglot commands and code actions result in the language server
sending editing commands to Emacs. If this option’s value is
non-nil
, Eglot will ask for confirmation before performing
edits proposed by the language server. This option’s value can be
crafted to require this confirmation for specific commands or only
when the edit affects files not yet visited by the user. Consult this
option’s docstring for more information.
eglot-ignored-server-capabilities
¶This variable’s value is a list of language server capabilities that
Eglot should not use. The default is nil
: Eglot uses all of
the capabilities supported by each server.
eglot-extend-to-xref
¶If this is non-nil
, and M-.
(xref-find-definitions
) lands you in a file outside of your
project, such as a system-installed library or header file,
transiently consider that file as managed by the same language server.
That file is still outside your project (i.e., project-find-file
won’t find it), but Eglot and the server will consider it to be part
of the workspace. The default is nil
.
eglot-mode-map
¶This variable is the keymap for binding Eglot-related command. It is
in effect only as long as the buffer is managed by Eglot. By default,
it is empty, with the single exception: C-h . is remapped to
invoke eldoc-doc-buffer
. You can bind additional commands in
this map. For example:
(define-key eglot-mode-map (kbd "C-c r") 'eglot-rename) (define-key eglot-mode-map (kbd "C-c o") 'eglot-code-action-organize-imports) (define-key eglot-mode-map (kbd "C-c h") 'eldoc) (define-key eglot-mode-map (kbd "<f6>") 'xref-find-definitions)
Additional variables, which are relevant for customizing the server connections, are documented in Customizing Eglot.
Previous: Eglot Commands, Up: Using Eglot [Contents][Index]