mirror of
https://github.com/doomemacs/doomemacs
synced 2025-09-10 15:33:36 -05:00
config/default: bind SPC c {F,i,r} to LSP commands
These are experimental keybinds. I'm looking for a way to integrate LSP's formatter commands (and lsp-organize-imports) into the :editor format module. And a way to unify refactoring commands (perhaps with emr or erefactor), including lsp-rename. - 'SPC c F' -> format region or buffer - 'SPC c i' -> organize imports - 'SPC c r' -> rename symbol at point Addresses #1417
This commit is contained in:
@@ -315,3 +315,12 @@ ARG is set, prompt for a known project to search from."
|
||||
(interactive)
|
||||
(doom-completing-read-org-headings
|
||||
"Jump to org headline: " org-agenda-files 3 t))
|
||||
|
||||
;;;###autoload
|
||||
(defun +default/lsp-format-region-or-buffer ()
|
||||
"Format the buffer (or selection) with LSP."
|
||||
(interactive)
|
||||
(call-interactively
|
||||
(if (use-region-p)
|
||||
#'lsp-format-region
|
||||
#'lsp-format-buffer)))
|
||||
|
Reference in New Issue
Block a user