General clean up

This commit is contained in:
Henrik Lissner 2016-05-19 03:17:59 -04:00
parent 455dd93faf
commit f6e5420887
4 changed files with 39 additions and 39 deletions

View file

@ -15,7 +15,6 @@
truncate-partial-width-windows 50
visual-fill-column-center-text nil
confirm-nonexistent-file-or-buffer nil
;; Sane scroll settings
scroll-margin 0
@ -82,35 +81,6 @@
(if indent-tabs-mode (whitespace-mode +1))))
;;
;; Automatic minor modes
;;
(defvar narf-auto-minor-mode-alist '()
"Alist of filename patterns vs corresponding minor mode functions, see
`auto-mode-alist'. All elements of this alist are checked, meaning you can
enable multiple minor modes for the same regexp.")
(defun narf|enable-minor-mode-maybe ()
"Check file name against `narf-auto-minor-mode-alist'."
(when buffer-file-name
(let ((name buffer-file-name)
(remote-id (file-remote-p buffer-file-name))
(alist narf-auto-minor-mode-alist))
;; Remove backup-suffixes from file name.
(setq name (file-name-sans-versions name))
;; Remove remote file name identification.
(when (and (stringp remote-id)
(string-match-p (regexp-quote remote-id) name))
(setq name (substring name (match-end 0))))
(while (and alist (caar alist) (cdar alist))
(if (string-match (caar alist) name)
(funcall (cdar alist) 1))
(setq alist (cdr alist))))))
(add-hook 'find-file-hook 'narf|enable-minor-mode-maybe)
;;
;; Modes, hooks 'n hacks
;;
@ -152,8 +122,6 @@ enable multiple minor modes for the same regexp.")
electric-indent-functions)
;;
;;(global-whitespace-mode -1) ; Show whitespace
;;(global-visual-line-mode -1) ; wrap buffers
(global-auto-revert-mode 1) ; revert buffers for changed files
;; Enable syntax highlighting for older emacs
(unless (bound-and-true-p global-font-lock-mode)
@ -198,10 +166,6 @@ enable multiple minor modes for the same regexp.")
(use-package goto-last-change :commands goto-last-change)
(use-package help-fns+ ; Improved help commands
:commands (describe-buffer describe-command describe-file
describe-keymap describe-option describe-option-of-type))
(use-package hideshow
:commands (hs-minor-mode hs-toggle-hiding hs-already-hidden-p)
:config (setq hs-isearch-open t)

View file

@ -165,6 +165,43 @@ folder is the root of a project or not.")
async-wait
async-inject-variables))
(use-package json
:commands (json-read-from-string json-encode json-read-file))
(use-package help-fns+ ; Improved help commands
:commands (describe-buffer describe-command describe-file
describe-keymap describe-option describe-option-of-type))
;;
;; Automatic minor modes
;;
(defvar narf-auto-minor-mode-alist '()
"Alist of filename patterns vs corresponding minor mode functions, see
`auto-mode-alist'. All elements of this alist are checked, meaning you can
enable multiple minor modes for the same regexp.")
(defun narf|enable-minor-mode-maybe ()
"Check file name against `narf-auto-minor-mode-alist'."
(when buffer-file-name
(let ((name buffer-file-name)
(remote-id (file-remote-p buffer-file-name))
(alist narf-auto-minor-mode-alist))
;; Remove backup-suffixes from file name.
(setq name (file-name-sans-versions name))
;; Remove remote file name identification.
(when (and (stringp remote-id)
(string-match-p (regexp-quote remote-id) name))
(setq name (substring name (match-end 0))))
(while (and alist (caar alist) (cdar alist))
(if (string-match (caar alist) name)
(funcall (cdar alist) 1))
(setq alist (cdr alist))))))
(add-hook 'find-file-hook 'narf|enable-minor-mode-maybe)
;;
(add-hook! after-init
;; We add this to `after-init-hook' to allow errors to stop this advice

View file

@ -6,8 +6,7 @@
(use-package css-mode
:mode "\\.css$"
:init
(add-hook! css-mode '(yas-minor-mode-on flycheck-mode))
:init (add-hook! css-mode '(yas-minor-mode-on flycheck-mode))
:config
(def-company-backend! css-mode (css yasnippet))
(push '("css" "scss" "sass" "less" "styl") projectile-other-file-alist))