General cleanup + refactor

This commit is contained in:
Henrik Lissner 2017-02-28 12:12:09 -05:00
parent 45122cdea5
commit 4356f894fd
9 changed files with 18 additions and 15 deletions

View file

@ -212,6 +212,8 @@ properties."
;; Hacks ;; Hacks
;; ;;
;; Run these as late as possible, to give a chance for other modules to
;; customize these settings in their own hooks.
(add-hook! 'window-setup-hook (add-hook! 'window-setup-hook
(after! evil (after! evil
(let ((map doom-popup-mode-map)) (let ((map doom-popup-mode-map))

View file

@ -15,7 +15,7 @@ by `+eval/build', and filled with the `:build' setting")
eval-expression-print-level nil) eval-expression-print-level nil)
(def-setting! :repl (mode command) (def-setting! :repl (mode command)
"Define a REPL for a mode. Takes same arguements as `rtog/add-repl'." "Define a REPL for a mode. Takes the same arguements as `rtog/add-repl'."
`(after! repl-toggle `(after! repl-toggle
(rtog/add-repl ',mode ',command))) (rtog/add-repl ',mode ',command)))
@ -63,7 +63,8 @@ suitability for the current buffer."
quickrun-shell quickrun-shell
quickrun-compile-only quickrun-compile-only
quickrun-replace-region) quickrun-replace-region)
:init (add-hook 'quickrun/mode-hook 'linum-mode) :init
(add-hook 'quickrun/mode-hook 'linum-mode)
:config :config
(set! :popup "*quickrun*" :size 10) (set! :popup "*quickrun*" :size 10)
@ -71,7 +72,7 @@ suitability for the current buffer."
(setq quickrun-focus-p nil) (setq quickrun-focus-p nil)
(defun +repl*quickrun-close-popup (&optional _ _ _ _) (defun +repl*quickrun-close-popup (&optional _ _ _ _)
"Allows us to re-run quickrun from inside the quickrun buffer (silently)." "Allows us to silently re-run quickrun from within the quickrun buffer."
(awhen (get-buffer-window quickrun/buffer-name) (awhen (get-buffer-window quickrun/buffer-name)
(let (message-log-max) (let (message-log-max)
(quickrun/kill-running-process) (quickrun/kill-running-process)
@ -79,7 +80,7 @@ suitability for the current buffer."
(doom/popup-close it))) (doom/popup-close it)))
(defun +repl|quickrun-scroll-to-bof () (defun +repl|quickrun-scroll-to-bof ()
"Ensures window is scrolled to BOF" "Ensures window is scrolled to BOF on invocation."
(with-selected-window (get-buffer-window quickrun/buffer-name) (with-selected-window (get-buffer-window quickrun/buffer-name)
(goto-char (point-min)))) (goto-char (point-min))))
@ -93,14 +94,13 @@ suitability for the current buffer."
(def-package! repl-toggle (def-package! repl-toggle
:commands rtog/toggle-repl :commands rtog/toggle-repl
:preface (defvar rtog/mode-repl-alist nil) :preface (defvar rtog/mode-repl-alist nil)
:init (add-hook! repl-toggle-mode (evil-initialize-state 'emacs))
:config :config
(set! :popup (set! :popup
'(:custom (lambda (b &rest _) '(:custom (lambda (b &rest _)
(when (and (featurep 'repl-toggle) (when (and (featurep 'repl-toggle)
(string-prefix-p "*" (buffer-name (get-buffer b)))) (string-prefix-p "*" (buffer-name (get-buffer b))))
(buffer-local-value 'repl-toggle-mode b)))) (buffer-local-value 'repl-toggle-mode b))))
:popup t :size 16) :size 16)
(map! :map repl-toggle-mode-map (map! :map repl-toggle-mode-map
:ei "C-n" 'comint-next-input :ei "C-n" 'comint-next-input

View file

@ -8,7 +8,7 @@
(set! :build 'compile-file 'java-mode 'meghanada-compile-file) (set! :build 'compile-file 'java-mode 'meghanada-compile-file)
(set! :build 'compile-project 'java-mode 'meghanada-compile-project) (set! :build 'compile-project 'java-mode 'meghanada-compile-project)
(setq meghanada-server-install-dir (expand-file-name "meghanada-server" doom-cache-dir) (setq meghanada-server-install-dir (expand-file-name "meghanada-server/" doom-cache-dir)
meghanada-use-company t meghanada-use-company t
meghanada-use-flycheck t meghanada-use-flycheck t
meghanada-use-auto-start t) meghanada-use-auto-start t)

View file

@ -1,6 +1,7 @@
;;; lang/org/+attach.el --- -*- no-byte-compile: t; -*- ;;; lang/org/+attach.el
;; FIXME ;; FIXME Needs to be rewritten
;;
;; Initializes my own org-mode attachment system. I didn't like Org's native ;; Initializes my own org-mode attachment system. I didn't like Org's native
;; one. Mine stores attachments in a global org .attach directory. It also ;; one. Mine stores attachments in a global org .attach directory. It also
;; implements drag-and-drop file support and attachment icons. It also treats ;; implements drag-and-drop file support and attachment icons. It also treats

View file

@ -1,4 +1,4 @@
;;; lang/org/+capture.el --- -*- no-byte-compile: t; -*- ;;; lang/org/+capture.el
;; Sets up two `org-capture' workflows that I like: ;; Sets up two `org-capture' workflows that I like:
;; ;;

View file

@ -1,4 +1,4 @@
;;; lang/org/+export.el --- -*- no-byte-compile: t; -*- ;;; lang/org/+export.el
;; My own, centralized exporting system as well. ;; My own, centralized exporting system as well.

View file

@ -2,10 +2,10 @@
;; A few things you can expect ;; A few things you can expect
;; + `org-capture' in a popup frame (can be invoked from outside emacs too) ;; + `org-capture' in a popup frame (can be invoked from outside emacs too)
;; + A simpler attachment system (with auto-deleting support) and
;; drag-and-drop for images and documents into org files
;; + Exported files are put in a centralized location (see ;; + Exported files are put in a centralized location (see
;; `org-export-directory') ;; `org-export-directory')
;; + TODO A simpler attachment system (with auto-deleting support) and
;; drag-and-drop for images and documents into org files
;; + TODO Custom links for class notes ;; + TODO Custom links for class notes
;; + TODO An org-mode based CRM (including invoicing and pdf exporting) (see custom-crm) ;; + TODO An org-mode based CRM (including invoicing and pdf exporting) (see custom-crm)
;; + TODO A tag-based file browser reminiscient of Evernote and Quiver (there's neotree too!) ;; + TODO A tag-based file browser reminiscient of Evernote and Quiver (there's neotree too!)

View file

@ -8,7 +8,7 @@
(add-hook 'swift-mode-hook 'flycheck-mode) (add-hook 'swift-mode-hook 'flycheck-mode)
:config :config
(set! :repl 'swift-mode 'swift-mode-run-repl) ; TODO test this (set! :repl 'swift-mode 'swift-mode-run-repl) ; TODO test this
(after! flycheck (push 'swift flycheck-checkers))) (push 'swift flycheck-checkers))
(def-package! company-sourcekit (def-package! company-sourcekit

View file

@ -5,7 +5,6 @@
:init :init
(add-hook 'typescript-mode-hook 'rainbow-delimiters-mode) (add-hook 'typescript-mode-hook 'rainbow-delimiters-mode)
:config :config
(set! :company-backend 'typescript-mode '(company-tide))
(set! :electric 'typescript-mode :chars '(?\} ?\)) :words '("||" "&&")) (set! :electric 'typescript-mode :chars '(?\} ?\)) :words '("||" "&&"))
;; TODO tide-jump-back ;; TODO tide-jump-back
@ -39,6 +38,7 @@
(def-package! tide (def-package! tide
:after typescript-mode :after typescript-mode
:config :config
(set! :company-backend 'typescript-mode '(company-tide))
(setq tide-format-options (setq tide-format-options
'(:insertSpaceAfterFunctionKeywordForAnonymousFunctions t '(:insertSpaceAfterFunctionKeywordForAnonymousFunctions t
:placeOpenBraceOnNewLineForFunctions nil))) :placeOpenBraceOnNewLineForFunctions nil)))