General refactors & reformatting across the board

This commit is contained in:
Henrik Lissner 2020-06-04 20:02:46 -04:00
parent af91af01fa
commit 8bf902d5f4
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
25 changed files with 133 additions and 132 deletions

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -20,6 +20,6 @@
:defer t
:init
(map! :after json-mode
:map json-mode-map
:localleader
"s" #'counsel-jq))
:map json-mode-map
:localleader
"s" #'counsel-jq))

View file

@ -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

View file

@ -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))))

View file

@ -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

View file

@ -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