General refactor

This commit is contained in:
Henrik Lissner 2016-05-06 01:57:50 -04:00
parent 2538de1a92
commit 601b422943
3 changed files with 15 additions and 13 deletions

View file

@ -34,10 +34,10 @@ provided."
(let ((dir (f-dirname path)) (let ((dir (f-dirname path))
(fullpath (f-full path)) (fullpath (f-full path))
(is-auto t)) (is-auto t))
(when (and bang (not (file-exists-p dir))) (when (and bang (not (f-exists? dir)))
(f-mkdir dir)) (mkdir dir))
(if (file-exists-p dir) (if (f-exists? dir)
(if (file-exists-p fullpath) (if (f-exists? fullpath)
(error "File already exists: %s" path) (error "File already exists: %s" path)
(find-file fullpath) (find-file fullpath)
(add-hook 'yas-after-exit-snippet-hook 'narf--save-exit) (add-hook 'yas-after-exit-snippet-hook 'narf--save-exit)

View file

@ -7,6 +7,12 @@
(narf|nlinum-disable) (narf|nlinum-disable)
(narf|nlinum-enable))) (narf|nlinum-enable)))
;;;###autoload
(defun narf|nlinum-enable ()
(nlinum-mode +1)
(add-hook 'post-command-hook 'narf|nlinum-hl-line nil t)
(narf|nlinum-unhl-line))
;;;###autoload ;;;###autoload
(defun narf|nlinum-disable () (defun narf|nlinum-disable ()
(nlinum-mode -1) (nlinum-mode -1)

View file

@ -65,15 +65,11 @@
(add-hook 'before-save-hook 'delete-trailing-whitespace nil t) (add-hook 'before-save-hook 'delete-trailing-whitespace nil t)
(add-hook 'after-save-hook 'narf/elisp-auto-compile nil t) (add-hook 'after-save-hook 'narf/elisp-auto-compile nil t)
(let ((header-face 'font-lock-constant-face)) (dolist (i '(("Evil Command" "\\(^\\s-*(evil-define-command +\\)\\(\\_<.+\\_>\\)" 2)
(push '("Evil Command" "\\(^\\s-*(evil-define-command +\\)\\(\\_<.+\\_>\\)" 2) ("Evil Operator" "\\(^\\s-*(evil-define-operator +\\)\\(\\_<.+\\_>\\)" 2)
imenu-generic-expression) ("Package" "\\(^\\s-*(use-package +\\)\\(\\_<.+\\_>\\)" 2)
(push '("Evil Operator" "\\(^\\s-*(evil-define-operator +\\)\\(\\_<.+\\_>\\)" 2) ("Spaceline Segment" "\\(^\\s-*(spaceline-define-segment +\\)\\(\\_<.+\\_>\\)" 2)))
imenu-generic-expression) (push i imenu-generic-expression)))
(push '("Package" "\\(^\\s-*(use-package +\\)\\(\\_<.+\\_>\\)" 2)
imenu-generic-expression)
(push '("Spaceline Segment" "\\(^\\s-*(spaceline-define-segment +\\)\\(\\_<.+\\_>\\)" 2)
imenu-generic-expression)))
;; Add new colors to helm-imenu ;; Add new colors to helm-imenu
(after! helm-imenu (after! helm-imenu