Merge branch 'dev'
* dev: (25 commits) elisp: fontify ex-local! macro calls Enable highlight-numbers-mode in css modes Remove redundant boundp check in def-yas-mode! Refactor nlinum hl/unhl; sacrifice a little performance for stability doom*evil-esc-quit: ESC is special in popups Polish neotree integration + Smaller font in neotree window (with slightly thinner window) + Refactor advice naming + Add space-prepended buffer name to winner-boring-alist + Remove unnecessary advice defuns Don't use delete-trailing-whitespace as a hook with highlight-indentation-mode Don't let cursor stay in help buffer popup after following a link fixup! Add command-log-mode scratch buffer: check if mode is a function before running it Fix :re command collision Add command-log-mode split-window-preferred-function = 'visual-line-mode-split-window-sensibly' Lazy load evil-anzu General cleanup help-mode: fix links to already open buffers Improve neotree keymap Refactor real-buffer system Improve doom-buffer kill-buffer-query-functions; update doom-buffer when visible applescript-mode: Enable nlinum-mode + add quickrun command ...
This commit is contained in:
commit
db5a735f5a
36 changed files with 317 additions and 332 deletions
15
Cask
15
Cask
|
@ -64,6 +64,7 @@
|
|||
(depends-on "ace-link")
|
||||
(depends-on "ace-window")
|
||||
(depends-on "avy")
|
||||
(depends-on "command-log-mode")
|
||||
(depends-on "dumb-jump")
|
||||
(depends-on "editorconfig")
|
||||
(depends-on "eldoc-eval")
|
||||
|
@ -271,13 +272,13 @@
|
|||
|
||||
;;;; Experimental ;;;;;;;;;;;;
|
||||
;; Org -- modules/module-org.el
|
||||
;(depends-on "org-plus-contrib")
|
||||
;(depends-on "ob-go" :git "https://github.com/pope/ob-go")
|
||||
;(depends-on "ob-http")
|
||||
;(depends-on "org-bullets")
|
||||
(depends-on "org-plus-contrib")
|
||||
; (depends-on "ob-go" :git "https://github.com/pope/ob-go")
|
||||
; (depends-on "ob-http")
|
||||
(depends-on "org-bullets")
|
||||
;; Org Notebook -- modules/module-org-notebook.el
|
||||
;(depends-on "org-download")
|
||||
;(depends-on "ox-pandoc")
|
||||
(depends-on "org-download")
|
||||
(depends-on "ox-pandoc")
|
||||
|
||||
|
||||
;;;; EXTRA TOOLS ;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
@ -286,4 +287,4 @@
|
|||
(depends-on "impatient-mode")
|
||||
|
||||
;; Writing -- modules/extra-write.el
|
||||
(depends-on "helm-bibtex")
|
||||
; (depends-on "helm-bibtex")
|
||||
|
|
|
@ -190,6 +190,14 @@ Examples:
|
|||
(after! evil
|
||||
(defalias 'ex! 'evil-ex-define-cmd)
|
||||
|
||||
;; NOTE evil-mode doesn't read local `evil-ex-commands', and will not
|
||||
;; autocomplete local commands.
|
||||
(defun ex-local! (cmd fn)
|
||||
"Define a buffer-local ex command."
|
||||
(unless (local-variable-p 'evil-ex-commands)
|
||||
(setq-local evil-ex-commands (copy-alist evil-ex-commands)))
|
||||
(evil-ex-define-cmd cmd fn))
|
||||
|
||||
;; Register keywords for proper indentation (see `map!')
|
||||
(put ':prefix 'lisp-indent-function 'defun)
|
||||
(put ':map 'lisp-indent-function 'defun)
|
||||
|
|
|
@ -146,6 +146,10 @@
|
|||
:config (setq avy-all-windows nil
|
||||
avy-background t))
|
||||
|
||||
(use-package command-log-mode
|
||||
:commands (clm/command-log-buffer command-log-mode global-command-log-mode)
|
||||
:config (setq command-log-mode-is-global t))
|
||||
|
||||
(use-package dumb-jump
|
||||
:commands (dumb-jump-go dumb-jump-quick-look dumb-jump-back)
|
||||
:config
|
||||
|
|
|
@ -63,7 +63,6 @@
|
|||
:n "k" 'evil-previous-line
|
||||
:n "h" 'evil-backward-char
|
||||
:n "l" 'evil-forward-char
|
||||
;; FIXME Greedy command buffer always grabs focus
|
||||
:m "n" 'realgud:cmd-next
|
||||
:m "b" 'realgud:cmd-break
|
||||
:m "B" 'realgud:cmd-clear
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
evil-echo-state nil
|
||||
evil-ex-substitute-global t
|
||||
evil-insert-skip-empty-lines t
|
||||
evil-want-fine-undo nil
|
||||
|
||||
evil-normal-state-tag "N"
|
||||
evil-insert-state-tag "I"
|
||||
|
@ -25,11 +26,7 @@
|
|||
evil-normal-state-cursor 'box
|
||||
evil-emacs-state-cursor `(,(face-attribute 'shadow :foreground nil nil) box)
|
||||
evil-insert-state-cursor 'bar
|
||||
evil-visual-state-cursor 'hollow
|
||||
|
||||
;; NOTE: a bug in emacs 25 breaks undoing in evil. See
|
||||
;; https://bitbucket.org/lyro/evil/issues/594/undo-doesnt-behave-like-vim
|
||||
evil-want-fine-undo (if (> emacs-major-version 24) 'fine))
|
||||
evil-visual-state-cursor 'hollow)
|
||||
|
||||
;; highlight matching delimiters where it's important
|
||||
(defun show-paren-mode-off () (show-paren-mode -1))
|
||||
|
@ -47,6 +44,13 @@
|
|||
(evil-mode 1)
|
||||
(evil-select-search-module 'evil-search-module 'evil-search)
|
||||
|
||||
;; evil-anzu is strangely slow on startup. Byte compiling doesn't help.
|
||||
;; We use this to lazy load it instead.
|
||||
(defun doom*evil-search (&rest _)
|
||||
(require 'evil-anzu)
|
||||
(advice-remove 'evil-ex-start-search 'doom*evil-search))
|
||||
(advice-add 'evil-ex-start-search :before 'doom*evil-search)
|
||||
|
||||
;; Reset evil-mode in the messages buffer, because it opens before evil
|
||||
;; normalizes its keymaps, so none of the custom keybindings work in it.
|
||||
(add-hook! emacs-startup
|
||||
|
@ -155,7 +159,7 @@
|
|||
:commands (evil-numbers/inc-at-pt evil-numbers/dec-at-pt))
|
||||
|
||||
(use-package evil-anzu
|
||||
:defer 1
|
||||
:defer t
|
||||
:config
|
||||
(setq anzu-cons-mode-line-p nil
|
||||
anzu-minimum-input-length 1
|
||||
|
|
|
@ -46,7 +46,15 @@
|
|||
|
||||
(use-package applescript-mode
|
||||
:mode "\\.applescript$"
|
||||
:config (def-docset! applescript-mode "applescript"))
|
||||
:init (add-hook 'applescript-mode-hook 'nlinum-mode)
|
||||
:config
|
||||
(def-docset! applescript-mode "applescript")
|
||||
(after! quickrundb
|
||||
(quickrun-add-command
|
||||
"applescript" `((:command . ,as-osascript-command)
|
||||
(:cmdopt . "-ss %s")
|
||||
(:description . "Run applescript"))
|
||||
:mode 'applescript-mode)))
|
||||
|
||||
(def-project-type! lb6 "lb6"
|
||||
:match "\\.lb\\(action\\|ext\\)/.+$"
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
("*Warnings*" :align below :size 10 :noselect t)
|
||||
(compilation-mode :align below :size 15 :noselect t)
|
||||
(eww-mode :align below :size 30 :select t)
|
||||
("*command-log*" :align right :size 28 :noselect t)
|
||||
;; vcs
|
||||
("*vc-diff*" :align below :size 15 :noselect t)
|
||||
("*vc-change-log*" :align below :size 15 :select t)
|
||||
|
@ -69,13 +70,13 @@
|
|||
(require 'find-func)
|
||||
(when (eq file 'C-source)
|
||||
(setq file (help-C-file-name (indirect-function fun) 'fun)))
|
||||
(let ((location
|
||||
(find-function-search-for-symbol fun nil file)))
|
||||
(let ((location (find-function-search-for-symbol fun nil file)))
|
||||
(doom/popup-save
|
||||
(switch-to-buffer (car location) nil t))
|
||||
(if (cdr location)
|
||||
(goto-char (cdr location))
|
||||
(message "Unable to find location in file")))))
|
||||
(switch-to-buffer (car location) nil t)
|
||||
(if (cdr location)
|
||||
(goto-char (cdr location))
|
||||
(message "Unable to find location in file")))
|
||||
(select-window (get-buffer-window (car location))))))
|
||||
|
||||
(define-button-type 'help-variable-def
|
||||
:supertype 'help-xref
|
||||
|
@ -84,10 +85,11 @@
|
|||
(setq file (help-C-file-name var 'var)))
|
||||
(let ((location (find-variable-noselect var file)))
|
||||
(doom/popup-save
|
||||
(switch-to-buffer (car location) nil t))
|
||||
(if (cdr location)
|
||||
(goto-char (cdr location))
|
||||
(message "Unable to find location in file")))))
|
||||
(switch-to-buffer (car location) nil t)
|
||||
(if (cdr location)
|
||||
(goto-char (cdr location))
|
||||
(message "Unable to find location in file")))
|
||||
(select-window (get-buffer-window (car location))))))
|
||||
|
||||
(define-button-type 'help-face-def
|
||||
:supertype 'help-xref
|
||||
|
@ -96,10 +98,11 @@
|
|||
(let ((location
|
||||
(find-function-search-for-symbol fun 'defface file)))
|
||||
(doom/popup-save
|
||||
(switch-to-buffer (car location) nil t))
|
||||
(if (cdr location)
|
||||
(goto-char (cdr location))
|
||||
(message "Unable to find location in file"))))))
|
||||
(switch-to-buffer (car location) nil t)
|
||||
(if (cdr location)
|
||||
(goto-char (cdr location))
|
||||
(message "Unable to find location in file")))
|
||||
(select-window (get-buffer-window (car location)))))))
|
||||
|
||||
(provide 'core-popup)
|
||||
;;; core-popup.el ends here
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
neo-auto-indent-point t
|
||||
neo-mode-line-type 'none
|
||||
neo-persist-show nil
|
||||
neo-window-width 28
|
||||
neo-window-width 26
|
||||
neo-show-updir-line nil
|
||||
neo-auto-indent-point t
|
||||
neo-theme 'nerd ; fallback
|
||||
|
@ -90,41 +90,41 @@
|
|||
(evil-set-initial-state 'neotree-mode 'motion)
|
||||
(add-hook 'neo-after-create-hook 'doom-hide-mode-line-mode)
|
||||
|
||||
;; Don't mess with neotree on wg-related window-config changes
|
||||
(advice-add 'doom/undo-window-change :around 'doom*save-neotree)
|
||||
(advice-add 'doom/redo-window-change :around 'doom*save-neotree)
|
||||
;; A custom and simple theme for neotree
|
||||
(advice-add 'neo-buffer--insert-fold-symbol :override 'doom*neo-theme)
|
||||
(advice-add 'neo-buffer--insert-fold-symbol :override 'doom*neo-insert-fold-symbol)
|
||||
;; Shorter pwd in neotree
|
||||
(advice-add 'neo-buffer--insert-root-entry :filter-args 'doom*neotree-shorten-pwd)
|
||||
(advice-add 'neo-buffer--insert-root-entry :filter-args 'doom*neo-insert-root-entry)
|
||||
;; Don't ask for confirmation when creating files
|
||||
(advice-add 'neotree-create-node :around 'doom*neotree-create-node)
|
||||
;; Prevents messing up the neotree buffer on window changes
|
||||
(advice-add 'doom/evil-window-move :around 'doom*save-neotree)
|
||||
|
||||
(defun doom*neotree-no-fringes ()
|
||||
(set-window-fringes neo-global--window 1 0))
|
||||
;; Minimize 'border' between windows (won't work in hook)
|
||||
(defun doom*neotree-no-fringes () (set-window-fringes neo-global--window 1 0))
|
||||
(advice-add 'neo-global--select-window :after 'doom*neotree-no-fringes)
|
||||
|
||||
(add-hook! neotree-mode
|
||||
(set (make-local-variable 'hl-line-sticky-flag) t)
|
||||
(setq line-spacing 2)
|
||||
(text-scale-set -1)
|
||||
(hl-line-mode +1))
|
||||
(map! :map neotree-mode-map
|
||||
:m "\\\\" 'evil-window-prev
|
||||
"ESC ESC" 'neotree-hide
|
||||
"q" 'neotree-hide
|
||||
"RET" 'neotree-enter
|
||||
"J" 'neotree-select-next-sibling-node
|
||||
"K" 'neotree-select-previous-sibling-node
|
||||
"H" 'neotree-select-up-node
|
||||
"L" 'neotree-select-down-node
|
||||
"v" 'neotree-enter-vertical-split
|
||||
"s" 'neotree-enter-horizontal-split
|
||||
"c" 'neotree-create-node
|
||||
"d" 'neotree-delete-node
|
||||
"g" 'neotree-refresh
|
||||
"r" 'neotree-rename-node
|
||||
"R" 'neotree-change-root))
|
||||
"q" 'neotree-hide
|
||||
[return] 'neotree-enter
|
||||
"RET" 'neotree-enter
|
||||
:m "J" 'neotree-select-next-sibling-node
|
||||
:m "K" 'neotree-select-previous-sibling-node
|
||||
:m "H" 'neotree-select-up-node
|
||||
:m "L" 'neotree-select-down-node
|
||||
"v" 'neotree-enter-vertical-split
|
||||
"s" 'neotree-enter-horizontal-split
|
||||
"c" 'neotree-create-node
|
||||
"d" 'neotree-delete-node
|
||||
"g" 'neotree-refresh
|
||||
"r" 'neotree-rename-node
|
||||
"R" 'neotree-change-root))
|
||||
|
||||
(use-package projectile
|
||||
:config
|
||||
|
|
|
@ -10,15 +10,22 @@
|
|||
"The global and persistent scratch buffer for doom.")
|
||||
(defvar doom-buffer-name "*doom*"
|
||||
"The name of the doom scratch buffer.")
|
||||
(defvar-local doom-buffer-edited nil
|
||||
(defvar doom-buffer-edited nil
|
||||
"If non-nil, the scratch buffer has been edited.")
|
||||
|
||||
(define-derived-mode doom-mode fundamental-mode "DOOM"
|
||||
"Major mode for special DOOM buffers.")
|
||||
|
||||
;; Update the doom buffer if it's visible during a killing
|
||||
(add-hook! 'kill-buffer-query-functions
|
||||
(when (and (get-buffer-window-list doom-buffer nil t)
|
||||
(not doom-buffer-edited))
|
||||
(doom-mode-init t))
|
||||
t)
|
||||
|
||||
;; Don't kill the scratch buffer
|
||||
(add-hook! 'kill-buffer-query-functions
|
||||
(not (string= doom-buffer-name (buffer-name))))
|
||||
(not (eq doom-buffer (current-buffer))))
|
||||
|
||||
(after! uniquify
|
||||
(push (regexp-quote doom-buffer-name) uniquify-ignore-buffers-re))
|
||||
|
|
|
@ -97,9 +97,8 @@
|
|||
:init (add-hook! (prog-mode markdown-mode) 'hl-line-mode)
|
||||
:config
|
||||
;; Doesn't seem to play nice in emacs 25+
|
||||
(when (< emacs-major-version 25)
|
||||
(setq hl-line-sticky-flag nil
|
||||
global-hl-line-sticky-flag nil))
|
||||
(setq hl-line-sticky-flag nil
|
||||
global-hl-line-sticky-flag nil)
|
||||
|
||||
(defvar-local doom--hl-line-mode nil)
|
||||
(defun doom|hl-line-on () (if doom--hl-line-mode (hl-line-mode +1)))
|
||||
|
@ -112,7 +111,8 @@
|
|||
(use-package visual-fill-column :defer t
|
||||
:config
|
||||
(setq-default visual-fill-column-center-text nil
|
||||
visual-fill-column-width fill-column))
|
||||
visual-fill-column-width fill-column
|
||||
split-window-preferred-function 'visual-line-mode-split-window-sensibly))
|
||||
|
||||
(use-package highlight-indentation
|
||||
:commands (highlight-indentation-mode
|
||||
|
@ -130,10 +130,9 @@
|
|||
(if highlight-indentation-mode
|
||||
(progn
|
||||
(doom/add-whitespace)
|
||||
(add-hook 'after-save-hook 'doom/add-whitespace nil t)
|
||||
(add-hook 'before-save-hook 'delete-trailing-whitespace nil t))
|
||||
(add-hook 'after-save-hook 'doom/add-whitespace nil t))
|
||||
(remove-hook 'after-save-hook 'doom/add-whitespace t)
|
||||
(remove-hook 'before-save-hook 'delete-trailing-whitespace t))))
|
||||
(delete-trailing-whitespace))))
|
||||
|
||||
(use-package highlight-numbers :commands (highlight-numbers-mode))
|
||||
|
||||
|
@ -394,9 +393,11 @@ anzu to be enabled."
|
|||
'doom-flycheck-warning
|
||||
'mode-line))))))))))
|
||||
|
||||
(defvar *pad-active (pl/percent-xpm powerline-height 100 0 100 0 3 "#00B3EF" nil))
|
||||
(defvar *pad-inactive (pl/percent-xpm powerline-height 100 0 100 0 3 nil nil))
|
||||
(spaceline-define-segment *pad
|
||||
"Padding, to ensure the mode-line is `powerline-height' pixels tall"
|
||||
(pl/percent-xpm powerline-height 100 0 100 0 3 (if active "#00B3EF") nil)
|
||||
(if active *pad-active *pad-inactive)
|
||||
:tight t)
|
||||
|
||||
(spaceline-compile
|
||||
|
@ -441,9 +442,10 @@ anzu to be enabled."
|
|||
:tight t
|
||||
:face 'mode-line)
|
||||
|
||||
(defvar *eldoc-pad-xpm (pl/percent-xpm powerline-height 100 0 100 0 3 "#B3EF00" nil))
|
||||
(spaceline-define-segment *eldoc-pad
|
||||
"Padding, to ensure the mode-line is `powerline-height' pixels tall"
|
||||
(pl/percent-xpm powerline-height 100 0 100 0 3 "#B3EF00" nil)
|
||||
*eldoc-pad-xpm
|
||||
:tight t
|
||||
:face 'mode-line)
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ killed by `doom/kill-unreal-buffers', or after `doom/kill-real-buffer').")
|
|||
(defvar doom-ignore-buffers
|
||||
'("*Messages*" "*eval*" "*Completions*" "*Compile-Log*" "*inferior-lisp*"
|
||||
"*Fuzzy Completions*" "*Apropos*" "*Help*" "*cvs*" "*Buffer List*"
|
||||
"*Ibuffer*" "*NeoTree*" "*NeoTree*" "*esh command on file*" "*WoMan-Log*"
|
||||
"*Ibuffer*" " *NeoTree*" "*NeoTree*" "*esh command on file*" "*WoMan-Log*"
|
||||
"*compilation*" "*use-package*" "*quickrun*" "*eclim: problems*"
|
||||
"*Flycheck errors*" "*popwin-dummy*"
|
||||
;; Helm
|
||||
|
|
|
@ -68,6 +68,7 @@
|
|||
(select-window (get-buffer-window doom-prev-buffer)))
|
||||
(switch-to-buffer b)))
|
||||
|
||||
;; Prevent magit and evil-snipe conflicts
|
||||
(add-hook 'magit-mode-hook 'turn-off-evil-snipe-override-mode)
|
||||
|
||||
(require 'evil-magit)
|
||||
|
|
|
@ -43,9 +43,7 @@
|
|||
;; Strip out whitespace before a line selection
|
||||
(add-hook 'yas-before-expand-snippet-hook 'doom|yas-before-expand)
|
||||
;; Fix previous hook persisting yas-selected-text between expansions
|
||||
(add-hook 'yas-after-exit-snippet-hook 'doom|yas-after-expand)
|
||||
;; Suppress yasnippet with helm
|
||||
(after! helm (push 'helm-alive-p yas-dont-activate-functions)))
|
||||
(add-hook 'yas-after-exit-snippet-hook 'doom|yas-after-expand))
|
||||
|
||||
(use-package auto-yasnippet
|
||||
:commands (aya-create aya-expand aya-open-line aya-persist-snippet)
|
||||
|
|
|
@ -98,28 +98,19 @@ Inspired from http://demonastery.org/2013/04/emacs-evil-narrow-region/"
|
|||
"Kill buffer (but only bury scratch buffer), then switch to a real buffer. Only buries
|
||||
the buffer if it is being displayed in another window."
|
||||
(interactive (list t))
|
||||
(if (eq doom-buffer (current-buffer))
|
||||
(if (one-window-p)
|
||||
(progn
|
||||
(when (= (length (get-buffer-window-list doom-buffer nil t)) 1)
|
||||
(doom-mode-init t))
|
||||
(when arg (message "Already in scratch buffer")))
|
||||
(doom/previous-real-buffer))
|
||||
(let ((new-dir (doom/project-root)))
|
||||
(if (doom/popup-p)
|
||||
(doom/popup-close)
|
||||
(if (> (length (get-buffer-window-list (current-buffer) nil t)) 1)
|
||||
(bury-buffer)
|
||||
(when (and buffer-file-name (buffer-modified-p))
|
||||
(if (yes-or-no-p "Buffer is unsaved, save it?")
|
||||
(save-buffer)
|
||||
(set-buffer-modified-p nil)))
|
||||
(kill-this-buffer))
|
||||
(unless (doom/real-buffer-p (current-buffer))
|
||||
(doom/previous-real-buffer))
|
||||
(when (get-buffer-window-list doom-buffer nil t)
|
||||
(doom|update-scratch-buffer new-dir)))))
|
||||
t)
|
||||
(cond ((doom/popup-p)
|
||||
(doom/popup-close))
|
||||
(t
|
||||
(if (> (length (get-buffer-window-list (current-buffer) nil t)) 1)
|
||||
(bury-buffer)
|
||||
(when (and buffer-file-name (buffer-modified-p))
|
||||
(if (yes-or-no-p "Buffer is unsaved, save it?")
|
||||
(save-buffer)
|
||||
(set-buffer-modified-p nil)))
|
||||
(kill-buffer)
|
||||
(unless (doom/real-buffer-p)
|
||||
(doom/previous-real-buffer)))))
|
||||
t)
|
||||
|
||||
;;;###autoload
|
||||
(defun doom/kill-unreal-buffers ()
|
||||
|
@ -168,45 +159,41 @@ the buffer if it is being displayed in another window."
|
|||
"Switch to the previous buffer and avoid special buffers. If there's nothing
|
||||
left, create a scratch buffer."
|
||||
(let* ((start-buffer (current-buffer))
|
||||
(move-func (if (< n 0) 'switch-to-next-buffer 'switch-to-prev-buffer))
|
||||
(real-buffers (doom/get-real-buffers))
|
||||
(realc (length real-buffers))
|
||||
(move-func (if (> n 0) 'switch-to-next-buffer 'switch-to-prev-buffer))
|
||||
(max 25)
|
||||
(i 0)
|
||||
(continue t))
|
||||
(if (or (= realc 0)
|
||||
(and (= realc 1) (eq (car real-buffers) (current-buffer))))
|
||||
(progn
|
||||
(doom|update-scratch-buffer)
|
||||
(switch-to-buffer doom-buffer-name)
|
||||
(message "Nowhere to go"))
|
||||
(funcall move-func)
|
||||
(while (and continue)
|
||||
(let ((current-buffer (current-buffer)))
|
||||
(cond ((or (eq current-buffer start-buffer)
|
||||
(>= i max))
|
||||
(doom|update-scratch-buffer)
|
||||
(switch-to-buffer doom-buffer-name)
|
||||
(setq continue nil))
|
||||
((not (memq current-buffer real-buffers))
|
||||
(funcall move-func))
|
||||
(t
|
||||
(setq continue nil))))
|
||||
(cl-incf i)))))
|
||||
(continue t)
|
||||
destbuf)
|
||||
(setq destbuf
|
||||
(catch 'goto
|
||||
(if (not (doom/get-real-buffers))
|
||||
(throw 'goto doom-buffer)
|
||||
(funcall move-func)
|
||||
(while (not (and (doom/real-buffer-p)
|
||||
(doom/project-p)))
|
||||
(if (or (eq (current-buffer) start-buffer)
|
||||
(>= i max))
|
||||
(throw 'goto doom-buffer)
|
||||
(funcall move-func))
|
||||
(cl-incf i))
|
||||
(current-buffer))))
|
||||
(when (eq destbuf doom-buffer)
|
||||
(doom|update-scratch-buffer)
|
||||
(message "Nowhere to go"))
|
||||
(switch-to-buffer destbuf)))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom/real-buffer-p (&optional buffer)
|
||||
"Returns whether BUFFER a 'real' buffer or not. Real means it isn't a popup,
|
||||
temporary, scratch or special buffer."
|
||||
(setq buffer (get-buffer (or buffer (current-buffer))))
|
||||
(setq buffer (or (and (bufferp buffer) buffer)
|
||||
(and (stringp buffer) (get-buffer buffer))
|
||||
(current-buffer)))
|
||||
(when (buffer-live-p buffer)
|
||||
(with-current-buffer buffer
|
||||
(not (or (apply #'derived-mode-p
|
||||
(-filter 'symbolp doom-unreal-buffers))
|
||||
(--any? (if (stringp it)
|
||||
(string-match-p it (buffer-name buffer))
|
||||
(eq major-mode it))
|
||||
doom-unreal-buffers))))))
|
||||
(not (or (apply #'derived-mode-p (-filter 'symbolp doom-unreal-buffers))
|
||||
(--any? (string-match-p it (buffer-name buffer))
|
||||
(-filter 'stringp doom-unreal-buffers)))))))
|
||||
|
||||
;; Inspired by spacemacs <https://github.com/syl20bnr/spacemacs/blob/master/spacemacs/funcs.el>
|
||||
;;;###autoload
|
||||
|
@ -276,7 +263,8 @@ buffers regardless of project."
|
|||
;; or scratch buffer by default
|
||||
(with-current-buffer (doom/popup-buffer doom-buffer)
|
||||
(doom|update-scratch-buffer nil t)
|
||||
(unless (eq major-mode mode)
|
||||
(when (and (not (eq major-mode mode))
|
||||
(functionp mode))
|
||||
(funcall mode))
|
||||
(unless doom-buffer-edited
|
||||
(erase-buffer)
|
||||
|
|
|
@ -192,13 +192,15 @@ monkey patch it to use pop-to-buffer."
|
|||
;;;###autoload
|
||||
(defun doom*evil-esc-quit ()
|
||||
"Close popups, disable search highlights and quit the minibuffer if open."
|
||||
(let ((minib-p (minibuffer-window-active-p (minibuffer-window)))
|
||||
(evil-hl-p (evil-ex-hl-active-p 'evil-ex-search)))
|
||||
(when minib-p (abort-recursive-edit))
|
||||
(when evil-hl-p (evil-ex-nohighlight))
|
||||
;; Close non-repl popups and clean up `doom-popup-windows'
|
||||
(unless (or minib-p evil-hl-p (bound-and-true-p doom-popup-mode))
|
||||
(doom/popup-close-all))))
|
||||
(if (and (doom/popup-p) (memq :noesc doom-popup-rule))
|
||||
(doom/popup-close)
|
||||
(let ((minib-p (minibuffer-window-active-p (minibuffer-window)))
|
||||
(evil-hl-p (evil-ex-hl-active-p 'evil-ex-search)))
|
||||
(when minib-p (abort-recursive-edit))
|
||||
(when evil-hl-p (evil-ex-nohighlight))
|
||||
;; Close non-repl popups and clean up `doom-popup-windows'
|
||||
(unless (or minib-p evil-hl-p)
|
||||
(doom/popup-close-all)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom*evil-ex-replace-special-filenames (file-name)
|
||||
|
|
|
@ -45,19 +45,16 @@
|
|||
(apply orig-fun args)))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom*neotree-shorten-pwd (node)
|
||||
"Shorter pwd in neotree"
|
||||
(defun doom*neo-insert-root-entry (node)
|
||||
"Pretty-print pwd in neotree"
|
||||
(list (concat " " (projectile-project-name))))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom*neo-theme (name)
|
||||
"Custom hybrid ascii theme with leading whitespace."
|
||||
(let ((n-insert-symbol (lambda (n)
|
||||
(neo-buffer--insert-with-face
|
||||
n 'neo-expand-btn-face))))
|
||||
(or (and (eq name 'open) (funcall n-insert-symbol " - "))
|
||||
(and (eq name 'close) (funcall n-insert-symbol " + "))
|
||||
(and (eq name 'leaf) (funcall n-insert-symbol " ")))))
|
||||
(defun doom*neo-insert-fold-symbol (name)
|
||||
"Custom hybrid unicode theme with leading whitespace."
|
||||
(or (and (eq name 'open) (neo-buffer--insert-with-face " - " 'neo-expand-btn-face))
|
||||
(and (eq name 'close) (neo-buffer--insert-with-face " + " 'neo-expand-btn-face))
|
||||
(and (eq name 'leaf) (neo-buffer--insert-with-face " " 'neo-expand-btn-face))))
|
||||
|
||||
(provide 'defuns-neotree)
|
||||
;;; defuns-neotree.el ends here
|
||||
|
|
|
@ -11,50 +11,40 @@
|
|||
(defun doom|nlinum-enable (&rest _)
|
||||
(nlinum-mode +1)
|
||||
(add-hook 'post-command-hook 'doom|nlinum-hl-line nil t)
|
||||
(doom|nlinum-unhl-line))
|
||||
(doom--nlinum-unhl-line))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom|nlinum-disable (&rest _)
|
||||
(nlinum-mode -1)
|
||||
(remove-hook 'post-command-hook 'doom|nlinum-hl-line t)
|
||||
(doom|nlinum-unhl-line))
|
||||
(doom--nlinum-unhl-line))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom|nlinum-unhl-line ()
|
||||
(defun doom--nlinum-unhl-line ()
|
||||
"Unhighlight line number"
|
||||
(when doom--hl-nlinum-overlay
|
||||
(let* ((disp (get-text-property
|
||||
0 'display (overlay-get doom--hl-nlinum-overlay 'before-string)))
|
||||
(str (nth 1 disp)))
|
||||
(put-text-property 0 (length str) 'face 'linum str)
|
||||
(setq doom--hl-nlinum-overlay nil
|
||||
doom--hl-nlinum-line nil)
|
||||
(setq doom--hl-nlinum-overlay nil)
|
||||
disp)))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom|nlinum-hl-line (&optional line)
|
||||
(defun doom|nlinum-hl-line ()
|
||||
"Highlight line number"
|
||||
(let ((line-no (or line (string-to-number (format-mode-line "%l")))))
|
||||
(unless doom--hl-nlinum-line
|
||||
(setq doom--hl-nlinum-line line-no))
|
||||
(if (and nlinum-mode (or (not (= line-no doom--hl-nlinum-line))
|
||||
(memq this-command '(next-line previous-line
|
||||
evil-window-bottom evil-window-top
|
||||
evil-goto-line evil-goto-first-line))))
|
||||
(let* ((pbol (line-beginning-position))
|
||||
(peol (1+ pbol))
|
||||
(max (point-max)))
|
||||
;; Handle EOF case
|
||||
(when (>= peol max)
|
||||
(setq peol max))
|
||||
(jit-lock-fontify-now pbol peol)
|
||||
(let ((ov (--first (overlay-get it 'nlinum) (overlays-in pbol peol))))
|
||||
(when ov
|
||||
(doom|nlinum-unhl-line)
|
||||
(let ((str (nth 1 (get-text-property 0 'display (overlay-get ov 'before-string)))))
|
||||
(put-text-property 0 (length str) 'face 'doom-nlinum-highlight str)
|
||||
(setq doom--hl-nlinum-line line-no
|
||||
doom--hl-nlinum-overlay ov))))))))
|
||||
(let* ((pbol (line-beginning-position))
|
||||
(peol (1+ pbol))
|
||||
(max (point-max)))
|
||||
;; Handle EOF case
|
||||
(when (>= peol max)
|
||||
(setq peol max))
|
||||
(jit-lock-fontify-now pbol peol)
|
||||
(let ((ov (--first (overlay-get it 'nlinum) (overlays-in pbol peol))))
|
||||
(doom--nlinum-unhl-line)
|
||||
(when ov
|
||||
(let ((str (nth 1 (get-text-property 0 'display (overlay-get ov 'before-string)))))
|
||||
(put-text-property 0 (length str) 'face 'doom-nlinum-highlight str)
|
||||
(setq doom--hl-nlinum-overlay ov))))))
|
||||
|
||||
(provide 'defuns-nlinum)
|
||||
;;; defuns-nlinum.el ends here
|
||||
|
|
|
@ -144,7 +144,6 @@ the display (unless DONT-REDRAW is non-nil)."
|
|||
doom-popup-rules))))
|
||||
(setq doom-last-popup (current-buffer))
|
||||
(setq-local doom-popup-rule rules)
|
||||
;; (set-window-dedicated-p (selected-window) doom-popup-mode)
|
||||
(unless (memq :noesc rules)
|
||||
(make-local-variable 'doom-popup-mode-map)
|
||||
(let ((map doom-popup-mode-map))
|
||||
|
|
|
@ -4,11 +4,10 @@
|
|||
(defmacro def-yas-mode! (mode)
|
||||
"Register minor MODES in yasnippet."
|
||||
`(after! yasnippet
|
||||
(when (boundp 'yas--extra-modes)
|
||||
(add-hook! ,mode
|
||||
(if (symbol-value ,mode)
|
||||
(yas-activate-extra-mode ,mode)
|
||||
(yas-deactivate-extra-mode ,mode))))))
|
||||
(add-hook! ,mode
|
||||
(if ,mode
|
||||
(yas-activate-extra-mode ,mode)
|
||||
(yas-deactivate-extra-mode ,mode)))))
|
||||
|
||||
(provide 'macros-yasnippet)
|
||||
;;; macros-yasnippet.el ends here
|
||||
|
|
10
init.el
10
init.el
|
@ -83,11 +83,11 @@
|
|||
module-eshell ; for inferior OSes *cough*windows
|
||||
module-org ; for organized fearless leader
|
||||
|
||||
;;; Extra libraries
|
||||
extra-demo ; allow me to demonstrate...
|
||||
extra-tags ; if you liked it you should've generated a tag for it
|
||||
extra-tmux ; close the rift between GUI & terminal
|
||||
extra-write ; Emacs as a word processor
|
||||
;;; Custom modules
|
||||
custom-demo ; allow me to demonstrate...
|
||||
custom-tags ; if you liked it you should've generated a tag for it
|
||||
custom-tmux ; close the rift between GUI & terminal
|
||||
custom-write ; Emacs as a word processor
|
||||
|
||||
;;; Personal
|
||||
my-commands
|
||||
|
|
55
modules/custom-demo.el
Normal file
55
modules/custom-demo.el
Normal file
|
@ -0,0 +1,55 @@
|
|||
;;; custom-demo.el --- -*- no-byte-compile: t; -*-
|
||||
|
||||
(defvar powerline-height)
|
||||
|
||||
;; This library offers:
|
||||
;; + impatient-mode: for broadcasting my emacs session
|
||||
;; + big-mode: for enlarged text while screencasting
|
||||
;; + TODO integration with reveal.js for presentations
|
||||
;; + TODO peer programming collab
|
||||
|
||||
;; Big-mode settings
|
||||
(defconst big-mode-font (font-spec :family "Inconsolata" :size 16))
|
||||
(defconst big-mode-line-spacing 0)
|
||||
(defconst big-mode-modeline-height 35)
|
||||
|
||||
;;
|
||||
(use-package impatient-mode
|
||||
:commands impatient-mode
|
||||
:config (httpd-start))
|
||||
|
||||
(defvar big-mode--old-line-spacing line-spacing)
|
||||
(defvar big-mode--old-modeline-height powerline-height)
|
||||
(define-minor-mode big-mode
|
||||
:init-value nil
|
||||
:lighter " BIG"
|
||||
:global t
|
||||
(when big-mode-font
|
||||
(doom/load-font (if big-mode big-mode-font doom-default-font)))
|
||||
(if big-mode
|
||||
(setq-default
|
||||
powerline-height big-mode-modeline-height
|
||||
line-spacing big-mode-line-spacing)
|
||||
(setq-default
|
||||
powerline-height big-mode--old-modeline-height
|
||||
line-spacing big-mode--old-line-spacing)))
|
||||
|
||||
(evil-define-command doom:big (&optional size)
|
||||
"Use to enable large text mode."
|
||||
(interactive "<a>")
|
||||
(if size
|
||||
(let ((big-mode-font big-mode-font))
|
||||
(big-mode -1)
|
||||
(font-put big-mode-font :size (string-to-int size))
|
||||
(big-mode +1))
|
||||
(big-mode (if big-mode -1 +1))))
|
||||
|
||||
(defun doom/resize-for-stream ()
|
||||
"Resize the frame pixelwise, so that it fits directly into my livecoding.tv
|
||||
streaming layout."
|
||||
(interactive)
|
||||
(set-frame-width (selected-frame) 1325 nil t)
|
||||
(set-frame-height (selected-frame) 1080 nil t))
|
||||
|
||||
(provide 'custom-demo)
|
||||
;;; custom-demo.el ends here
|
|
@ -1,4 +1,4 @@
|
|||
;;; extra-tags.el
|
||||
;;; custom-tags.el
|
||||
|
||||
;; WIP
|
||||
|
||||
|
@ -27,6 +27,7 @@
|
|||
|
||||
;;;###autoload
|
||||
(defun doom/find-def ()
|
||||
"Find definition using tags, falling back to dumb-jump otherwise."
|
||||
(interactive)
|
||||
(let ((orig-pt (point))
|
||||
(orig-file (buffer-file-name)))
|
||||
|
@ -44,5 +45,5 @@
|
|||
(let ((path (expand-file-name ".tags" (doom/project-root))))
|
||||
(and (f-exists? path) path)))
|
||||
|
||||
(provide 'extra-tags)
|
||||
;;; extra-tags.el ends here
|
||||
(provide 'custom-tags)
|
||||
;;; custom-tags.el ends here
|
|
@ -1,4 +1,4 @@
|
|||
;;; extra-tmux.el
|
||||
;;; custom-tmux.el
|
||||
|
||||
;; This library offers:
|
||||
;; + A way of communicating with a tmux instance
|
||||
|
@ -24,7 +24,7 @@
|
|||
:ex-arg shell
|
||||
(list (when (evil-ex-p) (evil-ex-file-arg))))
|
||||
|
||||
;;;###autoload (autoload 'doom:tmux-cd "extra-tmux" nil t)
|
||||
;;;###autoload (autoload 'doom:tmux-cd "custom-tmux" nil t)
|
||||
(evil-define-command doom:tmux-cd (&optional bang)
|
||||
(interactive "<!>")
|
||||
(if bang
|
||||
|
@ -32,7 +32,7 @@
|
|||
(doom/tmux-cd-to-here)))
|
||||
|
||||
(defvar doom-tmux-last-command nil "The last command sent to tmux")
|
||||
;;;###autoload (autoload 'doom:tmux "extra-tmux" nil t)
|
||||
;;;###autoload (autoload 'doom:tmux "custom-tmux" nil t)
|
||||
(evil-define-operator doom:tmux (&optional command bang)
|
||||
"Sends input to tmux. Use `bang' to append to tmux"
|
||||
:type inclusive
|
||||
|
@ -56,5 +56,5 @@
|
|||
(interactive)
|
||||
(doom/tmux-cd-to-here (doom/project-root)))
|
||||
|
||||
(provide 'extra-tmux)
|
||||
;;; extra-tmux.el ends here
|
||||
(provide 'custom-tmux)
|
||||
;;; custom-tmux.el ends here
|
51
modules/custom-write.el
Normal file
51
modules/custom-write.el
Normal file
|
@ -0,0 +1,51 @@
|
|||
;; custom-write.el
|
||||
|
||||
;; This library offers the following:
|
||||
;; + Write-mode: a mode that turns Emacs into an app for writing notes,
|
||||
;; papers, or fiction: it adds eye-candy to org-mode, switches to a light
|
||||
;; color theme and to a more readable font.
|
||||
;; + Bibtex integration
|
||||
|
||||
;; Write-mode settings
|
||||
(defconst write-mode-theme 'doom-one)
|
||||
(defconst write-mode-font (font-spec :family "Source Sans Pro" :size 14))
|
||||
|
||||
(defconst write-mode--last-mode-line mode-line-format)
|
||||
(defconst write-mode--last-theme doom-current-theme)
|
||||
(defconst write-mode--last-line-spacing line-spacing)
|
||||
|
||||
(after! spaceline
|
||||
(spaceline-compile
|
||||
'write
|
||||
'(((*macro-recording *anzu *iedit *evil-substitute *flycheck)
|
||||
:skip-alternate t
|
||||
:tight t)
|
||||
*buffer-path
|
||||
*buffer-modified)
|
||||
'((*selection-info :when active)
|
||||
*buffer-encoding-abbrev
|
||||
(global :when active)
|
||||
*buffer-position
|
||||
*pad)))
|
||||
|
||||
(defvar write-mode nil)
|
||||
(defun doom/write-mode ()
|
||||
"A mode that turns Emacs into an app for writing notes, papers, or fiction: it
|
||||
adds eye-candy to org-mode, switches to a light color theme and to a more
|
||||
readable font."
|
||||
(interactive)
|
||||
(setq write-mode (not write-mode))
|
||||
(when write-mode-theme
|
||||
(doom/load-theme (if write-mode write-mode-theme write-mode--last-theme) t))
|
||||
(when write-mode-font
|
||||
(doom/load-font (if write-mode write-mode-font doom-default-font)))
|
||||
(mapc (lambda (b)
|
||||
(with-current-buffer b
|
||||
(setq line-spacing (if write-mode write-mode--last-line-spacing '2))
|
||||
(when (featurep 'spaceline)
|
||||
(let ((doom-hide-mode-line-format '("%e" (:eval (spaceline-ml-write)))))
|
||||
(doom-hide-mode-line-mode (if write-mode +1 -1))))))
|
||||
(doom/get-buffers-in-modes '(org-mode markdown-mode))))
|
||||
|
||||
(provide 'custom-write)
|
||||
;;; custom-write.el ends here
|
|
@ -1,51 +0,0 @@
|
|||
;;; extra-demo.el --- -*- no-byte-compile: t; -*-
|
||||
|
||||
(defvar powerline-height)
|
||||
|
||||
;; This library offers:
|
||||
;; + impatient-mode: for broadcasting my emacs session
|
||||
;; + big-mode: for enlarged text while screencasting
|
||||
;; + TODO integration with reveal.js for presentations
|
||||
;; + TODO peer programming collab
|
||||
|
||||
;; Big-mode settings
|
||||
(defconst big-mode-font (font-spec :family "Inconsolata" :size 16))
|
||||
(defconst big-mode-line-spacing 0)
|
||||
(defconst big-mode-modeline-height 35)
|
||||
|
||||
;;
|
||||
(use-package impatient-mode
|
||||
:commands impatient-mode
|
||||
:config (httpd-start))
|
||||
|
||||
(defvar big-mode--line-spacing line-spacing)
|
||||
(defvar big-mode--powerline-height powerline-height)
|
||||
(define-minor-mode big-mode
|
||||
:init-value nil
|
||||
:lighter " BIG"
|
||||
:global t
|
||||
(doom/load-font (if big-mode big-mode-font doom-default-font))
|
||||
(setq-default
|
||||
powerline-height
|
||||
(if big-mode big-mode-modeline-height big-mode--powerline-height)
|
||||
line-spacing
|
||||
(if big-mode big-mode-line-spacing big-mode--line-spacing))
|
||||
(if big-mode
|
||||
(progn
|
||||
(setq neo-window-width 25)
|
||||
(add-hook 'neo-after-create-hook 'doom|text-scale-1))
|
||||
(setq neo-window-width 28)
|
||||
(remove-hook 'neo-after-create-hook 'doom|text-scale-1)))
|
||||
|
||||
(defun doom|text-scale-1 (&rest _)
|
||||
(text-scale-set -1) (setq line-spacing 0))
|
||||
|
||||
(evil-define-command doom:big-mode (&optional size)
|
||||
(interactive "<a>")
|
||||
(let ((big-mode-font big-mode-font))
|
||||
(when (and size (not big-mode))
|
||||
(font-put big-mode-font :size (string-to-int size)))
|
||||
(big-mode (if big-mode -1 +1))))
|
||||
|
||||
(provide 'extra-demo)
|
||||
;;; extra-demo.el ends here
|
|
@ -1,83 +0,0 @@
|
|||
;; extra-write.el
|
||||
|
||||
;; This library offers the following:
|
||||
;; + TODO Write-mode: a mode that turns Emacs into an app for writing notes, papers, or
|
||||
;; fiction: it adds eye-candy to org-mode, switches to a light color theme and to a
|
||||
;; more readable font.
|
||||
;; + Bibtex integration
|
||||
|
||||
;; Write-mode settings
|
||||
(defconst write-mode nil)
|
||||
(defconst write-mode-theme 'doom-light)
|
||||
(defconst write-mode-font (font-spec :family "Hack" :size 12))
|
||||
|
||||
(defconst write-mode--last-mode-line mode-line-format)
|
||||
(defconst write-mode--last-theme doom-current-theme)
|
||||
(defconst write-mode--last-line-spacing line-spacing)
|
||||
|
||||
(after! spaceline
|
||||
(spaceline-compile
|
||||
'write
|
||||
'(((*macro-recording *anzu *iedit *evil-substitute *flycheck)
|
||||
:skip-alternate t
|
||||
:tight t)
|
||||
*buffer-path
|
||||
*buffer-modified)
|
||||
'((*selection-info :when active)
|
||||
*buffer-encoding-abbrev
|
||||
(global :when active)
|
||||
*buffer-position
|
||||
*pad)))
|
||||
|
||||
;;
|
||||
(defun write-mode|org-hook ()
|
||||
"A hook that runs in org-mode buffers when `write-mode' is active."
|
||||
(when write-mode
|
||||
(setq header-line-format '("%e" (:eval (spaceline-ml-write)))
|
||||
mode-line-format nil)))
|
||||
|
||||
(defun write-mode-toggle ()
|
||||
"Enable write-mode, this is not a [global] minor mode because it mixes some frame-local
|
||||
functionality with buffer-local ones, which can be buggy in a minor-mode."
|
||||
(interactive)
|
||||
(let* ((mode-p write-mode)
|
||||
(on-off (if mode-p -1 +1)))
|
||||
(doom/load-theme (if mode-p write-mode--last-theme write-mode-theme) t)
|
||||
(doom/load-font (if mode-p doom-default-font write-mode-font))
|
||||
(if mode-p
|
||||
(remove-hook 'org-mode-hook 'write-mode|org-hook)
|
||||
(add-hook 'org-mode-hook 'write-mode|org-hook))
|
||||
(mapc (lambda (b)
|
||||
(with-current-buffer b
|
||||
(setq line-spacing (if mode-p write-mode--last-line-spacing '2))
|
||||
(when (and (eq major-mode 'org-mode)
|
||||
(not mode-p))
|
||||
(write-mode|org-hook))
|
||||
(unless mode-p
|
||||
(setq mode-line-format write-mode--last-mode-line
|
||||
header-line-format nil))))
|
||||
(doom/get-buffers-in-modes '(org-mode markdown-mode)))
|
||||
(setq write-mode (not mode-p))))
|
||||
|
||||
(when (> emacs-major-version 24)
|
||||
;; From <https://github.com/joostkremers/visual-fill-column/pull/6>
|
||||
;; Splitting windows while visual-fill-column makes Emacs go crazy. This prevents that
|
||||
;; by simply disabled VFC before splitting.
|
||||
(after! visual-fill-column
|
||||
(advice-add 'split-window :around #'visual-fill-column--disable-on-split-window))
|
||||
(defun visual-fill-column--disable-on-split-window (fn window &rest args)
|
||||
"Undo the effects of `visual-fill-column-mode' for splitting window."
|
||||
(if (and (or (not window) (window-live-p window))
|
||||
(buffer-local-value 'visual-fill-column-mode
|
||||
(window-buffer (or window (selected-window)))))
|
||||
(let ((inhibit-redisplay t))
|
||||
(set-window-fringes (or window (selected-window)) nil)
|
||||
(set-window-margins (or window (selected-window)) 0 0)
|
||||
(unwind-protect (apply fn window args)
|
||||
(save-selected-window
|
||||
(when window (select-window window 'norecord))
|
||||
(visual-fill-column--adjust-window))))
|
||||
(apply fn window args))))
|
||||
|
||||
(provide 'extra-write)
|
||||
;;; extra-write.el ends here
|
|
@ -45,7 +45,7 @@
|
|||
:config
|
||||
(setq irony-server-install-prefix (concat doom-temp-dir "/irony/"))
|
||||
(add-hook! c++-mode
|
||||
(make-variable-buffer-local 'irony-additional-clang-options)
|
||||
(make-local-variable 'irony-additional-clang-options)
|
||||
(push "-std=c++11" irony-additional-clang-options))
|
||||
|
||||
(require 'irony-eldoc)
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
(setq omnisharp-auto-complete-want-documentation nil
|
||||
omnisharp-server-executable-path (concat doom-ext-dir "/OmniSharp.exe"))
|
||||
:when (file-exists-p omnisharp-server-executable-path)
|
||||
:init (add-hook! csharp-mode '(turn-on-eldoc-mode omnisharp-mode))
|
||||
:init (add-hook! csharp-mode '(eldoc-mode omnisharp-mode))
|
||||
:config
|
||||
(def-company-backend! csharp-mode (omnisharp))
|
||||
(map! :map omnisharp-mode-map
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
(use-package css-mode
|
||||
:mode "\\.css$"
|
||||
:init (add-hook! css-mode '(yas-minor-mode-on flycheck-mode rainbow-mode))
|
||||
:init (add-hook! css-mode '(yas-minor-mode-on flycheck-mode rainbow-mode highlight-numbers-mode))
|
||||
:config
|
||||
(def-company-backend! css-mode (css yasnippet))
|
||||
(push '("css" "scss" "sass" "less" "styl") projectile-other-file-alist))
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
;;; module-elisp --- all things lisp
|
||||
|
||||
(associate! emacs-lisp-mode :match "\\(/Cask\\|\\.\\(el\\|gz\\)\\)$")
|
||||
(add-hook! emacs-lisp-mode '(turn-on-eldoc-mode flycheck-mode highlight-numbers-mode))
|
||||
(add-hook! emacs-lisp-mode '(eldoc-mode flycheck-mode highlight-numbers-mode))
|
||||
|
||||
;; Real go-to-definition for elisp
|
||||
(map! :map emacs-lisp-mode-map :m "gd" 'doom/elisp-find-function-at-pt)
|
||||
|
@ -46,7 +46,7 @@
|
|||
(,(concat
|
||||
"(\\("
|
||||
(regexp-opt '("λ" "in" "map" "after" "shut-up" "add-hook"
|
||||
"associate" "define-org-link" "ex"
|
||||
"associate" "define-org-link" "ex" "ex-local"
|
||||
"define-org-section" "set" "noop"))
|
||||
"!\\)")
|
||||
(1 font-lock-keyword-face append))
|
||||
|
@ -103,11 +103,10 @@
|
|||
:config (setq inferior-lisp-program "clisp"))
|
||||
|
||||
(use-package auto-compile
|
||||
:commands (auto-compile-on-save-mode)
|
||||
:commands auto-compile-on-save-mode
|
||||
:init (add-hook 'emacs-lisp-mode-hook 'auto-compile-on-save-mode)
|
||||
:config (setq auto-compile-display-buffer nil))
|
||||
|
||||
|
||||
;;
|
||||
(def-project-type! emacs-ert "ert"
|
||||
:modes (emacs-lisp-mode)
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
:init
|
||||
(add-hook! (java-mode groovy-mode nxml-mode) 'doom|android-mode-enable-maybe)
|
||||
:config
|
||||
(def-yas-mode! 'android-mode)
|
||||
(def-yas-mode! android-mode)
|
||||
(after! company-dict
|
||||
(push 'android-mode company-dict-minor-mode-list)))
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
(use-package php-extras
|
||||
:after php-mode
|
||||
:init (add-hook 'php-mode-hook 'turn-on-eldoc-mode)
|
||||
:init (add-hook 'php-mode-hook 'eldoc-mode)
|
||||
:config
|
||||
(defun php-extras-company-setup ()) ;; company will set up itself
|
||||
;; Generate php-extras documentation and completion asynchronously
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
:init (associate! nose-mode :match "/test_.+\\.py$" :in (python-mode))
|
||||
:config
|
||||
(def-popup! "*nosetests*" :align below :size 0.4 :noselect t)
|
||||
(def-yas-mode! 'nose-mode)
|
||||
(def-yas-mode! nose-mode)
|
||||
(map! :map nose-mode-map
|
||||
(:localleader
|
||||
:n "tr" 'nosetests-again
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
(use-package scala-mode
|
||||
:mode "\\.s\\(cala\\|bt\\)$"
|
||||
:init (add-hook 'scala-mode-hook 'turn-on-eldoc-mode)
|
||||
:init (add-hook 'scala-mode-hook 'eldoc-mode)
|
||||
:config (def-company-backend! scala-mode '(ensime-company (company-yasnippet))))
|
||||
|
||||
(use-package sbt-mode
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
:mode ("\\.m\\(d\\|arkdown\\)$" "/README$"
|
||||
("/README\\.md$" . gfm-mode))
|
||||
:init
|
||||
(add-hook 'markdown-mode-hook 'turn-on-auto-fill)
|
||||
(add-hook 'markdown-mode-hook 'auto-fill-mode)
|
||||
(setq markdown-enable-wiki-links t
|
||||
markdown-italic-underscore t
|
||||
markdown-enable-math t
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
(ex! "bc[omp]" 'doom:byte-compile)
|
||||
(ex! "re[load]" 'doom-reload)
|
||||
(ex! "re[load]au" 'doom-reload-autoloads)
|
||||
(ex! "clog" 'clm/toggle-command-log-buffer)
|
||||
|
||||
;; Quick mapping keys to commands, allows :nmap \m !make
|
||||
(ex! "imap" 'doom:imap)
|
||||
|
@ -41,7 +42,7 @@
|
|||
(ex! "db" 'doom:db)
|
||||
(ex! "dbu[se]" 'doom:db-select)
|
||||
(ex! "http" 'httpd-start) ; start http server
|
||||
(ex! "re[gex]" 'doom:regex) ; open re-builder
|
||||
(ex! "rx" 'doom:regex) ; open re-builder
|
||||
(ex! "repl" 'doom:repl) ; invoke or send to repl
|
||||
(ex! "sh[ell]" 'doom/eshell)
|
||||
(ex! "t[mux]" 'doom:tmux) ; send to tmux
|
||||
|
@ -98,9 +99,11 @@
|
|||
(ex! "tabs" 'doom/tab-display)
|
||||
|
||||
;; Org-mode
|
||||
(ex! "att[ach]" 'doom:org-attach) ; attach file to org file
|
||||
(ex! "link" 'doom:org-link)
|
||||
(ex! "org" 'doom:org-helm-search) ; search org notes
|
||||
(add-hook! org-mode
|
||||
;;(ex! "org" 'doom:org-helm-search) ; search org notes
|
||||
(ex! "att[ach]" 'doom:org-attach) ; attach file to org file
|
||||
(ex! "link" 'doom:org-link)
|
||||
(ex-local! "vlc" 'doom-org-insert-vlc))
|
||||
|
||||
(provide 'my-commands)
|
||||
;;; my-commands.el ends here
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue