General, minor refactor & reformatting
This commit is contained in:
parent
2ecd100c38
commit
169f9a6121
22 changed files with 161 additions and 177 deletions
|
@ -128,7 +128,8 @@ installed."
|
|||
'builtin)
|
||||
((assq package package-alist)
|
||||
'elpa)
|
||||
('other)))
|
||||
((locate-library (symbol-name package))
|
||||
'other)))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom-package-different-recipe-p (name)
|
||||
|
|
|
@ -34,8 +34,9 @@ all themes. It will apply to all themes once they are loaded."
|
|||
(defmacro custom-set-faces! (&rest specs)
|
||||
"Apply a list of face SPECS as user customizations.
|
||||
|
||||
This is a drop-in replacement for `custom-set-face' that allows for a simplified
|
||||
face format."
|
||||
This is a convenience macro alternative to `custom-set-face' which allows for a
|
||||
simplified face format, and takes care of load order issues, so you can use
|
||||
doom-themes' API without worry."
|
||||
(declare (indent defun))
|
||||
`(custom-theme-set-faces! 'user ,@specs))
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
(defun +spell-inhibit-duplicate-detection-maybe-h ()
|
||||
"Don't mark duplicates when style/grammar linters are present.
|
||||
e.g. proselint and langtool."
|
||||
(when (or (and (bound-and-true-p flycheck-mode)
|
||||
(and (or (and (bound-and-true-p flycheck-mode)
|
||||
(executable-find "proselint"))
|
||||
(featurep 'langtool))
|
||||
(setq-local flyspell-mark-duplications-flag nil))))
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
(setq flycheck-emacs-lisp-load-path 'inherit)
|
||||
|
||||
;; Check only when saving or opening files. Newline & idle checks are a mote
|
||||
;; excessive, especially when that can easily catch code in an incomplete
|
||||
;; state, so we removed them.
|
||||
;; excessive and can catch code in an incomplete state, producing false
|
||||
;; positives, so we removed them.
|
||||
(setq flycheck-check-syntax-automatically '(save mode-enabled))
|
||||
|
||||
;; Display errors a little quicker (default is 0.9s)
|
||||
|
@ -41,7 +41,7 @@
|
|||
|
||||
(use-package! flycheck-popup-tip
|
||||
:commands flycheck-popup-tip-show-popup flycheck-popup-tip-delete-popup
|
||||
:init (add-hook 'flycheck-mode-hook #'+syntax-init-popups-h)
|
||||
:hook (flycheck-mode . +syntax-init-popups-h)
|
||||
:config
|
||||
(setq flycheck-popup-tip-error-prefix "✕ ")
|
||||
(after! evil
|
||||
|
@ -58,8 +58,7 @@
|
|||
|
||||
(use-package! flycheck-posframe
|
||||
:when (featurep! +childframe)
|
||||
:defer t
|
||||
:init (add-hook 'flycheck-mode-hook #'+syntax-init-popups-h)
|
||||
:hook (flycheck-mode . +syntax-init-popups-h)
|
||||
:config
|
||||
(setq flycheck-posframe-warning-prefix "⚠ "
|
||||
flycheck-posframe-info-prefix "··· "
|
||||
|
|
|
@ -4,18 +4,15 @@
|
|||
:commands company-complete-common company-manual-begin company-grab-line
|
||||
:after-call pre-command-hook after-find-file
|
||||
:init
|
||||
(setq company-minimum-prefix-length 2
|
||||
(setq company-idle-delay 0.25
|
||||
company-minimum-prefix-length 2
|
||||
company-tooltip-limit 14
|
||||
company-dabbrev-downcase nil
|
||||
company-dabbrev-ignore-case nil
|
||||
company-dabbrev-code-other-buffers t
|
||||
company-tooltip-align-annotations t
|
||||
company-require-match 'never
|
||||
company-global-modes
|
||||
'(not erc-mode message-mode help-mode gud-mode eshell-mode)
|
||||
company-backends '(company-capf)
|
||||
company-frontends
|
||||
'(company-pseudo-tooltip-frontend
|
||||
company-frontends '(company-pseudo-tooltip-frontend
|
||||
company-echo-metadata-frontend))
|
||||
:config
|
||||
(when (featurep! :editor evil)
|
||||
|
|
|
@ -297,7 +297,7 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
|
|||
;; no highlighting visited files; slows down the filtering
|
||||
(ivy-set-display-transformer #'counsel-projectile-find-file nil)
|
||||
|
||||
(if (featurep! +prescient)
|
||||
(when (featurep! +prescient)
|
||||
(setq counsel-projectile-sort-files t)))
|
||||
|
||||
|
||||
|
|
|
@ -553,10 +553,10 @@
|
|||
:desc "Find recent project files" "r" #'projectile-recentf
|
||||
:desc "Run project" "R" #'projectile-run-project
|
||||
:desc "Save project files" "s" #'projectile-save-project-buffers
|
||||
:desc "Pop up scratch buffer" "x" #'doom/open-project-scratch-buffer
|
||||
:desc "Switch to scratch buffer" "X" #'doom/switch-to-project-scratch-buffer
|
||||
:desc "List project tasks" "t" #'magit-todos-list
|
||||
:desc "Test project" "T" #'projectile-test-project)
|
||||
:desc "Test project" "T" #'projectile-test-project
|
||||
:desc "Pop up scratch buffer" "x" #'doom/open-project-scratch-buffer
|
||||
:desc "Switch to scratch buffer" "X" #'doom/switch-to-project-scratch-buffer)
|
||||
|
||||
;;; <leader> q --- quit/session
|
||||
(:prefix-map ("q" . "quit/session")
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
;;; config/default/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(defvar +default-minibuffer-maps
|
||||
`(minibuffer-local-map
|
||||
(append '(minibuffer-local-map
|
||||
minibuffer-local-ns-map
|
||||
minibuffer-local-completion-map
|
||||
minibuffer-local-must-match-map
|
||||
minibuffer-local-isearch-map
|
||||
read-expression-map
|
||||
,@(cond ((featurep! :completion ivy)
|
||||
read-expression-map)
|
||||
(cond ((featurep! :completion ivy)
|
||||
'(ivy-minibuffer-map
|
||||
ivy-switch-buffer-map))
|
||||
((featurep! :completion helm)
|
||||
|
@ -254,6 +254,7 @@
|
|||
"s-c" (if (featurep 'evil) #'evil-yank #'copy-region-as-kill)
|
||||
"s-v" #'yank
|
||||
"s-s" #'save-buffer
|
||||
"s-x" #'execute-extended-command
|
||||
:v "s-x" #'kill-region
|
||||
;; Buffer-local font scaling
|
||||
"s-+" #'doom/reset-font-size
|
||||
|
|
|
@ -33,28 +33,24 @@ This is ignored by ccls.")
|
|||
;;; Packages
|
||||
|
||||
(use-package! cc-mode
|
||||
:commands (c-mode c++-mode objc-mode java-mode)
|
||||
:mode ("\\.mm\\'" . objc-mode)
|
||||
:init
|
||||
;; Activate `c-mode', `c++-mode' or `objc-mode' depending on heuristics
|
||||
(add-to-list 'auto-mode-alist '("\\.h\\'" . +cc-c-c++-objc-mode))
|
||||
|
||||
;; Ensure find-file-at-point works in C modes, must be added before irony
|
||||
;; and/or lsp hooks are run.
|
||||
(add-hook! '(c-mode-local-vars-hook
|
||||
c++-mode-local-vars-hook
|
||||
objc-mode-local-vars-hook)
|
||||
#'+cc-init-ffap-integration-h)
|
||||
|
||||
;; Use `c-mode'/`c++-mode'/`objc-mode' depending on heuristics
|
||||
:mode ("\\.h\\'" . +cc-c-c++-objc-mode)
|
||||
;; Ensure find-file-at-point recognize system libraries in C modes. It must be
|
||||
;; set up before the likes of irony/lsp are initialized. Also, we use
|
||||
;; local-vars hooks to ensure these only run in their respective major modes,
|
||||
;; and not their derived modes.
|
||||
:hook ((after-c-mode after-c++-mode after-objc-mode) . +cc-init-ffap-integration-h)
|
||||
;;; Improve fontification in C/C++ (also see `modern-cpp-font-lock')
|
||||
:hook (c-mode-common . rainbow-delimiters-mode)
|
||||
:hook ((c-mode c++-mode) . +cc-fontify-constants-h)
|
||||
:config
|
||||
(set-electric! '(c-mode c++-mode objc-mode java-mode) :chars '(?\n ?\} ?\{))
|
||||
(set-docsets! 'c-mode "C")
|
||||
(set-docsets! 'c++-mode "C++" "Boost")
|
||||
|
||||
(set-electric! '(c-mode c++-mode objc-mode java-mode) :chars '(?\n ?\} ?\{))
|
||||
(set-rotate-patterns! 'c++-mode
|
||||
:symbols '(("public" "protected" "private")
|
||||
("class" "struct")))
|
||||
|
||||
(set-pretty-symbols! '(c-mode c++-mode)
|
||||
;; Functional
|
||||
;; :def "void "
|
||||
|
@ -71,10 +67,6 @@ This is ignored by ccls.")
|
|||
:return "return"
|
||||
:yield "#require")
|
||||
|
||||
;;; Better fontification (also see `modern-cpp-font-lock')
|
||||
(add-hook 'c-mode-common-hook #'rainbow-delimiters-mode)
|
||||
(add-hook! '(c-mode-hook c++-mode-hook) #'+cc-fontify-constants-h)
|
||||
|
||||
;; Custom style, based off of linux
|
||||
(setq c-basic-offset tab-width
|
||||
c-backspace-function #'delete-backward-char)
|
||||
|
@ -122,23 +114,21 @@ This is ignored by ccls.")
|
|||
|
||||
(use-package! irony
|
||||
:unless (featurep! +lsp)
|
||||
:commands (irony-install-server irony-mode)
|
||||
:preface
|
||||
(setq irony-server-install-prefix (concat doom-etc-dir "irony-server/"))
|
||||
:init
|
||||
(add-hook! '(c-mode-local-vars-hook
|
||||
c++-mode-local-vars-hook
|
||||
objc-mode-local-vars-hook)
|
||||
(defun +cc-init-irony-mode-h ()
|
||||
(if (file-directory-p irony-server-install-prefix)
|
||||
(irony-mode +1)
|
||||
(message "Irony server isn't installed"))))
|
||||
:config
|
||||
(setq irony-cdb-search-directory-list '("." "build" "build-conda"))
|
||||
|
||||
:commands irony-install-server
|
||||
;; Initialize compilation database, if present. Otherwise, fall back on
|
||||
;; `+cc-default-compiler-options'.
|
||||
(add-hook 'irony-mode-hook #'+cc-init-irony-compile-options-h)
|
||||
:hook (irony-mode . +cc-init-irony-compile-options-h)
|
||||
;; Only initialize `irony-mode' if the server is available. Otherwise fail
|
||||
;; quietly and gracefully.
|
||||
:hook ((after-c-mode after-c++-mode after-objc-mode) . +cc-init-irony-mode-maybe-h)
|
||||
:preface (setq irony-server-install-prefix (concat doom-etc-dir "irony-server/"))
|
||||
:config
|
||||
(defun +cc-init-irony-mode-maybe-h ()
|
||||
(if (file-directory-p irony-server-install-prefix)
|
||||
(irony-mode +1)
|
||||
(message "Irony server isn't installed")))
|
||||
|
||||
(setq irony-cdb-search-directory-list '("." "build" "build-conda"))
|
||||
|
||||
(use-package! irony-eldoc
|
||||
:hook (irony-mode . irony-eldoc))
|
||||
|
@ -149,19 +139,15 @@ This is ignored by ccls.")
|
|||
|
||||
(use-package! company-irony
|
||||
:when (featurep! :completion company)
|
||||
:init
|
||||
(set-company-backend! 'irony-mode
|
||||
'(:separate company-irony-c-headers company-irony))
|
||||
:config
|
||||
(require 'company-irony-c-headers)))
|
||||
:init (set-company-backend! 'irony-mode '(:separate company-irony-c-headers company-irony))
|
||||
:config (require 'company-irony-c-headers)))
|
||||
|
||||
|
||||
;;
|
||||
;; Major modes
|
||||
|
||||
(use-package! cmake-mode
|
||||
:defer t
|
||||
:config (set-docsets! 'cmake-mode "CMake"))
|
||||
(after! cmake-mode
|
||||
(set-docsets! 'cmake-mode "CMake"))
|
||||
|
||||
(use-package! company-cmake ; for `cmake-mode'
|
||||
:when (featurep! :completion company)
|
||||
|
@ -184,19 +170,17 @@ This is ignored by ccls.")
|
|||
|
||||
(use-package! rtags
|
||||
:unless (featurep! +lsp)
|
||||
:commands rtags-executable-find
|
||||
:preface
|
||||
(setq rtags-install-path (concat doom-etc-dir "rtags/"))
|
||||
:init
|
||||
(add-hook! '(c-mode-local-vars-hook
|
||||
c++-mode-local-vars-hook
|
||||
objc-mode-local-vars-hook)
|
||||
(defun +cc-init-rtags-h ()
|
||||
"Start an rtags server in c-mode and c++-mode buffers."
|
||||
(when (and (require 'rtags nil t)
|
||||
(rtags-executable-find rtags-rdm-binary-name))
|
||||
(rtags-start-process-unless-running))))
|
||||
;; Only initialize rtags-mode if rtags and rdm are available.
|
||||
:hook ((after-c-mode after-c++-mode after-objc-mode) . +cc-init-rtags-maybe-h)
|
||||
:preface (setq rtags-install-path (concat doom-etc-dir "rtags/"))
|
||||
:config
|
||||
(defun +cc-init-rtags-maybe-h ()
|
||||
"Start an rtags server in c-mode and c++-mode buffers.
|
||||
If rtags or rdm aren't available, fail silently instead of throwing a breaking error."
|
||||
(and (require 'rtags nil t)
|
||||
(rtags-executable-find rtags-rdm-binary-name)
|
||||
(rtags-start-process-unless-running)))
|
||||
|
||||
(setq rtags-autostart-diagnostics t
|
||||
rtags-use-bookmarks nil
|
||||
rtags-completions-enabled nil
|
||||
|
@ -221,11 +205,13 @@ This is ignored by ccls.")
|
|||
:definition #'rtags-find-symbol-at-point
|
||||
:references #'rtags-find-references-at-point)
|
||||
|
||||
(add-hook! 'kill-emacs-hook (ignore-errors (rtags-cancel-process)))
|
||||
|
||||
;; Use rtags-imenu instead of imenu/counsel-imenu
|
||||
(define-key! (c-mode-map c++-mode-map) [remap imenu] #'+cc/imenu)
|
||||
|
||||
;; Ensure rtags cleans up after itself properly when exiting Emacs, rather
|
||||
;; than display a jarring confirmation prompt for killing it.
|
||||
(add-hook! 'kill-emacs-hook (ignore-errors (rtags-cancel-process)))
|
||||
|
||||
(add-hook 'rtags-jump-hook #'better-jumper-set-jump)
|
||||
(add-hook 'rtags-after-find-file-hook #'recenter))
|
||||
|
||||
|
|
|
@ -72,11 +72,11 @@
|
|||
(setq company-coq-disabled-features '(hello company-defaults))
|
||||
|
||||
(if (featurep! :completion company)
|
||||
(map! :map coq-mode-map [remap company-complete-common]
|
||||
(define-key coq-mode-map [remap company-complete-common]
|
||||
#'company-indent-or-complete-common)
|
||||
;; `company-coq''s company defaults impose idle-completion on folks, so
|
||||
;; we'll set up company ourselves.
|
||||
;; See https://github.com/cpitclaudel/company-coq/issues/42
|
||||
;; we'll set up company ourselves. See
|
||||
;; https://github.com/cpitclaudel/company-coq/issues/42
|
||||
(add-to-list 'company-coq-disabled-features 'company))
|
||||
|
||||
(map! :map coq-mode-map
|
||||
|
|
|
@ -8,3 +8,8 @@
|
|||
(sp-point-after-word-p id action context))
|
||||
((eq action 'autoskip)
|
||||
(/= (char-before) 32)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +csharp-kill-omnisharp-server-h ()
|
||||
(unless (doom-buffers-in-mode 'csharp-mode (buffer-list))
|
||||
(omnisharp-stop-server)))
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
;;; lang/csharp/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(after! csharp-mode
|
||||
(add-hook 'csharp-mode-hook #'rainbow-delimiters-mode)
|
||||
|
||||
(use-package! csharp-mode
|
||||
:hook (csharp-mode . rainbow-delimiters-mode)
|
||||
:config
|
||||
(set-electric! 'csharp-mode :chars '(?\n ?\}))
|
||||
(set-rotate-patterns! 'csharp-mode
|
||||
:symbols '(("public" "protected" "private")
|
||||
("class" "struct")))
|
||||
|
||||
(sp-local-pair 'csharp-mode "<" ">"
|
||||
:when '(+csharp-sp-point-in-type-p)
|
||||
:post-handlers '(("| " "SPC")))
|
||||
|
@ -17,25 +18,22 @@
|
|||
|
||||
(use-package! omnisharp
|
||||
:unless (featurep! +lsp)
|
||||
:hook (csharp-mode-local-vars . omnisharp-mode)
|
||||
:commands omnisharp-install-server
|
||||
:hook (csharp-mode-local-vars . omnisharp-mode)
|
||||
:preface
|
||||
(setq omnisharp-auto-complete-want-documentation nil
|
||||
omnisharp-cache-directory (concat doom-etc-dir "omnisharp"))
|
||||
:config
|
||||
(defun +csharp-cleanup-omnisharp-server-h ()
|
||||
"Clean up the omnisharp server once you kill the last csharp-mode buffer."
|
||||
(unless (doom-buffers-in-mode 'csharp-mode (buffer-list))
|
||||
(omnisharp-stop-server)))
|
||||
(add-hook! 'omnisharp-mode-hook
|
||||
(add-hook 'kill-buffer-hook #'+csharp-cleanup-omnisharp-server-h nil t))
|
||||
|
||||
(set-company-backend! 'omnisharp-mode 'company-omnisharp)
|
||||
(set-lookup-handlers! 'omnisharp-mode
|
||||
:definition #'omnisharp-go-to-definition
|
||||
:references #'omnisharp-find-usages
|
||||
:documentation #'omnisharp-current-type-documentation)
|
||||
|
||||
;; Kill the omnisharp server once the last csharp-mode buffer is killed
|
||||
(add-hook! 'omnisharp-mode-hook
|
||||
(add-hook 'kill-buffer-hook #'+csharp-cleanup-omnisharp-server-h nil t))
|
||||
|
||||
(map! :localleader
|
||||
:map omnisharp-mode-map
|
||||
"b" #'omnisharp-recompile
|
||||
|
@ -60,11 +58,11 @@
|
|||
"b" #'omnisharp-unit-test-buffer)))
|
||||
|
||||
|
||||
;;;###package shader-mode
|
||||
(when (featurep! +unity)
|
||||
;; Unity shaders
|
||||
(add-to-list 'auto-mode-alist '("\\.shader\\'" . shader-mode))
|
||||
|
||||
;; Unity shaders
|
||||
(use-package! shader-mode
|
||||
:when (featurep! +unity)
|
||||
:mode "\\.shader\\'"
|
||||
:config
|
||||
(def-project-mode! +csharp-unity-mode
|
||||
:modes '(csharp-mode shader-mode)
|
||||
:files (and "Assets" "Library/MonoManager.asset" "Library/ScriptMapper")))
|
||||
|
|
|
@ -2,9 +2,7 @@
|
|||
;;; lang/csharp/packages.el
|
||||
|
||||
(package! csharp-mode :pin "57bd21bda4")
|
||||
|
||||
(unless (featurep! +lsp)
|
||||
(package! omnisharp :pin "e658a18a76"))
|
||||
|
||||
(when (featurep! +unity)
|
||||
(package! shader-mode :pin "d7dc8d0d6f"))
|
||||
|
|
|
@ -37,31 +37,30 @@
|
|||
(sp-local-pair "fn " " end" :unless '(sp-in-comment-p sp-in-string-p)))
|
||||
|
||||
(when (featurep! +lsp)
|
||||
(add-hook 'elixir-mode-local-vars-hook #'lsp!))
|
||||
(add-hook 'elixir-mode-local-vars-hook #'lsp!)))
|
||||
|
||||
(use-package! flycheck-credo
|
||||
|
||||
(use-package! flycheck-credo
|
||||
:when (featurep! :checkers syntax)
|
||||
:config (flycheck-credo-setup)))
|
||||
:after elixir-mode
|
||||
:config (flycheck-credo-setup))
|
||||
|
||||
|
||||
(use-package! alchemist
|
||||
:hook (elixir-mode . alchemist-mode)
|
||||
:init
|
||||
(after! elixir-mode
|
||||
(set-lookup-handlers! 'elixir-mode
|
||||
:config
|
||||
(set-lookup-handlers! 'alchemist-mode
|
||||
:definition #'alchemist-goto-definition-at-point
|
||||
:documentation #'alchemist-help-search-at-point)
|
||||
(set-eval-handler! 'elixir-mode #'alchemist-eval-region)
|
||||
(set-repl-handler! 'elixir-mode #'alchemist-iex-project-run)))
|
||||
(set-eval-handler! 'alchemist-mode #'alchemist-eval-region)
|
||||
(set-repl-handler! 'alchemist-mode #'alchemist-iex-project-run))
|
||||
|
||||
|
||||
(use-package! alchemist-company
|
||||
:when (featurep! :completion company)
|
||||
:commands alchemist-company
|
||||
:init
|
||||
(after! elixir-mode
|
||||
(set-company-backend! 'elixir-mode '(alchemist-company company-yasnippet)))
|
||||
:config
|
||||
(set-company-backend! 'alchemist-mode '(alchemist-company company-yasnippet))
|
||||
;; Alchemist doesn't use hook symbols to add these backends, so we have to use
|
||||
;; the entire closure to get rid of it.
|
||||
(let ((fn (byte-compile (lambda () (add-to-list (make-local-variable 'company-backends) 'alchemist-company)))))
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
(:prefix ("ri" . "imports")
|
||||
"a" #'go-import-add
|
||||
"r" #'go-remove-unused-imports)
|
||||
(:prefix ( "b" . "build")
|
||||
(:prefix ("b" . "build")
|
||||
:desc "go run ." "r" (λ! (compile "go run ."))
|
||||
:desc "go build" "b" (λ! (compile "go build"))
|
||||
:desc "go clean" "c" (λ! (compile "go clean")))
|
||||
|
|
|
@ -58,11 +58,7 @@
|
|||
mode-name "JS2")
|
||||
|
||||
(set-electric! 'js2-mode :chars '(?\} ?\) ?. ?:))
|
||||
(set-repl-handler! 'js2-mode #'+javascript/open-repl)
|
||||
|
||||
(map! :map js2-mode-map
|
||||
:localleader
|
||||
"S" #'+javascript/skewer-this-buffer))
|
||||
(set-repl-handler! 'js2-mode #'+javascript/open-repl))
|
||||
|
||||
|
||||
(use-package! rjsx-mode
|
||||
|
@ -84,10 +80,10 @@
|
|||
;; jshint doesn't know how to deal with jsx
|
||||
(push 'javascript-jshint flycheck-disabled-checkers)))
|
||||
|
||||
;; `rjsx-electric-gt' relies on js2's parser to tell it when the cursor is in
|
||||
;; a self-closing tag, so that it can insert a matching ending tag at point.
|
||||
;; However, the parser doesn't run immediately, so a fast typist can outrun
|
||||
;; it, causing tags to stay unclosed, so we force it to parse.
|
||||
;; HACK `rjsx-electric-gt' relies on js2's parser to tell it when the cursor
|
||||
;; is in a self-closing tag, so that it can insert a matching ending tag
|
||||
;; at point. The parser doesn't run immediately however, so a fast typist
|
||||
;; can outrun it, causing tags to stay unclosed, so force it to parse:
|
||||
(defadvice! +javascript-reparse-a (n)
|
||||
;; if n != 1, rjsx-electric-gt calls rjsx-maybe-reparse itself
|
||||
:before #'rjsx-electric-gt
|
||||
|
@ -95,7 +91,7 @@
|
|||
|
||||
|
||||
(use-package! typescript-mode
|
||||
:defer t
|
||||
:hook (typescript-mode . rainbow-delimiters-mode)
|
||||
:init
|
||||
;; REVIEW Fix #2252. This is overwritten if the :lang web module is enabled.
|
||||
;; We associate TSX files with `web-mode' by default instead because
|
||||
|
@ -104,9 +100,6 @@
|
|||
(unless (featurep! :lang web)
|
||||
(add-to-list 'auto-mode-alist '("\\.tsx\\'" . typescript-mode)))
|
||||
:config
|
||||
(add-hook 'typescript-mode-hook #'rainbow-delimiters-mode)
|
||||
(setq-hook! 'typescript-mode-hook
|
||||
comment-line-break-function #'js2-line-break)
|
||||
(set-electric! 'typescript-mode
|
||||
:chars '(?\} ?\)) :words '("||" "&&"))
|
||||
(set-docsets! 'typescript-mode "TypeScript" "AngularTS")
|
||||
|
@ -125,7 +118,10 @@
|
|||
:not "!"
|
||||
:and "&&" :or "||"
|
||||
:for "for"
|
||||
:return "return" :yield "import"))
|
||||
:return "return" :yield "import")
|
||||
;; HACK Fixes comment continuation on newline
|
||||
(setq-hook! 'typescript-mode-hook
|
||||
comment-line-break-function #'js2-line-break))
|
||||
|
||||
|
||||
;;;###package coffee-mode
|
||||
|
@ -254,6 +250,7 @@ to tide."
|
|||
(map! :localleader
|
||||
(:after js2-mode
|
||||
:map js2-mode-map
|
||||
"S" #'+javascript/skewer-this-buffer
|
||||
:prefix ("s" . "skewer"))
|
||||
:prefix "s"
|
||||
(:after skewer-mode
|
||||
|
@ -278,13 +275,12 @@ to tide."
|
|||
(use-package! npm-mode
|
||||
:hook ((js-mode typescript-mode) . npm-mode)
|
||||
:config
|
||||
(map! (:localleader
|
||||
:map npm-mode-keymap
|
||||
(map! :localleader
|
||||
(:map npm-mode-keymap
|
||||
"n" npm-mode-command-keymap)
|
||||
(:after js2-mode
|
||||
:map js2-mode-map
|
||||
:localleader
|
||||
(:prefix ("n" . "npm")))))
|
||||
:prefix ("n" . "npm"))))
|
||||
|
||||
|
||||
;;
|
||||
|
|
|
@ -39,6 +39,7 @@ If no viewers are found, `latex-preview-pane' is used.")
|
|||
;; automatically insert braces after sub/superscript in math mode
|
||||
TeX-electric-sub-and-superscript t)
|
||||
|
||||
|
||||
(after! tex
|
||||
;; fontify common latex commands
|
||||
(load! "+fontification")
|
||||
|
@ -120,9 +121,9 @@ If no viewers are found, `latex-preview-pane' is used.")
|
|||
|
||||
|
||||
(use-package! cdlatex
|
||||
:defer t
|
||||
:when (featurep! +cdlatex)
|
||||
:hook (LaTeX-mode . cdlatex-mode)
|
||||
:hook (org-mode . org-cdlatex-mode)
|
||||
:config
|
||||
;; Use \( ... \) instead of $ ... $
|
||||
(setq cdlatex-use-dollar-to-ensure-math nil)
|
||||
|
@ -130,22 +131,22 @@ If no viewers are found, `latex-preview-pane' is used.")
|
|||
(map! :map cdlatex-mode-map
|
||||
;; smartparens takes care of inserting closing delimiters, and if you
|
||||
;; don't use smartparens you probably won't want these also.
|
||||
:g "$" nil
|
||||
:g "(" nil
|
||||
:g "{" nil
|
||||
:g "[" nil
|
||||
:g "|" nil
|
||||
:g "<" nil
|
||||
"$" nil
|
||||
"(" nil
|
||||
"{" nil
|
||||
"[" nil
|
||||
"|" nil
|
||||
"<" nil
|
||||
;; TAB is used for cdlatex's snippets and navigation. But we have
|
||||
;; yasnippet for that.
|
||||
(:when (featurep! :editor snippets)
|
||||
:g "TAB" nil)
|
||||
"TAB" nil)
|
||||
;; AUCTeX takes care of auto-inserting {} on _^ if you want, with
|
||||
;; `TeX-electric-sub-and-superscript'
|
||||
:g "^" nil
|
||||
:g "_" nil
|
||||
"^" nil
|
||||
"_" nil
|
||||
;; AUCTeX already provides this with `LaTeX-insert-item'
|
||||
:g [(control return)] nil))
|
||||
[(control return)] nil))
|
||||
|
||||
|
||||
;; Nicely indent lines that have wrapped when visual line mode is activated
|
||||
|
|
|
@ -159,7 +159,7 @@ Is relative to `org-directory', unless it is absolute. Is used in Doom's default
|
|||
(apply orig-fn args)))
|
||||
|
||||
;; Automatic indent detection in org files is meaningless
|
||||
(cl-pushnew 'org-mode doom-detect-indentation-excluded-modes :test #'eq)
|
||||
(add-to-list 'doom-detect-indentation-excluded-modes 'org-mode)
|
||||
|
||||
(set-pretty-symbols! 'org-mode
|
||||
:name "#+NAME:"
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
:mode "\\.inc\\'"
|
||||
:config
|
||||
;; Disable HTML compatibility in php-mode. `web-mode' has superior support for
|
||||
;; php+html. Use the .phtml
|
||||
;; php+html. Use the .phtml extension instead.
|
||||
(setq php-template-compatibility nil)
|
||||
|
||||
(set-docsets! 'php-mode "PHP" "PHPUnit" "Laravel" "CakePHP" "CodeIgniter" "Doctrine_ORM")
|
||||
|
@ -54,7 +54,6 @@
|
|||
:config
|
||||
(set-lookup-handlers! 'php-mode
|
||||
:definition #'phpactor-goto-definition)
|
||||
|
||||
(map! :localleader
|
||||
:map php-mode-map
|
||||
:prefix ("r" . "refactor")
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
;;; term/vterm/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(use-package! vterm
|
||||
:when (boundp 'module-file-suffix)
|
||||
:when (bound-and-true-p module-file-suffix)
|
||||
:commands (vterm vterm-mode)
|
||||
:preface (setq vterm-install t)
|
||||
:config
|
||||
|
|
|
@ -52,7 +52,8 @@ As of this writing, this is the state of LSP support in Doom Emacs:
|
|||
| [[../../lang/web/README.org][:lang web]] | web-mode, css-mode, scss-mode, sass-mode, less-css-mode | vscode-css-languageserver-bin, vscode-html-languageserver-bin |
|
||||
|
||||
** Module Flags
|
||||
+ =+peek= Enables the =lsp-ui-peek= navigation frontend provided by the =lsp-ui= package.
|
||||
+ =+peek= Use =lsp-ui-peek= when looking up definitions and references with
|
||||
functionality from the =:tools lookup= module.
|
||||
|
||||
** Plugins
|
||||
+ [[https://github.com/emacs-lsp/lsp-mode][lsp-mode]]
|
||||
|
|
|
@ -41,15 +41,17 @@
|
|||
;; after eob. On Emacs 27 this no longer happens.
|
||||
(unless EMACS27+
|
||||
(defun +doom--line-range-fn ()
|
||||
(cons (line-beginning-position)
|
||||
(cond ((let ((eol (line-end-position)))
|
||||
(and (= eol (point-max))
|
||||
(/= eol (line-beginning-position))))
|
||||
(1- (line-end-position)))
|
||||
(let ((bol (line-beginning-position))
|
||||
(eol (line-end-position))
|
||||
(pmax (point-max)))
|
||||
(cons bol
|
||||
(cond ((and (= eol pmax)
|
||||
(/= eol bol))
|
||||
(1- eol))
|
||||
((or (eobp)
|
||||
(= (line-end-position 2) (point-max)))
|
||||
(line-end-position))
|
||||
((line-beginning-position 2)))))
|
||||
(= eol pmax))
|
||||
eol)
|
||||
((line-beginning-position 2))))))
|
||||
(setq hl-line-range-function #'+doom--line-range-fn))
|
||||
|
||||
;; Because fringes can't be given a buffer-local face, they can look odd, so
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue