This commit is contained in:
Henrik Lissner 2016-02-26 00:08:41 -05:00
parent a4fd3f3be5
commit b78d210ace
11 changed files with 71 additions and 82 deletions

View file

@ -15,6 +15,8 @@
truncate-lines t
truncate-partial-width-windows 50
visual-fill-column-center-text nil
;; Sane scroll settings
scroll-margin 0
scroll-conservatively 1001

View file

@ -26,8 +26,6 @@
split-width-threshold nil ; favor horizontal splits
show-help-function nil ; hide :help-echo text
visual-fill-column-center-text nil
bidi-display-reordering nil
;; Minibuffer resizing
@ -60,11 +58,13 @@
(menu-bar-mode -1))
;; Fix display of certain unicode characters
(mapc (lambda (x) (set-fontset-font "fontset-default" `(,x . ,x) (font-spec :name "DejaVu Sans") nil 'prepend))
'(?☑ ?☐ ?✍ ?⚠))
(mapc (lambda (x) (set-fontset-font "fontset-default" `(,x . ,x) (font-spec :name "DejaVu Sans") nil 'prepend))
'(?✸ ?✿ ?★))
(mapc (lambda (x) (set-fontset-font "fontset-default" `(,x . ,x) (font-spec :name "DejaVu Sans" :size 10) nil))
(mapc (lambda (x)
(set-fontset-font "fontset-default" `(,x . ,x)
(font-spec :name "DejaVu Sans") nil 'prepend))
'(?☑ ?☐ ?✍ ?⚠ ?★))
(mapc (lambda (x)
(set-fontset-font "fontset-default" `(,x . ,x)
(font-spec :name "DejaVu Sans" :size 10) nil))
'(?➊ ?➋ ?➌ ?➍ ?➎ ?❻ ?➐ ?➑ ?➒ ?➓ ))
(blink-cursor-mode 1) ; do blink cursor
@ -74,7 +74,7 @@
(global-eldoc-mode -1))
;; Highlight line
(add-hook! (prog-mode puml-mode markdown-mode) 'hl-line-mode)
(add-hook! (prog-mode markdown-mode) 'hl-line-mode)
;; Disable line highlight in visual mode
(defvar narf--hl-line-mode nil)
@ -101,7 +101,7 @@
;; Fade out when unfocused ;;;;;;;;;;;;;
(add-hook! focus-in (set-frame-parameter nil 'alpha 100))
(add-hook! focus-out (set-frame-parameter nil 'alpha 90))
(add-hook! focus-out (set-frame-parameter nil 'alpha 60))
;; Plugins ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(use-package visual-fill-column :defer t)

View file

@ -39,5 +39,10 @@
(beginning-of-line))
(setq *linum-mdown-line* nil))))
;;;###autoload
(defun narf*load-hs-minor-mode ()
(hs-minor-mode 1)
(advice-remove 'evil-toggle-fold 'narf-load-hs-minor-mode))
(provide 'defuns-editor)
;;; defuns-editor.el ends here

View file

@ -4,24 +4,8 @@
(defun narf/project-root (&optional strict-p)
"Get the path to the root of your project. Uses `narf-project-root-files' to
determine if a directory is a project."
(let (projectile-require-project-root strict-p) (projectile-project-root))
;; (let ((home (file-truename "~"))
;; (path default-directory))
;; (unless (file-name-absolute-p path)
;; (setq path (expand-file-name path)))
;; (catch 'found
;; (ignore-errors
;; (f-traverse-upwards
;; (lambda (path)
;; (let ((path (file-truename path)))
;; (if (file-equal-p home path)
;; (throw 'found (if strict-p nil default-directory))
;; (dolist (file narf-project-root-files)
;; (when (file-exists-p (expand-file-name file path))
;; (throw 'found path))))))
;; path))
;; default-directory))
)
(let (projectile-require-project-root strict-p)
(projectile-project-root)))
;;;###autoload
(defun narf/project-has-files (files &optional root)
@ -29,22 +13,19 @@ determine if a directory is a project."
(let ((root (or root (narf/project-root)))
(files (if (listp files) files (list files)))
(found-p (if files t)))
(while found-p
(setq found-p (file-exists-p (narf/project-path-to (pop files) root))))
(while (and found-p files)
(let ((file (expand-file-name (pop files) root)))
(setq found-p (if (string-suffix-p "/" file)
(file-directory-p file)
(file-exists-p file)))))
found-p))
;;;###autoload
(defun narf/project-path-to (file &optional root)
(let ((root (or root (narf/project-root))))
(expand-file-name file root)))
;;;###autoload
(defun narf/project-name (&optional root)
(file-name-nondirectory (directory-file-name (or root (narf/project-root)))))
;;;###autoload
(defun narf/project-p ()
(not (null (narf/project-root t))))
(defalias 'narf/project-p 'projectile-project-p)
(provide 'defuns-project)
;;; defuns-project.el ends here

View file

@ -13,8 +13,7 @@
(if quoted
backend
(intern (format "company-%s" backend))))
(if quoted (cadr backends) backends))
company-semantic company-yasnippet))
(if quoted (cadr backends) backends))))
company-backends)))
(add-hook ',(intern (format "%s-hook" hook)) ',def-name))))

View file

@ -2,6 +2,14 @@
;;;###autoload
(defmacro define-env-command! (mode command)
"Define a COMMAND for MODE that will set `narf--env-command' when that mode is
activated, which should return the version number of the current environment. It is used
by `narf|spaceline-env-update' to display a version number in the modeline. For instance:
(define-env-command! ruby-mode \"ruby --version | cut -d' ' -f2\")
This will display the ruby version in the modeline in ruby-mode buffers. It is cached the
first time."
(add-hook! (focus-in find-file) 'narf|spaceline-env-update)
`(add-hook ',(intern (format "%s-hook" (symbol-name mode)))
(lambda () (setq narf--env-command ,command))))