General refactors & reformatting across the board
This commit is contained in:
parent
af91af01fa
commit
8bf902d5f4
25 changed files with 133 additions and 132 deletions
|
@ -22,9 +22,6 @@ Returns (approximately):
|
|||
|
||||
This is used by `file-exists-p!' and `project-file-exists-p!'."
|
||||
(declare (pure t) (side-effect-free t))
|
||||
(let ((exists-fn (if (fboundp 'projectile-file-exists-p)
|
||||
#'projectile-file-exists-p
|
||||
#'file-exists-p)))
|
||||
(if (and (listp spec)
|
||||
(memq (car spec) '(or and)))
|
||||
(cons (car spec)
|
||||
|
@ -36,9 +33,9 @@ This is used by `file-exists-p!' and `project-file-exists-p!'."
|
|||
(and (stringp ,filevar)
|
||||
,(if directory
|
||||
`(let ((default-directory ,directory))
|
||||
(,exists-fn ,filevar))
|
||||
(list exists-fn filevar))
|
||||
,filevar))))))
|
||||
(file-exists-p ,filevar))
|
||||
`(file-exists-p ,filevar))
|
||||
,filevar)))))
|
||||
|
||||
(defun doom--path (&rest segments)
|
||||
(let (file-name-handler-alist)
|
||||
|
|
|
@ -216,8 +216,8 @@ localleader prefix."
|
|||
|
||||
For example, :nvi will map to (list 'normal 'visual 'insert). See
|
||||
`doom-evil-state-alist' to customize this."
|
||||
(cl-loop for l across (substring (symbol-name keyword) 1)
|
||||
if (cdr (assq l doom-evil-state-alist)) collect it
|
||||
(cl-loop for l across (doom-keyword-name keyword)
|
||||
if (assq l doom-evil-state-alist) collect (cdr it)
|
||||
else do (error "not a valid state: %s" l)))
|
||||
|
||||
|
||||
|
|
|
@ -183,7 +183,7 @@ the same name, for use with `funcall' or `apply'. ARGLIST and BODY are as in
|
|||
(rest (cdr binding)))
|
||||
(setq
|
||||
body (pcase type
|
||||
(`defmacro `(cl-macrolet ((,(car rest) ,(cadr rest) ,@(cddr rest))) ,body))
|
||||
(`defmacro `(cl-macrolet ((,@rest)) ,body))
|
||||
(`defun `(cl-letf* ((,(car rest) (symbol-function #',(car rest)))
|
||||
((symbol-function #',(car rest))
|
||||
(lambda ,(cadr rest) ,@(cddr rest))))
|
||||
|
|
|
@ -109,9 +109,7 @@ uses a straight or package.el command directly).")
|
|||
;;
|
||||
;;; Bootstrappers
|
||||
|
||||
(defun doom--ensure-straight ()
|
||||
(cl-destructuring-bind (&key pin recipe &allow-other-keys)
|
||||
(doom-package-get 'straight)
|
||||
(defun doom--ensure-straight (recipe pin)
|
||||
(let ((repo-dir (doom-path straight-base-dir "straight/repos/straight.el"))
|
||||
(repo-url (concat "http" (if gnutls-verify-error "s")
|
||||
"://github.com/"
|
||||
|
@ -143,11 +141,11 @@ uses a straight or package.el command directly).")
|
|||
;; Don't install straight for us -- we've already done that -- only set
|
||||
;; up its recipe repos for us.
|
||||
(eval-region (search-forward "(require 'straight)")
|
||||
(point-max))))))
|
||||
(point-max)))))
|
||||
|
||||
(defun doom--ensure-core-packages ()
|
||||
(defun doom--ensure-core-packages (packages)
|
||||
(doom-log "Installing core packages")
|
||||
(dolist (package doom-packages)
|
||||
(dolist (package packages)
|
||||
(let ((name (car package)))
|
||||
(when-let (recipe (plist-get (cdr package) :recipe))
|
||||
(straight-override-recipe (cons name recipe)))
|
||||
|
@ -157,9 +155,11 @@ uses a straight or package.el command directly).")
|
|||
"Ensure `straight' is installed and was compiled with this version of Emacs."
|
||||
(when (or force-p (null (bound-and-true-p straight-recipe-repositories)))
|
||||
(doom-log "Initializing straight")
|
||||
(let ((doom-packages (doom-package-list nil 'core-only)))
|
||||
(doom--ensure-straight)
|
||||
(doom--ensure-core-packages))))
|
||||
(let ((packages (doom-package-list nil 'core)))
|
||||
(cl-destructuring-bind (&key recipe pin &allow-other-keys)
|
||||
(alist-get 'straight packages)
|
||||
(doom--ensure-straight recipe pin))
|
||||
(doom--ensure-core-packages packages))))
|
||||
|
||||
(defun doom-initialize-packages (&optional force-p)
|
||||
"Process all packages, essential and otherwise, if they haven't already been.
|
||||
|
|
|
@ -86,7 +86,7 @@ e.g. proselint and langtool."
|
|||
|
||||
|
||||
(use-package! flyspell-correct
|
||||
:commands flyspell-correct-at-point flyspell-correct-previous
|
||||
:commands flyspell-correct-previous
|
||||
:general ([remap ispell-word] #'flyspell-correct-at-point)
|
||||
:config
|
||||
(cond ((and (featurep! :completion helm)
|
||||
|
|
|
@ -128,7 +128,7 @@ be negative.")
|
|||
"C-c C-e" #'helm-rg--bounce)
|
||||
(map! :map helm-rg--bounce-mode-map
|
||||
"q" #'kill-current-buffer
|
||||
"C-c C-c" (λ! (helm-rg--bounce-dump) (kill-current-buffer))
|
||||
"C-c C-c" (cmd! (helm-rg--bounce-dump) (kill-current-buffer))
|
||||
"C-x C-c" #'helm-rg--bounce-dump-current-file
|
||||
"C-c C-k" #'kill-current-buffer))
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
[up] #'ido-prev-match
|
||||
:map ido-file-completion-map
|
||||
;; Go to $HOME with ~
|
||||
"~" (λ! (if (looking-back "/" (point-min))
|
||||
"~" (cmd! (if (looking-back "/" (point-min))
|
||||
(insert "~/")
|
||||
(call-interactively #'self-insert-command)))))
|
||||
|
||||
|
|
|
@ -184,6 +184,7 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
|
|||
[remap info-lookup-symbol] #'counsel-info-lookup-symbol
|
||||
[remap load-theme] #'counsel-load-theme
|
||||
[remap locate] #'counsel-locate
|
||||
[remap org-goto] #'counsel-org-goto
|
||||
[remap org-set-tags-command] #'counsel-org-tag
|
||||
[remap projectile-compile-project] #'+ivy/project-compile
|
||||
[remap recentf-open-files] #'counsel-recentf
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
(interactive)
|
||||
(if (featurep! :completion ivy)
|
||||
(call-interactively #'counsel-file-jump)
|
||||
(λ! (doom-project-find-file default-directory))))
|
||||
(cmd! (doom-project-find-file default-directory))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +default/discover-projects (arg)
|
||||
|
|
|
@ -209,7 +209,7 @@
|
|||
(map! :map markdown-mode-map
|
||||
:ig "*" (general-predicate-dispatch nil
|
||||
(looking-at-p "\\*\\* *")
|
||||
(λ! (forward-char 2)))))))
|
||||
(cmd! (forward-char 2)))))))
|
||||
|
||||
|
||||
;;
|
||||
|
@ -291,7 +291,7 @@ Continues comments if executed from a commented line. Consults
|
|||
"s--" #'doom/decrease-font-size
|
||||
;; Conventional text-editing keys & motions
|
||||
"s-a" #'mark-whole-buffer
|
||||
"s-/" (λ! (save-excursion (comment-line 1)))
|
||||
"s-/" (cmd! (save-excursion (comment-line 1)))
|
||||
:n "s-/" #'evilnc-comment-or-uncomment-lines
|
||||
:v "s-/" #'evilnc-comment-operator
|
||||
:gi [s-backspace] #'doom/backward-kill-to-bol-and-indent
|
||||
|
|
|
@ -552,13 +552,13 @@ To change these keys see `+evil-repeat-keys'."
|
|||
"a" (evilem-create #'evil-forward-arg)
|
||||
"A" (evilem-create #'evil-backward-arg)
|
||||
"s" #'evil-avy-goto-char-2
|
||||
"SPC" (λ!! #'evil-avy-goto-char-timer t)
|
||||
"SPC" (cmd!! #'evil-avy-goto-char-timer t)
|
||||
"/" #'evil-avy-goto-char-timer))
|
||||
|
||||
;; evil-snipe
|
||||
(:after evil-snipe
|
||||
:map evil-snipe-parent-transient-map
|
||||
"C-;" (λ! (require 'evil-easymotion)
|
||||
"C-;" (cmd! (require 'evil-easymotion)
|
||||
(call-interactively
|
||||
(evilem-create #'evil-snipe-repeat
|
||||
:bind ((evil-snipe-scope 'whole-buffer)
|
||||
|
|
|
@ -107,7 +107,7 @@ information.")
|
|||
|
||||
|
||||
;;
|
||||
;; Library
|
||||
;;; Library
|
||||
|
||||
(defun +file-templates-in-emacs-dirs-p (file)
|
||||
"Returns t if FILE is in Doom or your private directory."
|
||||
|
|
|
@ -220,9 +220,8 @@ verbosity when editing a file in `doom-private-dir' or `doom-emacs-dir'."
|
|||
(when (and (bound-and-true-p flycheck-mode)
|
||||
(eq major-mode 'emacs-lisp-mode)
|
||||
(or (not buffer-file-name)
|
||||
(cl-loop for dir in (list doom-emacs-dir doom-private-dir)
|
||||
if (file-in-directory-p buffer-file-name dir)
|
||||
return t)))
|
||||
(cl-find-if (doom-partial #'file-in-directory-p buffer-file-name)
|
||||
+emacs-lisp-disable-flycheck-in-dirs)))
|
||||
(add-to-list (make-local-variable 'flycheck-disabled-checkers)
|
||||
'emacs-lisp-checkdoc)
|
||||
(set (make-local-variable 'flycheck-emacs-lisp-check-form)
|
||||
|
|
|
@ -7,6 +7,14 @@
|
|||
"Regexp to use for `outline-regexp' in `emacs-lisp-mode'.
|
||||
This marks a foldable marker for `outline-minor-mode' in elisp buffers.")
|
||||
|
||||
(defvar +emacs-lisp-disable-flycheck-in-dirs
|
||||
(list doom-emacs-dir doom-private-dir)
|
||||
"List of directories to disable `emacs-lisp-checkdoc' in.
|
||||
|
||||
This checker tends to produce a lot of false positives in your .emacs.d and
|
||||
private config, so it is mostly useless there. However, special hacks are
|
||||
employed so that flycheck still does *some* helpful linting.")
|
||||
|
||||
|
||||
;; `elisp-mode' is loaded at startup. In order to lazy load its config we need
|
||||
;; to pretend it isn't loaded
|
||||
|
|
|
@ -45,9 +45,9 @@
|
|||
"a" #'go-import-add
|
||||
"r" #'go-remove-unused-imports)
|
||||
(:prefix ("b" . "build")
|
||||
:desc "go run ." "r" (λ! (compile "go run ."))
|
||||
:desc "go build" "b" (λ! (compile "go build"))
|
||||
:desc "go clean" "c" (λ! (compile "go clean")))
|
||||
:desc "go run ." "r" (cmd! (compile "go run ."))
|
||||
:desc "go build" "b" (cmd! (compile "go build"))
|
||||
:desc "go clean" "c" (cmd! (compile "go clean")))
|
||||
(:prefix ("t" . "test")
|
||||
"t" #'+go/test-rerun
|
||||
"a" #'+go/test-all
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
(map! :map kotlin-mode-map
|
||||
:localleader
|
||||
:prefix ("b" . "build")
|
||||
:desc "gradlew assemble" "a" (λ! (+kotlin/run-gradlew "assemble"))
|
||||
:desc "gradlew build" "b" (λ! (+kotlin/run-gradlew "build"))
|
||||
:desc "gradlew test" "t" (λ! (+kotlin/run-gradlew "test"))))
|
||||
:desc "gradlew assemble" "a" (cmd! (+kotlin/run-gradlew "assemble"))
|
||||
:desc "gradlew build" "b" (cmd! (+kotlin/run-gradlew "build"))
|
||||
:desc "gradlew test" "t" (cmd! (+kotlin/run-gradlew "test"))))
|
||||
|
||||
|
||||
(use-package! flycheck-kotlin
|
||||
|
|
|
@ -53,4 +53,4 @@
|
|||
(define-key! doc-view-mode-map
|
||||
"ESC" #'delete-window
|
||||
"q" #'delete-window
|
||||
"k" (λ! (quit-window) (delete-window))))
|
||||
"k" (cmd! (quit-window) (delete-window))))
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
;;; lang/lua/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(defvar +lua-lsp-dir (concat doom-etc-dir "lsp/lua-language-server/")
|
||||
"Absolute path to the directory of sumneko's lua-language-server.
|
||||
|
||||
This directory MUST contain the 'main.lua' file and be the in-source build of
|
||||
lua-language-server.")
|
||||
|
||||
;; sp's default rules are obnoxious, so disable them
|
||||
(provide 'smartparens-lua)
|
||||
|
||||
|
@ -16,7 +22,23 @@
|
|||
(set-lookup-handlers! 'lua-mode :documentation 'lua-search-documentation)
|
||||
(set-electric! 'lua-mode :words '("else" "end"))
|
||||
(set-repl-handler! 'lua-mode #'+lua/open-repl)
|
||||
(set-company-backend! 'lua-mode '(company-lua company-yasnippet)))
|
||||
(set-company-backend! 'lua-mode '(company-lua company-yasnippet))
|
||||
|
||||
(set-eglot-client!
|
||||
'lua-mode
|
||||
;; The absolute path to lua-language-server binary is necessary because the
|
||||
;; bundled dependencies aren't found otherwise. The only reason this is a
|
||||
;; function is to dynamically change when/if lua-lsp-dir variable changed
|
||||
(list (doom-path lua-lsp-dir
|
||||
(cond (IS-MAC "bin/macOS")
|
||||
(IS-LINUX "bin/Linux")
|
||||
(IS-WINDOWS "bin/Windows"))
|
||||
"lua-language-server")
|
||||
"-E" "-e" "LANG=en"
|
||||
(doom-path lua-lsp-dir "main.lua")))
|
||||
|
||||
(when (featurep! +lsp)
|
||||
(add-hook 'lua-mode-local-vars-hook #'lsp!)))
|
||||
|
||||
|
||||
(use-package! moonscript
|
||||
|
@ -31,32 +53,6 @@
|
|||
(when (featurep! :checkers syntax)
|
||||
(require 'flycheck-moonscript nil t)))
|
||||
|
||||
;;
|
||||
;;; LSP
|
||||
(defvar lua-lsp-dir (concat doom-etc-dir "lsp/lua-language-server/")
|
||||
"Absolute path to the directory of sumneko's lua-language-server.
|
||||
This directory MUST contain the 'main.lua' file and be the in-source
|
||||
build of lua-language-server.")
|
||||
|
||||
;; We need the absolute path to lua-language-server binary
|
||||
;; because the bundled dependencies aren't found otherwise
|
||||
;; The only reason this is a function is to dynamically change
|
||||
;; when/if lua-lsp-dir variable changed
|
||||
(defun doom--abs-path-to-lua-lsp ()
|
||||
"Return the absolute path to lua-language-server."
|
||||
(let ((binary-subdir
|
||||
(cond (IS-MAC "bin/macOS/")
|
||||
(IS-LINUX "bin/Linux/")
|
||||
;; TODO : Forwards or backwards slash for WIN ?
|
||||
(IS-WINDOWS "bin/Windows/")
|
||||
;; TODO : Error or empty string here ?
|
||||
(t ""))))
|
||||
(concat lua-lsp-dir binary-subdir "lua-language-server")))
|
||||
|
||||
(after! lua-mode
|
||||
(set-eglot-client! 'lua-mode `(,(doom--abs-path-to-lua-lsp) "-E" "-e" "LANG=\"en\"" ,(concat lua-lsp-dir "main.lua"))))
|
||||
(when (featurep! +lsp)
|
||||
(add-hook 'lua-mode-local-vars-hook #'lsp!))
|
||||
|
||||
;;
|
||||
;;; Frameworks
|
||||
|
|
|
@ -353,7 +353,7 @@ relative to `org-directory', unless it is an absolute path."
|
|||
(defun +org-init-capture-frame-h ()
|
||||
(add-hook 'org-capture-after-finalize-hook #'+org-capture-cleanup-frame-h)
|
||||
|
||||
(defadvice! +org-capture-refile-cleanup-frame (&rest _)
|
||||
(defadvice! +org-capture-refile-cleanup-frame-a (&rest _)
|
||||
:after #'org-capture-refile
|
||||
(+org-capture-cleanup-frame-h))
|
||||
|
||||
|
@ -972,14 +972,14 @@ compelling reason, so..."
|
|||
:n "zi" #'org-toggle-inline-images
|
||||
|
||||
:map org-read-date-minibuffer-local-map
|
||||
"C-h" (λ! (org-eval-in-calendar '(calendar-backward-day 1)))
|
||||
"C-l" (λ! (org-eval-in-calendar '(calendar-forward-day 1)))
|
||||
"C-k" (λ! (org-eval-in-calendar '(calendar-backward-week 1)))
|
||||
"C-j" (λ! (org-eval-in-calendar '(calendar-forward-week 1)))
|
||||
"C-S-h" (λ! (org-eval-in-calendar '(calendar-backward-month 1)))
|
||||
"C-S-l" (λ! (org-eval-in-calendar '(calendar-forward-month 1)))
|
||||
"C-S-k" (λ! (org-eval-in-calendar '(calendar-backward-year 1)))
|
||||
"C-S-j" (λ! (org-eval-in-calendar '(calendar-forward-year 1)))))
|
||||
"C-h" (cmd! (org-eval-in-calendar '(calendar-backward-day 1)))
|
||||
"C-l" (cmd! (org-eval-in-calendar '(calendar-forward-day 1)))
|
||||
"C-k" (cmd! (org-eval-in-calendar '(calendar-backward-week 1)))
|
||||
"C-j" (cmd! (org-eval-in-calendar '(calendar-forward-week 1)))
|
||||
"C-S-h" (cmd! (org-eval-in-calendar '(calendar-backward-month 1)))
|
||||
"C-S-l" (cmd! (org-eval-in-calendar '(calendar-forward-month 1)))
|
||||
"C-S-k" (cmd! (org-eval-in-calendar '(calendar-backward-year 1)))
|
||||
"C-S-j" (cmd! (org-eval-in-calendar '(calendar-forward-year 1)))))
|
||||
|
||||
|
||||
(use-package! evil-org-agenda
|
||||
|
|
|
@ -8,4 +8,4 @@
|
|||
;;;###package multi-term
|
||||
(setq multi-term-dedicated-window-height 20
|
||||
multi-term-switch-after-close 'PREVIOUS
|
||||
multi-term-buffer-name "doom terminal")
|
||||
multi-term-buffer-name "doom:terminal")
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
(setq lsp-session-file (concat doom-etc-dir "lsp-session"))
|
||||
;; Auto-kill LSP server after last workspace buffer is killed.
|
||||
(setq lsp-keep-workspace-alive nil)
|
||||
;; Let `flycheck-check-syntax-automatically' determine this.
|
||||
;; Let `flycheck-check-syntax-automatically' determine this. Will be removed
|
||||
;; soon: https://github.com/emacs-lsp/lsp-mode/pull/1701/files
|
||||
(setq lsp-flycheck-live-reporting nil)
|
||||
;; For `lsp-clients'
|
||||
(setq lsp-server-install-dir (concat doom-etc-dir "lsp/")
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
(map! :after terraform-mode
|
||||
:map terraform-mode-map
|
||||
:localleader
|
||||
:desc "terraform apply" "a" (λ! (compile "terraform apply" t))
|
||||
:desc "terraform init" "i" (λ! (compile "terraform init"))
|
||||
:desc "terraform plan" "p" (λ! (compile "terraform plan")))
|
||||
:desc "terraform apply" "a" (cmd! (compile "terraform apply" t))
|
||||
:desc "terraform init" "i" (cmd! (compile "terraform init"))
|
||||
:desc "terraform plan" "p" (cmd! (compile "terraform plan")))
|
||||
|
||||
|
||||
(use-package! company-terraform
|
||||
|
|
|
@ -230,7 +230,7 @@ the command buffer."
|
|||
(after! org
|
||||
;; Org has a scorched-earth window management policy I'm not fond of. i.e. it
|
||||
;; kills all other windows just so it can monopolize the frame. No thanks. We
|
||||
;; can do better ourselves.
|
||||
;; can do better.
|
||||
(defadvice! +popup--suppress-delete-other-windows-a (orig-fn &rest args)
|
||||
:around '(org-add-log-note
|
||||
org-capture-place-template
|
||||
|
|
|
@ -49,7 +49,6 @@
|
|||
'org-todo-keyword-outd
|
||||
'org-todo
|
||||
'org-done
|
||||
'org-indent
|
||||
'font-lock-comment-face
|
||||
'line-number
|
||||
'line-number-current-line))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue