Skip to content

Commit

Permalink
Add fancy-narrow
Browse files Browse the repository at this point in the history
  • Loading branch information
peel committed Apr 23, 2024
1 parent c10d133 commit 9efbe32
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion modules/common/setup/emacs/default.el
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,21 @@
;; (alert status :title "Compilation" :severity 'trivial)
(call-process "osascript" nil 0 nil "-e"
(concat "display notification \"Compilation: " status "\" with title \"Emacs\""))))

(use-package fancy-narrow
:ensure t
:bind (("C-x n n" . peel/fancy-narrow-dwim)
("C-x n d" . fancy-narrow-to-defun)
("C-x n w" . fancy-widen))
:config
(defun peel/fancy-narrow-dwim ()
(interactive)
(if fancy-narrow--beginning
(fancy-widen)
(unless (region-active-p)
(mark-paragraph -1))
(call-interactively 'fancy-narrow-to-region))))

(use-package eglot
:bind (("C-c C-l s" . eglot)
(:map eglot-mode-map
Expand All @@ -265,6 +280,8 @@
("C-c C-l q" . eglot-shutdown)
("C-c C-l h" . flymake-show-project-diagnostics)))
:after (:all envrc inheritenv)
:custom
(eldoc-echo-area-use-multiline-p 5)
:config
(advice-add 'eglot :before #'envrc-reload)
(defun peel/eglot-imports ()
Expand All @@ -279,9 +296,20 @@
:assignVariableTypes t
:compositeLiteralFields t
:compositeLiteralTypes t
:constantValues t))))
:constantValues t)))))
(add-to-list 'eglot-server-programs
'((rust-ts-mode rust-mode) .
("rust-analyzer" :initializationOptions (:check (:command "clippy")))))
(add-to-list 'eglot-server-programs
'(scala-mode .
("metals" :initializationOptions
(:metals (:isHttpEnabled t
:automaticImportBuild t
:inlayHints
(:typeParameters (:enable t)
:hintsInPatternMatch (:enable t)
:implicitConversions (:enable t)
:inferredTypes (:enable t)))))))
:hook ((scala-mode . eglot-ensure)
(js-mode . eglot-ensure)
(typescript-mode . eglot-ensure)
Expand Down

0 comments on commit 9efbe32

Please sign in to comment.