1
0
Fork 0

Enable ‘auto-fill-mode’ for comments in most programming modes

The ones that are already backed by a formatter, such as Java, Python and sh
don’t need it.
This commit is contained in:
Tom Willemse 2019-12-10 23:16:15 -08:00
parent cd084ebd2a
commit 977f795e03
25 changed files with 176 additions and 25 deletions

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 2019.1010.105642 ;; Version: 2019.1210.225944
;; Package-Requires: (ahk-mode) ;; Package-Requires: (ahk-mode)
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
@ -30,8 +30,14 @@
;;; Code: ;;; Code:
(defun oni-autohotkey--auto-fill-mode ()
"Enable auto-fill-mode only for comments."
(setq-local comment-auto-fill-only-comments t)
(auto-fill-mode))
(add-hook 'ahk-mode-hook 'electric-pair-local-mode) (add-hook 'ahk-mode-hook 'electric-pair-local-mode)
(add-hook 'ahk-mode-hook 'electric-indent-local-mode) (add-hook 'ahk-mode-hook 'electric-indent-local-mode)
(add-hook 'ahk-mode-hook 'oni-autohotkey--auto-fill-mode)
;;;###autoload(with-eval-after-load 'ahk-mode (require 'oni-autohotkey)) ;;;###autoload(with-eval-after-load 'ahk-mode (require 'oni-autohotkey))

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 2019.0904.210336 ;; Version: 2019.1210.230105
;; Package-Requires: (oni-company oni-flycheck oni-fci) ;; Package-Requires: (oni-company oni-flycheck oni-fci)
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
@ -26,11 +26,17 @@
;;; Code: ;;; Code:
(defun oni-c++--auto-fill-mode ()
"Enable auto-fill-mode only for comments."
(setq-local comment-auto-fill-only-comments t)
(auto-fill-mode))
(add-hook 'c++-mode-hook 'company-mode) (add-hook 'c++-mode-hook 'company-mode)
(add-hook 'c++-mode-hook 'electric-indent-local-mode) (add-hook 'c++-mode-hook 'electric-indent-local-mode)
(add-hook 'c++-mode-hook 'electric-pair-local-mode) (add-hook 'c++-mode-hook 'electric-pair-local-mode)
(add-hook 'c++-mode-hook 'fci-mode) (add-hook 'c++-mode-hook 'fci-mode)
(add-hook 'c++-mode-hook 'flycheck-mode) (add-hook 'c++-mode-hook 'flycheck-mode)
(add-hook 'c++-mode-hook 'oni-c++--auto-fill-mode)
;;;###autoload(with-eval-after-load 'cc-mode (require 'oni-c++)) ;;;###autoload(with-eval-after-load 'cc-mode (require 'oni-c++))

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 2019.0904.210340 ;; Version: 2019.1210.230144
;; Package-Requires: (oni-flycheck oni-fci) ;; Package-Requires: (oni-flycheck oni-fci)
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
@ -26,10 +26,16 @@
;;; Code: ;;; Code:
(defun oni-c--auto-fill-mode ()
"Enable auto-fill-mode only for comments."
(setq-local comment-auto-fill-only-comments t)
(auto-fill-mode))
(add-hook 'c-mode-hook 'electric-pair-local-mode) (add-hook 'c-mode-hook 'electric-pair-local-mode)
(add-hook 'c-mode-hook 'electric-indent-local-mode) (add-hook 'c-mode-hook 'electric-indent-local-mode)
(add-hook 'c-mode-hook 'flycheck-mode) (add-hook 'c-mode-hook 'flycheck-mode)
(add-hook 'c-mode-hook 'fci-mode) (add-hook 'c-mode-hook 'fci-mode)
(add-hook 'c-mode-hook 'oni-c--auto-fill-mode)
;;;###autoload(with-eval-after-load 'cc-mode (require 'oni-c)) ;;;###autoload(with-eval-after-load 'cc-mode (require 'oni-c))

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 2019.0904.210349 ;; Version: 2019.1210.230345
;; Package-Requires: (clojure-mode cider clojure-mode-extra-font-locking oni-paredit rainbow-delimiters oni-data-dir) ;; Package-Requires: (clojure-mode cider clojure-mode-extra-font-locking oni-paredit rainbow-delimiters oni-data-dir)
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
@ -50,6 +50,11 @@
(define-clojure-indent (fact 1)) (define-clojure-indent (fact 1))
(define-clojure-indent (facts 1))) (define-clojure-indent (facts 1)))
(defun oni-clojure--auto-fill-mode ()
"Enable auto-fill-mode only for comments."
(setq-local comment-auto-fill-only-comments t)
(auto-fill-mode))
(setq cider-repl-pop-to-buffer-on-connect t) (setq cider-repl-pop-to-buffer-on-connect t)
(setq cider-show-error-buffer t (setq cider-show-error-buffer t
@ -64,6 +69,7 @@
(add-hook 'clojure-mode-hook 'oni-clojure-set-inferior-lisp) (add-hook 'clojure-mode-hook 'oni-clojure-set-inferior-lisp)
(add-hook 'clojure-mode-hook 'oni-clojure-add-font-lock) (add-hook 'clojure-mode-hook 'oni-clojure-add-font-lock)
(add-hook 'clojure-mode-hook 'oni-clojure-add-indent) (add-hook 'clojure-mode-hook 'oni-clojure-add-indent)
(add-hook 'clojure-mode-hook 'oni-clojure--auto-fill-mode)
(add-hook 'cider-repl-mode-hook 'paredit-mode) (add-hook 'cider-repl-mode-hook 'paredit-mode)

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 2019.0904.210353 ;; Version: 2019.1210.230432
;; Package-Requires: (cmake-mode oni-company oni-fci cmake-font-lock eldoc-cmake flycheck) ;; Package-Requires: (cmake-mode oni-company oni-fci cmake-font-lock eldoc-cmake flycheck)
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
@ -29,11 +29,17 @@
(require 'compile) (require 'compile)
(require 'flycheck) (require 'flycheck)
(defun oni-cmake--auto-fill-mode ()
"Enable auto-fill-mode only for comments."
(setq-local comment-auto-fill-only-comments t)
(auto-fill-mode))
(add-hook 'cmake-mode-hook 'cmake-font-lock-activate) (add-hook 'cmake-mode-hook 'cmake-font-lock-activate)
(add-hook 'cmake-mode-hook 'company-mode) (add-hook 'cmake-mode-hook 'company-mode)
(add-hook 'cmake-mode-hook 'eldoc-cmake-enable) (add-hook 'cmake-mode-hook 'eldoc-cmake-enable)
(add-hook 'cmake-mode-hook 'electric-pair-local-mode) (add-hook 'cmake-mode-hook 'electric-pair-local-mode)
(add-hook 'cmake-mode-hook 'fci-mode) (add-hook 'cmake-mode-hook 'fci-mode)
(add-hook 'cmake-mode-hook 'oni-cmake--auto-fill-mode)
(add-to-list 'compilation-error-regexp-alist (add-to-list 'compilation-error-regexp-alist
`(,(rx bol `(,(rx bol

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 2019.0904.210357 ;; Version: 2019.1210.230514
;; Package-Requires: (oni-company oni-flycheck oni-paredit rainbow-delimiters slime slime-company) ;; Package-Requires: (oni-company oni-flycheck oni-paredit rainbow-delimiters slime slime-company)
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
@ -33,6 +33,11 @@
(require 'slime) (require 'slime)
(defun oni-common-lisp--auto-fill-mode ()
"Enable auto-fill-mode only for comments."
(setq-local comment-auto-fill-only-comments t)
(auto-fill-mode))
(setq slime-lisp-implementations (setq slime-lisp-implementations
'((sbcl ("sbcl" "--noinform") :coding-system utf-8-unix) '((sbcl ("sbcl" "--noinform") :coding-system utf-8-unix)
(clisp ("clisp") :coding-system utf-8-unix))) (clisp ("clisp") :coding-system utf-8-unix)))
@ -45,6 +50,7 @@
(add-hook 'lisp-mode-hook 'rainbow-delimiters-mode) (add-hook 'lisp-mode-hook 'rainbow-delimiters-mode)
(add-hook 'lisp-mode-hook 'flycheck-mode) (add-hook 'lisp-mode-hook 'flycheck-mode)
(add-hook 'lisp-mode-hook 'company-mode) (add-hook 'lisp-mode-hook 'company-mode)
(add-hook 'lisp-mode-hook 'oni-common-lisp--auto-fill-mode)
;;;###autoload (with-eval-after-load 'lisp-mode (require 'oni-common-lisp)) ;;;###autoload (with-eval-after-load 'lisp-mode (require 'oni-common-lisp))

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 2019.0904.210412 ;; Version: 2019.1210.225057
;; Package-Requires: (oni-yasnippet) ;; Package-Requires: (oni-yasnippet)
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
@ -45,6 +45,13 @@
(add-to-list 'yas-snippet-dirs oni-conf-snippets-dir t)) (add-to-list 'yas-snippet-dirs oni-conf-snippets-dir t))
(yas-load-directory oni-conf-snippets-dir)) (yas-load-directory oni-conf-snippets-dir))
(defun oni-conf--auto-fill-mode ()
"Enable auto-fill-mode only for comments."
(setq-local comment-auto-fill-only-comments t)
(auto-fill-mode))
(add-hook 'conf-mode-hook 'oni-conf--auto-fill-mode)
;;;###autoload ;;;###autoload
(with-eval-after-load 'conf-mode (with-eval-after-load 'conf-mode
(with-eval-after-load 'yasnippet (with-eval-after-load 'yasnippet

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 2019.0904.210426 ;; Version: 2019.1210.230556
;; Package-Requires: (csharp-mode omnisharp oni-company oni-flycheck) ;; Package-Requires: (csharp-mode omnisharp oni-company oni-flycheck)
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
@ -76,6 +76,11 @@
(overlay-put current-overlay 'oni-csharp--overlayp t) (overlay-put current-overlay 'oni-csharp--overlayp t)
(overlay-put current-overlay 'evaporate t))))) (overlay-put current-overlay 'evaporate t)))))
(defun oni-csharp--auto-fill-mode ()
"Enable auto-fill-mode only for comments."
(setq-local comment-auto-fill-only-comments t)
(auto-fill-mode))
(with-eval-after-load 'company (with-eval-after-load 'company
(add-to-list 'company-backends 'company-omnisharp)) (add-to-list 'company-backends 'company-omnisharp))
@ -84,6 +89,7 @@
(add-hook 'csharp-mode-hook 'electric-pair-local-mode) (add-hook 'csharp-mode-hook 'electric-pair-local-mode)
(add-hook 'csharp-mode-hook 'flycheck-mode) (add-hook 'csharp-mode-hook 'flycheck-mode)
(add-hook 'csharp-mode-hook 'omnisharp-mode) (add-hook 'csharp-mode-hook 'omnisharp-mode)
(add-hook 'csharp-mode-hook 'oni-csharp--auto-fill-mode)
;;;###autoload(with-eval-after-load 'csharp-mode (require 'oni-csharp)) ;;;###autoload(with-eval-after-load 'csharp-mode (require 'oni-csharp))

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 2019.0904.210438 ;; Version: 2019.1210.225029
;; Package-Requires: (oni-company oni-fci hydra rainbow-mode yasnippet) ;; Package-Requires: (oni-company oni-fci hydra rainbow-mode yasnippet)
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
@ -83,6 +83,11 @@
(oni-css-remove-important) (oni-css-remove-important)
(oni-css-add-important))) (oni-css-add-important)))
(defun oni-css--auto-fill-mode ()
"Enable auto-fill-mode only for comments."
(setq-local comment-auto-fill-only-comments t)
(auto-fill-mode))
(defhydra css-mode-hydra (:color blue) (defhydra css-mode-hydra (:color blue)
("!" oni-css-mode-init--toggle-important)) ("!" oni-css-mode-init--toggle-important))
@ -93,6 +98,7 @@
(add-hook 'css-mode-hook 'electric-pair-local-mode) (add-hook 'css-mode-hook 'electric-pair-local-mode)
(add-hook 'css-mode-hook 'fci-mode) (add-hook 'css-mode-hook 'fci-mode)
(add-hook 'css-mode-hook 'rainbow-mode) (add-hook 'css-mode-hook 'rainbow-mode)
(add-hook 'css-mode-hook 'oni-css--auto-fill-mode)
(with-eval-after-load 'compile (with-eval-after-load 'compile
(let ((scss-error-regexp (let ((scss-error-regexp

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 2019.0908.165508 ;; Version: 2019.1210.225238
;; Package-Requires: (oni-company oni-flycheck oni-paredit oni-fci oni-yasnippet rainbow-delimiters nameless erefactor) ;; Package-Requires: (oni-company oni-flycheck oni-paredit oni-fci oni-yasnippet rainbow-delimiters nameless erefactor)
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
@ -50,6 +50,11 @@
(add-to-list 'yas-snippet-dirs oni-elisp-snippets-dir t)) (add-to-list 'yas-snippet-dirs oni-elisp-snippets-dir t))
(yas-load-directory oni-elisp-snippets-dir)) (yas-load-directory oni-elisp-snippets-dir))
(defun oni-elisp--auto-fill-mode ()
"Enable auto-fill-mode only for comments."
(setq-local comment-auto-fill-only-comments t)
(auto-fill-mode))
(add-hook 'emacs-lisp-mode-hook 'company-mode) (add-hook 'emacs-lisp-mode-hook 'company-mode)
(add-hook 'emacs-lisp-mode-hook 'electric-quote-local-mode) (add-hook 'emacs-lisp-mode-hook 'electric-quote-local-mode)
(add-hook 'emacs-lisp-mode-hook 'erefactor-lazy-highlight-turn-on) (add-hook 'emacs-lisp-mode-hook 'erefactor-lazy-highlight-turn-on)
@ -58,6 +63,7 @@
(add-hook 'emacs-lisp-mode-hook 'nameless-mode) (add-hook 'emacs-lisp-mode-hook 'nameless-mode)
(add-hook 'emacs-lisp-mode-hook 'paredit-mode) (add-hook 'emacs-lisp-mode-hook 'paredit-mode)
(add-hook 'emacs-lisp-mode-hook 'rainbow-delimiters-mode) (add-hook 'emacs-lisp-mode-hook 'rainbow-delimiters-mode)
(add-hook 'emacs-lisp-mode-hook 'oni-elisp--auto-fill-mode)
(add-hook 'ielm-mode-hook 'company-mode) (add-hook 'ielm-mode-hook 'company-mode)
(add-hook 'ielm-mode-hook 'paredit-mode) (add-hook 'ielm-mode-hook 'paredit-mode)

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 2019.0904.210550 ;; Version: 2019.1210.230729
;; Package-Requires: (groovy-mode groovy-imports rainbow-delimiters) ;; Package-Requires: (groovy-mode groovy-imports rainbow-delimiters)
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
@ -29,12 +29,18 @@
(require 'groovy-mode) (require 'groovy-mode)
(require 'groovy-imports) (require 'groovy-imports)
(defun oni-groovy--auto-fill-mode ()
"Enable auto-fill-mode only for comments."
(setq-local comment-auto-fill-only-comments t)
(auto-fill-mode))
(define-key groovy-mode-map (kbd "M-I") 'groovy-imports-add-import-dwim) (define-key groovy-mode-map (kbd "M-I") 'groovy-imports-add-import-dwim)
(add-hook 'groovy-mode-hook 'electric-indent-local-mode) (add-hook 'groovy-mode-hook 'electric-indent-local-mode)
(add-hook 'groovy-mode-hook 'electric-pair-local-mode) (add-hook 'groovy-mode-hook 'electric-pair-local-mode)
(add-hook 'groovy-mode-hook 'groovy-imports-scan-file) (add-hook 'groovy-mode-hook 'groovy-imports-scan-file)
(add-hook 'groovy-mode-hook 'rainbow-delimiters-mode) (add-hook 'groovy-mode-hook 'rainbow-delimiters-mode)
(add-hook 'groovy-mode-hook 'oni-groovy--auto-fill-mode)
;;;###autoload(with-eval-after-load 'groovy-mode (require 'oni-groovy)) ;;;###autoload(with-eval-after-load 'groovy-mode (require 'oni-groovy))

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 2019.0904.210605 ;; Version: 2019.1210.225414
;; Package-Requires: (oni-yasnippet) ;; Package-Requires: (oni-yasnippet)
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
@ -45,6 +45,13 @@
(add-to-list 'yas-snippet-dirs oni-haml-snippets-dir t)) (add-to-list 'yas-snippet-dirs oni-haml-snippets-dir t))
(yas-load-directory oni-haml-snippets-dir)) (yas-load-directory oni-haml-snippets-dir))
(defun oni-haml--auto-fill-mode ()
"Enable auto-fill-mode only for comments."
(setq-local comment-auto-fill-only-comments t)
(auto-fill-mode))
(add-hook 'haml-mode-hook 'oni-haml--auto-fill-mode)
;;;autoload ;;;autoload
(with-eval-after-load 'haml-mode (with-eval-after-load 'haml-mode
(with-eval-after-load 'yasnippet (with-eval-after-load 'yasnippet

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 2019.0904.210616 ;; Version: 2019.1210.225526
;; Package-Requires: (oni-yasnippet) ;; Package-Requires: (oni-yasnippet)
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
@ -45,7 +45,13 @@
(add-to-list 'yas-snippet-dirs oni-html-snippets-dir t)) (add-to-list 'yas-snippet-dirs oni-html-snippets-dir t))
(yas-load-directory oni-html-snippets-dir)) (yas-load-directory oni-html-snippets-dir))
(defun oni-html--auto-fill-mode ()
"Enable auto-fill-mode only for comments."
(setq-local comment-auto-fill-only-comments t)
(auto-fill-mode))
(add-hook 'html-mode-hook 'electric-pair-local-mode) (add-hook 'html-mode-hook 'electric-pair-local-mode)
(add-hook 'html-mode-hook 'oni-html--auto-fill-mode)
;;;###autoload ;;;###autoload
(with-eval-after-load 'sgml-mode (with-eval-after-load 'sgml-mode

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 2019.0904.210640 ;; Version: 2019.1210.230928
;; Package-Requires: (oni-company js2-mode js2-refactor oni-fci oni-flycheck tern company-tern fic-mode rjsx-mode) ;; Package-Requires: (oni-company js2-mode js2-refactor oni-fci oni-flycheck tern company-tern fic-mode rjsx-mode)
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
@ -40,6 +40,11 @@
(setq-local whitespace-style '(face tabs)) (setq-local whitespace-style '(face tabs))
(whitespace-mode)) (whitespace-mode))
(defun oni-js--auto-fill-mode ()
"Enable auto-fill-mode only for comments."
(setq-local comment-auto-fill-only-comments t)
(auto-fill-mode))
(setq js-enabled-frameworks '(javascript)) (setq js-enabled-frameworks '(javascript))
(setq js2-include-node-externs t) (setq js2-include-node-externs t)
@ -49,6 +54,7 @@
(add-hook 'js-mode-hook 'electric-pair-local-mode) (add-hook 'js-mode-hook 'electric-pair-local-mode)
(add-hook 'js-mode-hook 'electric-indent-local-mode) (add-hook 'js-mode-hook 'electric-indent-local-mode)
(add-hook 'js-mode-hook 'oni-js--auto-fill-mode)
(add-hook 'js2-mode-hook 'company-mode) (add-hook 'js2-mode-hook 'company-mode)
(add-hook 'js2-mode-hook 'electric-pair-local-mode) (add-hook 'js2-mode-hook 'electric-pair-local-mode)
@ -59,6 +65,7 @@
(add-hook 'js2-mode-hook 'oni-js-whitespace-mode) (add-hook 'js2-mode-hook 'oni-js-whitespace-mode)
(add-hook 'js2-mode-hook 'subword-mode) (add-hook 'js2-mode-hook 'subword-mode)
(add-hook 'js2-mode-hook 'tern-mode) (add-hook 'js2-mode-hook 'tern-mode)
(add-hook 'js2-mode-hook 'oni-js--auto-fill-mode)
(js2r-add-keybindings-with-prefix "C-c r") (js2r-add-keybindings-with-prefix "C-c r")

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 2019.0904.210656 ;; Version: 2019.1210.231019
;; Package-Requires: (oni-fci) ;; Package-Requires: (oni-fci)
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
@ -33,9 +33,15 @@
(setq-local whitespace-style '(face tabs)) (setq-local whitespace-style '(face tabs))
(whitespace-mode)) (whitespace-mode))
(defun oni-makefile--auto-fill-mode ()
"Enable auto-fill-mode only for comments."
(setq-local comment-auto-fill-only-comments t)
(auto-fill-mode))
(add-hook 'makefile-mode-hook #'oni-makefile--whitespace-mode) (add-hook 'makefile-mode-hook #'oni-makefile--whitespace-mode)
(add-hook 'makefile-mode-hook 'electric-pair-local-mode) (add-hook 'makefile-mode-hook 'electric-pair-local-mode)
(add-hook 'makefile-mode-hook 'fci-mode) (add-hook 'makefile-mode-hook 'fci-mode)
(add-hook 'makefile-mode-hook 'oni-makefile--auto-fill-mode)
;;;###autoload(with-eval-after-load 'make-mode (require 'oni-makefile)) ;;;###autoload(with-eval-after-load 'make-mode (require 'oni-makefile))

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 2019.0904.210700 ;; Version: 2019.1210.225630
;; Package-Requires: (oni-yasnippet) ;; Package-Requires: (oni-yasnippet)
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
@ -45,6 +45,13 @@
(add-to-list 'yas-snippet-dirs oni-nxml-snippets-dir t)) (add-to-list 'yas-snippet-dirs oni-nxml-snippets-dir t))
(yas-load-directory oni-nxml-snippets-dir)) (yas-load-directory oni-nxml-snippets-dir))
(defun oni-nxml--auto-fill-mode ()
"Enable auto-fill-mode only for comments."
(setq-local comment-auto-fill-only-comments t)
(auto-fill-mode))
(add-hook 'nxml-mode-hook 'oni-nxml--auto-fill-mode)
;;;###autoload ;;;###autoload
(add-to-list 'auto-mode-alist '("\\.targets\\'" . nxml-mode)) (add-to-list 'auto-mode-alist '("\\.targets\\'" . nxml-mode))
;;;###autoload ;;;###autoload

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 2019.0904.210734 ;; Version: 2019.1210.224202
;; Package-Requires: (php-mode oni-yasnippet oni-flycheck oni-company oni-fci ggtags fic-mode hydra company-php phpcbf) ;; Package-Requires: (php-mode oni-yasnippet oni-flycheck oni-company oni-fci ggtags fic-mode hydra company-php phpcbf)
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
@ -61,6 +61,11 @@ nil for some reason."
(setq-local whitespace-style '(face tabs)) (setq-local whitespace-style '(face tabs))
(whitespace-mode)) (whitespace-mode))
(defun oni-php--auto-fill-mode ()
"Enable auto-fill-mode only for comments."
(setq-local comment-auto-fill-only-comments t)
(auto-fill-mode))
(defhydra php-mode-hydra (:color blue) (defhydra php-mode-hydra (:color blue)
("a" align-current "Align current selection")) ("a" align-current "Align current selection"))
@ -74,6 +79,7 @@ nil for some reason."
(add-hook 'php-mode-hook 'flycheck-mode) (add-hook 'php-mode-hook 'flycheck-mode)
(add-hook 'php-mode-hook 'ggtags-mode) (add-hook 'php-mode-hook 'ggtags-mode)
(add-hook 'php-mode-hook 'phpcbf-enable-on-save) (add-hook 'php-mode-hook 'phpcbf-enable-on-save)
(add-hook 'php-mode-hook 'oni-php--auto-fill-mode)
(with-eval-after-load 'company (with-eval-after-load 'company
(add-to-list 'company-backends 'company-ac-php-backend)) (add-to-list 'company-backends 'company-ac-php-backend))

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 2019.0927.093325 ;; Version: 2019.1210.231059
;; Package-Requires: (powershell) ;; Package-Requires: (powershell)
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
@ -28,6 +28,13 @@
(require 'powershell) (require 'powershell)
(defun oni-powershell--auto-fill-mode ()
"Enable auto-fill-mode only for comments."
(setq-local comment-auto-fill-only-comments t)
(auto-fill-mode))
(add-hook 'powershell-mode-hook 'oni-powershell--auto-fill-mode)
;;;###autoload(with-eval-after-load 'powershell (require 'powershell)) ;;;###autoload(with-eval-after-load 'powershell (require 'powershell))
(provide 'oni-powershell) (provide 'oni-powershell)

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 2019.0904.210747 ;; Version: 2019.1210.230756
;; Package-Requires: (oni-yasnippet oni-company company-jedi oni-fci oni-flycheck rainbow-delimiters reformatter traad hydra) ;; Package-Requires: (oni-yasnippet oni-company company-jedi oni-fci oni-flycheck rainbow-delimiters reformatter traad hydra)
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 2019.0904.210755 ;; Version: 2019.1210.225801
;; Package-Requires: (ruby-mode oni-fci oni-yasnippet) ;; Package-Requires: (ruby-mode oni-fci oni-yasnippet)
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
@ -45,9 +45,15 @@
(add-to-list 'yas-snippet-dirs oni-ruby-snippets-dir)) (add-to-list 'yas-snippet-dirs oni-ruby-snippets-dir))
(yas-load-directory oni-ruby-snippets-dir)) (yas-load-directory oni-ruby-snippets-dir))
(defun oni-ruby--auto-fill-mode ()
"Enable auto-fill-mode only for comments."
(setq-local comment-auto-fill-only-comments t)
(auto-fill-mode))
(add-hook 'ruby-mode-hook 'electric-indent-local-mode) (add-hook 'ruby-mode-hook 'electric-indent-local-mode)
(add-hook 'ruby-mode-hook 'electric-pair-local-mode) (add-hook 'ruby-mode-hook 'electric-pair-local-mode)
(add-hook 'ruby-mode-hook 'fci-mode) (add-hook 'ruby-mode-hook 'fci-mode)
(add-hook 'ruby-mode-hook 'oni-ruby--auto-fill-mode)
;;;###autoload ;;;###autoload
(with-eval-after-load 'ruby-mode (with-eval-after-load 'ruby-mode

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 2019.0904.210801 ;; Version: 2019.1210.231207
;; Package-Requires: (rust-mode oni-flycheck rainbow-delimiters) ;; Package-Requires: (rust-mode oni-flycheck rainbow-delimiters)
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
@ -26,10 +26,16 @@
;;; Code: ;;; Code:
(defun oni-rust--auto-fill-mode ()
"Enable auto-fill-mode only for comments."
(setq-local comment-auto-fill-only-comments t)
(auto-fill-mode))
(add-hook 'rust-mode-hook 'flycheck-mode) (add-hook 'rust-mode-hook 'flycheck-mode)
(add-hook 'rust-mode-hook 'electric-pair-local-mode) (add-hook 'rust-mode-hook 'electric-pair-local-mode)
(add-hook 'rust-mode-hook 'electric-indent-local-mode) (add-hook 'rust-mode-hook 'electric-indent-local-mode)
(add-hook 'rust-mode-hook 'rainbow-delimiters-mode) (add-hook 'rust-mode-hook 'rainbow-delimiters-mode)
(add-hook 'rust-mode-hook 'oni-rust--auto-fill-mode)
;;;###autoload(with-eval-after-load 'rust-mode (require 'oni-rust)) ;;;###autoload(with-eval-after-load 'rust-mode (require 'oni-rust))

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 2019.0904.210805 ;; Version: 2019.1210.231332
;; Package-Requires: (oni-company oni-paredit oni-fci rainbow-delimiters) ;; Package-Requires: (oni-company oni-paredit oni-fci rainbow-delimiters)
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
@ -26,10 +26,16 @@
;;; Code: ;;; Code:
(defun oni-scheme--auto-fill-mode ()
"Enable auto-fill-mode only for comments."
(setq-local comment-auto-fill-only-comments t)
(auto-fill-mode))
(add-hook 'scheme-mode-hook 'company-mode) (add-hook 'scheme-mode-hook 'company-mode)
(add-hook 'scheme-mode-hook 'fci-mode) (add-hook 'scheme-mode-hook 'fci-mode)
(add-hook 'scheme-mode-hook 'paredit-mode) (add-hook 'scheme-mode-hook 'paredit-mode)
(add-hook 'scheme-mode-hook 'rainbow-delimiters-mode) (add-hook 'scheme-mode-hook 'rainbow-delimiters-mode)
(add-hook 'scheme-mode-hook 'oni-scheme--auto-fill-mode)
(add-to-list 'interpreter-mode-alist '("scsh" . scheme-mode)) (add-to-list 'interpreter-mode-alist '("scsh" . scheme-mode))

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 2019.0904.210836 ;; Version: 2019.1210.230023
;; Package-Requires: (twig-mode oni-yasnippet) ;; Package-Requires: (twig-mode oni-yasnippet)
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
@ -45,6 +45,13 @@
(add-to-list 'yas-snippet-dirs oni-twig-snippets-dir)) (add-to-list 'yas-snippet-dirs oni-twig-snippets-dir))
(yas-load-directory oni-twig-snippets-dir)) (yas-load-directory oni-twig-snippets-dir))
(defun oni-twig--auto-fill-mode ()
"Enable auto-fill-mode only for comments."
(setq-local comment-auto-fill-only-comments t)
(auto-fill-mode))
(add-hook 'twig-mode-hook 'oni-twig--auto-fill-mode)
;;;###autoload ;;;###autoload
(with-eval-after-load 'twig-mode (with-eval-after-load 'twig-mode
(with-eval-after-load 'yasnippet (with-eval-after-load 'yasnippet

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 2019.0904.210848 ;; Version: 2019.1210.231451
;; Package-Requires: (web-mode oni-flycheck) ;; Package-Requires: (web-mode oni-flycheck)
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
@ -27,12 +27,18 @@
;;; Code: ;;; Code:
(require 'web-mode) (require 'web-mode)
(require 'whitespace)
(defun oni-web--whitespace-mode () (defun oni-web--whitespace-mode ()
"Enable whitespace mode with only tabs showing." "Enable whitespace mode with only tabs showing."
(setq-local whitespace-style '(face tabs)) (setq-local whitespace-style '(face tabs))
(whitespace-mode)) (whitespace-mode))
(defun oni-web--auto-fill-mode ()
"Enable auto-fill-mode only for comments."
(setq-local comment-auto-fill-only-comments t)
(auto-fill-mode))
(setq web-mode-attr-indent-offset 2) (setq web-mode-attr-indent-offset 2)
(setq web-mode-auto-quote-style 1) (setq web-mode-auto-quote-style 1)
(setq web-mode-code-indent-offset 2) (setq web-mode-code-indent-offset 2)
@ -43,6 +49,7 @@
(add-hook 'web-mode-hook 'electric-pair-local-mode) (add-hook 'web-mode-hook 'electric-pair-local-mode)
(add-hook 'web-mode-hook 'flycheck-mode) (add-hook 'web-mode-hook 'flycheck-mode)
(add-hook 'web-mode-hook #'oni-web--whitespace-mode) (add-hook 'web-mode-hook #'oni-web--whitespace-mode)
(add-hook 'web-mode-hook 'oni-web--auto-fill-mode)
;;;###autoload(with-eval-after-load 'web-mode (require 'oni-web)) ;;;###autoload(with-eval-after-load 'web-mode (require 'oni-web))

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 2019.0904.210852 ;; Version: 2019.1210.231537
;; Package-Requires: (yaml-mode oni-flycheck oni-fci oni-highlight-indent-guides flycheck-yamllint indent-tools yaml-imenu) ;; Package-Requires: (yaml-mode oni-flycheck oni-fci oni-highlight-indent-guides flycheck-yamllint indent-tools yaml-imenu)
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
@ -30,11 +30,17 @@
(require 'yaml-imenu) (require 'yaml-imenu)
(require 'flycheck-yamllint) (require 'flycheck-yamllint)
(defun oni-yaml--auto-fill-mode ()
"Enable auto-fill-mode only for comments."
(setq-local comment-auto-fill-only-comments t)
(auto-fill-mode))
(define-key yaml-mode-map (kbd "C-c >") 'indent-tools-hydra/body) (define-key yaml-mode-map (kbd "C-c >") 'indent-tools-hydra/body)
(add-hook 'yaml-mode-hook 'fci-mode) (add-hook 'yaml-mode-hook 'fci-mode)
(add-hook 'yaml-mode-hook 'highlight-indent-guides-mode) (add-hook 'yaml-mode-hook 'highlight-indent-guides-mode)
(add-hook 'yaml-mode-hook 'yaml-imenu-enable) (add-hook 'yaml-mode-hook 'yaml-imenu-enable)
(add-hook 'yaml-mode-hook 'oni-yaml--auto-fill-mode)
(flycheck-yamllint-setup) (flycheck-yamllint-setup)