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:
parent
fecca3188a
commit
d246307f87
2 changed files with 12 additions and 1 deletions
|
@ -624,8 +624,10 @@
|
|||
:desc "Evaluate buffer/region" "e" #'+eval/buffer-or-region
|
||||
:desc "Evaluate & replace region" "E" #'+eval:replace-region
|
||||
:desc "Format buffer/region" "f" #'+format/region-or-buffer
|
||||
:desc "LSP Format buffer/region" "F" #'+default/lsp-format-region-or-buffer
|
||||
:desc "LSP Organize imports" "i" #'lsp-organize-imports
|
||||
:desc "Jump to documentation" "k" #'+lookup/documentation
|
||||
:desc "Open REPL" "r" #'+eval/open-repl-other-window
|
||||
:desc "LSP Rename" "r" #'lsp-rename
|
||||
:desc "Delete trailing whitespace" "w" #'delete-trailing-whitespace
|
||||
:desc "Delete trailing newlines" "W" #'doom/delete-trailing-newlines
|
||||
(:when (featurep! :tools flycheck)
|
||||
|
|
|
@ -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)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue