General cleanup + refactor
This commit is contained in:
parent
c427842a04
commit
91a87e7ee1
14 changed files with 74 additions and 76 deletions
|
@ -27,10 +27,7 @@
|
|||
|
||||
(global-company-mode +1))
|
||||
|
||||
(use-package company-dabbrev :commands company-dabbrev)
|
||||
|
||||
(use-package company-dabbrev-code :commands company-dabbrev-code)
|
||||
|
||||
;; NOTE: Doesn't look pretty outside of emacs-mac
|
||||
(use-package company-quickhelp
|
||||
:after company
|
||||
:config (company-quickhelp-mode +1))
|
||||
|
@ -39,6 +36,10 @@
|
|||
:after company
|
||||
:config (company-statistics-mode +1))
|
||||
|
||||
(use-package company-dabbrev :commands company-dabbrev)
|
||||
|
||||
(use-package company-dabbrev-code :commands company-dabbrev-code)
|
||||
|
||||
(use-package company-files
|
||||
:commands company-files)
|
||||
|
||||
|
|
|
@ -39,29 +39,15 @@ during compilation."
|
|||
HOOK can be one hook or a list of hooks. If the hook(s) are not quoted, -hook is
|
||||
appended to them automatically. If they are quoted, they are used verbatim.
|
||||
|
||||
FUNC-OR-FORMS can be one quoted symbol, a list of quoted symbols, or a series of
|
||||
forms. Forms will be wrapped in one lambda. A list of symbols will expand into a
|
||||
series of add-hook calls.
|
||||
FUNC-OR-FORMS can be a quoted symbol, a list of quoted symbols, or forms. Forms will be
|
||||
wrapped in a lambda. A list of symbols will expand into a series of add-hook calls.
|
||||
|
||||
Examples:
|
||||
(add-hook! 'some-mode-hook 'enable-something)
|
||||
=> (add-hook 'some-mode-hook 'enable-something)
|
||||
|
||||
(add-hook! some-mode '(enable-something and-another))
|
||||
=> (add-hook 'some-mode-hook 'enable-something)
|
||||
(add-hook 'some-mode-hook 'and-another)
|
||||
|
||||
(add-hook! '(one-mode-hook second-mode-hook) 'enable-something)
|
||||
=> (add-hook 'one-mode-hook 'enable-something)
|
||||
(add-hook 'second-mode-hook 'enable-something)
|
||||
|
||||
(add-hook! (one-mode second-mode) 'enable-something)
|
||||
=> (add-hook 'one-mode-hook 'enable-something)
|
||||
(add-hook 'second-mode-hook 'enable-something)
|
||||
|
||||
(add-hook! (one-mode second-mode) (setq v 5) (setq a 2))
|
||||
=> (add-hook 'one-mode-hook (lambda () (setq v 5) (setq a 2)))
|
||||
(add-hook 'second-mode-hook (lambda () (setq v 5) (setq a 2)))"
|
||||
(add-hook! (one-mode second-mode) (setq v 5) (setq a 2))"
|
||||
(declare (indent defun) (debug t))
|
||||
(unless func-or-forms
|
||||
(error "add-hook!: FUNC-OR-FORMS is empty"))
|
||||
|
@ -259,7 +245,10 @@ Examples:
|
|||
(concat " ∴ " (abbreviate-file-name default-directory)))))))
|
||||
|
||||
|
||||
;;;; Global Defuns ;;;;;;;;;;;;;;;;;;;;;
|
||||
;;
|
||||
;; Global Defuns
|
||||
;;
|
||||
|
||||
(defun narf-reload ()
|
||||
"Reload `load-path', in case you updated cask while emacs was open!"
|
||||
(interactive)
|
||||
|
|
|
@ -9,10 +9,12 @@
|
|||
flycheck-disabled-checkers '(emacs-lisp emacs-lisp-checkdoc make))
|
||||
|
||||
:config
|
||||
;; fixes Unknown defun property `interactive-only' error by compiling flycheck
|
||||
(let ((path (locate-library "flycheck")))
|
||||
(unless (f-ext? path "elc")
|
||||
(byte-compile-file path)))
|
||||
(unless (> emacs-major-version 24)
|
||||
;; Fixes Unknown defun property `interactive-only' error (in emacs <25) by compiling
|
||||
;; flycheck source files
|
||||
(let ((path (locate-library "flycheck")))
|
||||
(unless (f-ext? path "elc")
|
||||
(byte-compile-file path))))
|
||||
|
||||
(map! :map flycheck-error-list-mode-map
|
||||
:n "C-n" 'flycheck-error-list-next-error
|
||||
|
|
|
@ -111,20 +111,20 @@
|
|||
"r" 'neotree-rename-node
|
||||
"R" 'neotree-change-root))
|
||||
|
||||
;; Shorter pwd in neotree
|
||||
(defun narf*neotree-shorten-pwd (node)
|
||||
"Shorter pwd in neotree"
|
||||
(list (abbreviate-file-name (car node))))
|
||||
(advice-add 'neo-buffer--insert-root-entry :filter-args 'narf*neotree-shorten-pwd)
|
||||
|
||||
;; Don't ask for confirmation when creating files
|
||||
(defun narf*neotree-create-node (orig-fun &rest args)
|
||||
"Don't ask for confirmation when creating files"
|
||||
(cl-letf (((symbol-function 'yes-or-no-p) (lambda (&rest _) t)))
|
||||
(apply orig-fun args)))
|
||||
(advice-add 'neotree-create-node :around 'narf*neotree-create-node)
|
||||
|
||||
(defun narf*save-neotree (orig-fun &rest args)
|
||||
"Prevents messing up the neotree buffer on window changes"
|
||||
(narf/neotree-save (apply orig-fun args)))
|
||||
;; Prevents messing up the neotree buffer on window changes
|
||||
(advice-add 'narf--evil-window-move :around 'narf*save-neotree)
|
||||
(advice-add 'narf--evil-swap-windows :around 'narf*save-neotree)
|
||||
|
||||
|
|
|
@ -62,8 +62,8 @@
|
|||
(fringe-mode narf-fringe-size)
|
||||
;; Show tilde in margin on empty lines
|
||||
(define-fringe-bitmap 'tilde [64 168 16] nil nil 'center)
|
||||
(setcdr (assq 'empty-line fringe-indicator-alist) 'tilde)
|
||||
(set-fringe-bitmap-face 'tilde 'font-lock-comment-face)
|
||||
(setcdr (assq 'empty-line fringe-indicator-alist) 'tilde)
|
||||
;; Brighter minibuffer when active + no fringe in minibuffer
|
||||
(defface narf-minibuffer-active '((t (:inherit mode-line)))
|
||||
"Face for active minibuffer")
|
||||
|
@ -155,16 +155,13 @@
|
|||
(add-hook! (emacs-lisp-mode lisp-mode js2-mode scss-mode c-mode-common)
|
||||
'rainbow-delimiters-mode)
|
||||
:config
|
||||
(setq rainbow-delimiters-max-face-count 4))
|
||||
(setq rainbow-delimiters-max-face-count 3))
|
||||
|
||||
(use-package rainbow-mode
|
||||
:commands (rainbow-mode)
|
||||
:init
|
||||
(add-hook! (sass-mode scss-mode less-css-mode) 'rainbow-mode)
|
||||
;; hl-line-mode and rainbow-mode don't play well together
|
||||
(add-hook! rainbow-mode
|
||||
(when narf--hl-line-mode
|
||||
(hl-line-mode (if rainbow-mode -1 1)))))
|
||||
;; NOTE: hl-line-mode and rainbow-mode don't play well together
|
||||
(add-hook! (sass-mode scss-mode less-css-mode) '(rainbow-mode narf|hl-line-off)))
|
||||
|
||||
(use-package nlinum
|
||||
:commands nlinum-mode
|
||||
|
@ -405,6 +402,7 @@ anzu to be enabled."
|
|||
:tight t)
|
||||
|
||||
(spaceline-compile
|
||||
'main
|
||||
;; Left side
|
||||
'(((*macro-recording *anzu *iedit *evil-substitute *flycheck)
|
||||
:skip-alternate t
|
||||
|
|
|
@ -103,7 +103,7 @@ buffer to display.")
|
|||
"*Buffer List*" "*Ibuffer*" "*esh command on file*"
|
||||
"*WoMan-Log*" "*compilation*" "*use-package*"
|
||||
"*quickrun*" "*eclim: problems*" "*Flycheck errors*"
|
||||
"*popwin-dummy*" " *NeoTree*"
|
||||
"*popwin-dummy*" "*NeoTree*" " *NeoTree*"
|
||||
;; Helm
|
||||
"*helm*" "*helm recentf*" "*helm projectile*" "*helm imenu*"
|
||||
"*helm company*" "*helm buffers*" "*Helm Css SCSS*"
|
||||
|
@ -139,6 +139,7 @@ gets killed.")
|
|||
;; Bootstrap
|
||||
;;
|
||||
|
||||
(require 'f)
|
||||
(autoload 'awhen "anaphora" "" nil 'macro)
|
||||
(autoload 'aif "anaphora" "" nil 'macro)
|
||||
(autoload 'use-package "use-package" "" nil 'macro)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue