Various changes

Add colors to inheritance theme.  Use same default Haskell language
extensions across 3 different package.  Refactor mode line bell
function.  Automatically discover all projects in `~/git/*/*`.  Use
subword mode for JavaScript.  Also, the `window-system` on a Mac is
apparently `'ns`.
This commit is contained in:
Frederik Hanghøj Iversen 2019-06-05 15:52:02 +02:00
parent 3bfc0426d1
commit 1ecf7ef5de
2 changed files with 64 additions and 26 deletions

View file

@ -11,6 +11,11 @@
;;; Custom ;;; Custom
(defvar
haskell-language-extensions
(quote ("UnicodeSyntax" "TypeApplications" "OverloadedStrings" "LambdaCase" "StandaloneDeriving" "DerivingStrategies" "DeriveGeneric" "DeriveAnyClass" "KindSignatures" "DerivingVia" "ConstraintKinds" "FlexibleContexts" "GeneralizedNewtypeDeriving" "ExplicitForAll" "ScopedTypeVariables"))
"List of enabled Haskell language extensions.")
(custom-set-variables (custom-set-variables
;; custom-set-variables was added by Custom. ;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful. ;; If you edit it by hand, you could mess it up, so be careful.
@ -25,7 +30,7 @@
'(css-indent-offset 2) '(css-indent-offset 2)
'(custom-safe-themes '(custom-safe-themes
(quote (quote
("d59e18ab7969fd68103ab0fe07e03c1830fd77c21c12a3fb4fe970931ddaf68d" "670df6cad1a732850a5d90ce2b0326969bd7596881dc1fed6b35091520a3da97" "aa81baddda211ffab84a5dc68750ac519d4841be63907a6b5de0cd72e631b172" "c91a5bf65b3f79ab28ab350b1d16c24d8b8bc1201e9c6c2106a60f98bceae754" default))) ("224f84d5013ad0b98a43c54683302309a7cba53c0e37480a65284fd365774400" "d59e18ab7969fd68103ab0fe07e03c1830fd77c21c12a3fb4fe970931ddaf68d" "670df6cad1a732850a5d90ce2b0326969bd7596881dc1fed6b35091520a3da97" "aa81baddda211ffab84a5dc68750ac519d4841be63907a6b5de0cd72e631b172" "c91a5bf65b3f79ab28ab350b1d16c24d8b8bc1201e9c6c2106a60f98bceae754" default)))
'(delete-selection-mode t) '(delete-selection-mode t)
'(dired-isearch-filenames t) '(dired-isearch-filenames t)
'(display-buffer-alist '(display-buffer-alist
@ -41,8 +46,8 @@
'(erc-server "irc.freenode.net") '(erc-server "irc.freenode.net")
'(exec-path-from-shell-check-startup-files nil) '(exec-path-from-shell-check-startup-files nil)
'(flycheck-emacs-lisp-load-path (quote inherit)) '(flycheck-emacs-lisp-load-path (quote inherit))
'(flycheck-ghc-language-extensions haskell-language-extensions) '(flycheck-ghc-language-extensions (symbol-value (quote haskell-language-extensions)))
'(flycheck-hlint-language-extensions haskell-language-extensions) '(flycheck-hlint-language-extensions (symbol-value (quote haskell-language-extensions)))
'(forge-alist '(forge-alist
(quote (quote
(("github.com" "api.github.com" "github.com" forge-github-repository) (("github.com" "api.github.com" "github.com" forge-github-repository)
@ -61,9 +66,7 @@
'(global-company-mode t) '(global-company-mode t)
'(haskell-indentation-where-post-offset 0) '(haskell-indentation-where-post-offset 0)
'(haskell-indentation-where-pre-offset 0) '(haskell-indentation-where-pre-offset 0)
'(haskell-language-extensions '(haskell-language-extensions (symbol-value (quote haskell-language-extensions)))
(quote
("UnicodeSyntax" "TypeApplications" "OverloadedStrings" "LambdaCase" "StandaloneDeriving" "DerivingStrategies" "DeriveGeneric" "DeriveAnyClass" "KindSignatures" "DerivingVia" "ConstraintKinds" "FlexibleContexts" "GeneralizedNewtypeDeriving" "ExplicitForAll")))
'(haskell-tags-on-save t) '(haskell-tags-on-save t)
'(indent-tabs-mode nil) '(indent-tabs-mode nil)
'(initial-scratch-message nil) '(initial-scratch-message nil)
@ -81,10 +84,15 @@
(prettier-js quelpa typescript-mode visual-fill-column ag ripgrep fill-column-indicator rjsx-mode image+ company org-jira which-key flycheck es-mode lsp-haskell forge projectile exec-path-from-shell lsp-ui lsp-mode editorconfig purescript-mode markdown-mode+ ssh-agency dash yaml-mode restart-emacs markdown-mode magit helm haskell-mode haml-mode form-feed dashboard))) (prettier-js quelpa typescript-mode visual-fill-column ag ripgrep fill-column-indicator rjsx-mode image+ company org-jira which-key flycheck es-mode lsp-haskell forge projectile exec-path-from-shell lsp-ui lsp-mode editorconfig purescript-mode markdown-mode+ ssh-agency dash yaml-mode restart-emacs markdown-mode magit helm haskell-mode haml-mode form-feed dashboard)))
'(projectile-globally-ignored-directories '(projectile-globally-ignored-directories
(quote (quote
(".idea" ".ensime_cache" ".eunit" ".git" ".hg" ".fslckout" "_FOSSIL_" ".bzr" "_darcs" ".tox" ".svn" ".stack-work" "node_modules"))) (".idea" ".ensime_cache" ".eunit" ".git" ".hg" ".fslckout" "_FOSSIL_" ".bzr" "_darcs" ".tox" ".svn" ".stack-work" "node_modules" "vendor")))
'(projectile-globally-ignored-files (quote ("/TAGS" "/vendor" "/.bundle" "/node_modules"))) '(projectile-globally-ignored-files (quote ("/TAGS" "/vendor" "/.bundle" "/node_modules")))
'(projectile-mode t nil (projectile)) '(projectile-mode t nil (projectile))
'(projectile-project-search-path (seq-filter 'file-directory-p (seq-drop (directory-files "~/git" t) 2))) '(projectile-project-search-path
(seq-filter
(quote file-directory-p)
(seq-drop
(directory-files "~/git" t)
2)))
'(purescript-mode-hook (quote (turn-on-purescript-indentation))) '(purescript-mode-hook (quote (turn-on-purescript-indentation)))
'(recentf-max-menu-items 255) '(recentf-max-menu-items 255)
'(recentf-mode t) '(recentf-mode t)
@ -94,7 +102,15 @@
'(ruby-insert-encoding-magic-comment nil) '(ruby-insert-encoding-magic-comment nil)
'(safe-local-variable-values '(safe-local-variable-values
(quote (quote
((magit-refresh-buffers) ((setq magit-refresh-verbose 1)
(eval remove-hook
(quote magit-refs-sections-hook)
(quote magit-insert-tags))
(eval
(remove-hook
(quote magit-refs-sections-hook)
(quote magit-insert-tags)))
(magit-refresh-buffers)
(git-commit-major-mode . git-commit-elisp-text-mode)))) (git-commit-major-mode . git-commit-elisp-text-mode))))
'(scroll-bar-mode nil) '(scroll-bar-mode nil)
'(scroll-conservatively 101) '(scroll-conservatively 101)
@ -137,7 +153,7 @@
(load-monokai)) (load-monokai))
;;; Needed on MAC because we're not using Xresources :( ;;; Needed on MAC because we're not using Xresources :(
(if (eq window-system 'mac) (if (eq window-system 'ns)
(x11-shim)) (x11-shim))
@ -230,6 +246,11 @@
(add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode)) (add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode))
(add-hook
'js-mode-hook
(lambda ()
(subword-mode t)))
;;;; Projectile ;;;; Projectile
(require 'projectile) (require 'projectile)
@ -245,16 +266,25 @@
(setq dashboard-startup-banner (substitute-in-file-name "$XDG_DATA_HOME/emacs/banner.png")) (setq dashboard-startup-banner (substitute-in-file-name "$XDG_DATA_HOME/emacs/banner.png"))
(setq dashboard-items '((recents . 40))) (setq dashboard-items '((recents . 40)))
(add-hook 'dashboard-mode-hook
(lambda ()
(local-set-key "n" 'dashboard-next-line)
(local-set-key "p" 'dashboard-previous-line)))
;;;; Miscelaneous ;;;; Miscelaneous
(setq-default indent-tabs-mode nil) (setq-default indent-tabs-mode nil)
(setq ring-bell-function (defun mode-line-bell-set-background (bg)
(lambda () "Set the background color of the mode-line to BG."
(set-face-background 'mode-line bg))
(defun mode-line-bell-blink ()
"Briefly change the color of the mode-line."
(let ((orig-bg (face-background 'mode-line))) (let ((orig-bg (face-background 'mode-line)))
(set-face-background 'mode-line (face-attribute 'error :foreground)) (mode-line-bell-set-background (face-attribute 'error :foreground))
(run-with-idle-timer 0.1 nil (run-with-idle-timer 0.1 nil 'mode-line-bell-set-background orig-bg)))
(lambda (bg)
(set-face-background 'mode-line bg)) orig-bg)))) (setq ring-bell-function 'mode-line-bell-blink)
(global-unset-key (kbd "C-z")) (global-unset-key (kbd "C-z"))
@ -281,8 +311,9 @@
(setq select-enable-clipboard t) (setq select-enable-clipboard t)
(add-hook 'ruby-mode-hook '(lambda () (add-hook 'ruby-mode-hook '(lambda ()
(global-set-key (kbd "C-c C-M-n") 'ruby-forward-sexp) (local-set-key (kbd "C-M-n") 'ruby-forward-sexp)
(global-set-key (kbd "C-c C-M-p") 'ruby-backward-sexp))) (local-set-key (kbd "C-M-p") 'ruby-backward-sexp)
(chruby-use-corresponding)))
(defun sql-beautify-region (beg end) (defun sql-beautify-region (beg end)
"Beautify SQL in region between BEG and END. "Beautify SQL in region between BEG and END.

View file

@ -16,23 +16,25 @@
(custom-theme-set-faces (custom-theme-set-faces
'inheritance 'inheritance
'(fringe ((t (:inherit \1)))) '(agda2-highlight-confluence-problem-face ((t (:inherit flycheck-error))))
'(custom-group-tag ((t (:inherit variable-pitch)))) '(agda2-highlight-keyword-face ((t (:inherit font-lock-keyword-face))))
'(custom-group-tag-1 ((t (:inherit variable-pitch)))) '(company-preview ((t (:inherit shadow))))
'(company-preview-common ((t (:inherit company-preview))))
'(company-preview-search ((t (:inherit company-preview))))
'(company-scrollbar-bg ((t (:inherit mode-line-inactive)))) '(company-scrollbar-bg ((t (:inherit mode-line-inactive))))
'(company-scrollbar-fg ((t (:inherit mode-line)))) '(company-scrollbar-fg ((t (:inherit mode-line))))
'(company-tooltip ((t (:inherit default)))) '(company-tooltip ((t (:inherit default))))
'(company-tooltip-common ((t (:inherit shadow)))) '(company-tooltip-common ((t (:inherit shadow))))
'(company-tooltip-selection ((t (:inherit highlight)))) '(company-tooltip-selection ((t (:inherit highlight))))
'(company-preview ((t (:inherit shadow)))) '(custom-group-tag ((t (:inherit variable-pitch))))
'(company-preview-common ((t (:inherit company-preview)))) '(custom-group-tag-1 ((t (:inherit variable-pitch))))
'(company-preview-search ((t (:inherit company-preview))))
'(ediff-even-diff-A ((t (:inherit lazy)))) '(ediff-even-diff-A ((t (:inherit lazy))))
'(ediff-even-diff-B ((t (:inherit lazy)))) '(ediff-even-diff-B ((t (:inherit lazy))))
'(ediff-even-diff-C ((t (:inherit lazy)))) '(ediff-even-diff-C ((t (:inherit lazy))))
'(ediff-odd-diff-A ((t (:inherit lazy-highlight)))) '(ediff-odd-diff-A ((t (:inherit lazy-highlight))))
'(ediff-odd-diff-B ((t (:inherit lazy-highlight)))) '(ediff-odd-diff-B ((t (:inherit lazy-highlight))))
'(ediff-odd-diff-C ((t (:inherit lazy-highlight)))) '(ediff-odd-diff-C ((t (:inherit lazy-highlight))))
'(fringe ((t (:inherit \1))))
'(ido-indicator ((t (:inherit highlight :width condensed)))) '(ido-indicator ((t (:inherit highlight :width condensed))))
'(ido-only-match ((t (:inherit highlight)))) '(ido-only-match ((t (:inherit highlight))))
'(ido-subdir ((t (:inherit default)))) '(ido-subdir ((t (:inherit default))))
@ -43,7 +45,12 @@
'(js2-jsdoc-html-tag-delimiter ((t (:inherit basic)))) '(js2-jsdoc-html-tag-delimiter ((t (:inherit basic))))
'(js2-jsdoc-type ((t (:inherit font-lock-type-face)))) '(js2-jsdoc-type ((t (:inherit font-lock-type-face))))
; The built-in warning is not appropriate here. It's too strong. ; The built-in warning is not appropriate here. It's too strong.
'(js2-warning ((t (:inherit flycheck-warning))))) '(js2-warning ((t (:inherit flycheck-warning))))
'(magit-bisect-bad ((t (:foreground "red"))))
'(magit-branch-upstream ((t (:inherit magit-branch-remote :slant italic))))
'(show-paren-match-expression ((t (:inherit lazy-highlight))))
'(smerge-refined-added ((t (:inherit smerge-refined-change :background "#338033"))))
'(smerge-refined-removed ((t (:inherit smerge-refined-change :background "#803333")))))
(provide-theme 'inheritance) (provide-theme 'inheritance)
;;; inheritance-theme.el ends here ;;; inheritance-theme.el ends here