mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
lang/nix: add a repl handler
This commit is contained in:
@ -5,6 +5,13 @@
|
|||||||
(nixos-options-doc-buffer
|
(nixos-options-doc-buffer
|
||||||
(nixos-options-get-documentation-for-option candidate))))
|
(nixos-options-get-documentation-for-option candidate))))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun +nix/open-repl ()
|
||||||
|
"Open a nix repl."
|
||||||
|
(interactive)
|
||||||
|
(nix-repl-show)
|
||||||
|
(current-buffer))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +nix/lookup-option (&optional initial-input)
|
(defun +nix/lookup-option (&optional initial-input)
|
||||||
"Look up documentation on a nix option."
|
"Look up documentation on a nix option."
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
:interpreter ("\\(?:cached-\\)?nix-shell" . +nix-shell-init-mode)
|
:interpreter ("\\(?:cached-\\)?nix-shell" . +nix-shell-init-mode)
|
||||||
:mode "\\.nix\\'"
|
:mode "\\.nix\\'"
|
||||||
:config
|
:config
|
||||||
|
(set-repl-handler! 'nix-mode #'+nix/open-repl)
|
||||||
(set-company-backend! 'nix-mode 'company-nixos-options)
|
(set-company-backend! 'nix-mode 'company-nixos-options)
|
||||||
(set-lookup-handlers! 'nix-mode
|
(set-lookup-handlers! 'nix-mode
|
||||||
:documentation '(+nix/lookup-option :async t))
|
:documentation '(+nix/lookup-option :async t))
|
||||||
|
Reference in New Issue
Block a user