General refactor
This commit is contained in:
parent
2538de1a92
commit
601b422943
3 changed files with 15 additions and 13 deletions
|
@ -34,10 +34,10 @@ provided."
|
|||
(let ((dir (f-dirname path))
|
||||
(fullpath (f-full path))
|
||||
(is-auto t))
|
||||
(when (and bang (not (file-exists-p dir)))
|
||||
(f-mkdir dir))
|
||||
(if (file-exists-p dir)
|
||||
(if (file-exists-p fullpath)
|
||||
(when (and bang (not (f-exists? dir)))
|
||||
(mkdir dir))
|
||||
(if (f-exists? dir)
|
||||
(if (f-exists? fullpath)
|
||||
(error "File already exists: %s" path)
|
||||
(find-file fullpath)
|
||||
(add-hook 'yas-after-exit-snippet-hook 'narf--save-exit)
|
||||
|
|
|
@ -7,6 +7,12 @@
|
|||
(narf|nlinum-disable)
|
||||
(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
|
||||
(defun narf|nlinum-disable ()
|
||||
(nlinum-mode -1)
|
||||
|
|
|
@ -65,15 +65,11 @@
|
|||
(add-hook 'before-save-hook 'delete-trailing-whitespace nil t)
|
||||
(add-hook 'after-save-hook 'narf/elisp-auto-compile nil t)
|
||||
|
||||
(let ((header-face 'font-lock-constant-face))
|
||||
(push '("Evil Command" "\\(^\\s-*(evil-define-command +\\)\\(\\_<.+\\_>\\)" 2)
|
||||
imenu-generic-expression)
|
||||
(push '("Evil Operator" "\\(^\\s-*(evil-define-operator +\\)\\(\\_<.+\\_>\\)" 2)
|
||||
imenu-generic-expression)
|
||||
(push '("Package" "\\(^\\s-*(use-package +\\)\\(\\_<.+\\_>\\)" 2)
|
||||
imenu-generic-expression)
|
||||
(push '("Spaceline Segment" "\\(^\\s-*(spaceline-define-segment +\\)\\(\\_<.+\\_>\\)" 2)
|
||||
imenu-generic-expression)))
|
||||
(dolist (i '(("Evil Command" "\\(^\\s-*(evil-define-command +\\)\\(\\_<.+\\_>\\)" 2)
|
||||
("Evil Operator" "\\(^\\s-*(evil-define-operator +\\)\\(\\_<.+\\_>\\)" 2)
|
||||
("Package" "\\(^\\s-*(use-package +\\)\\(\\_<.+\\_>\\)" 2)
|
||||
("Spaceline Segment" "\\(^\\s-*(spaceline-define-segment +\\)\\(\\_<.+\\_>\\)" 2)))
|
||||
(push i imenu-generic-expression)))
|
||||
|
||||
;; Add new colors to helm-imenu
|
||||
(after! helm-imenu
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue