diff options
author | Tom Willemse | 2020-12-10 20:52:52 -0800 |
---|---|---|
committer | Tom Willemse | 2020-12-10 20:52:52 -0800 |
commit | 0f22bb9729868e190bb716166c544c5d76147f85 (patch) | |
tree | 5efb8f153ac62577fc5aa1a0c5dee10aa50d89d5 /oni-c.el | |
parent | 70e2eb93c41e06b6c550a5066cfeaaf909f44584 (diff) | |
download | emacs-config-0f22bb9729868e190bb716166c544c5d76147f85.tar.gz emacs-config-0f22bb9729868e190bb716166c544c5d76147f85.zip |
Add abbrevs to C, Java, and C# modes
Diffstat (limited to 'oni-c.el')
-rw-r--r-- | oni-c.el | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -4,7 +4,7 @@ ;; Author: Tom Willemse <tom@ryuslash.org> ;; Keywords: local -;; Version: 2020.0907.143822 +;; Version: 2020.1210.205244 ;; Package-Requires: (oni-flycheck oni-fci) ;; This program is free software; you can redistribute it and/or modify @@ -26,13 +26,16 @@ ;;; Code: +(require 'cc-mode) + (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 'abbrev-mode) (add-hook 'c-mode-hook 'electric-indent-local-mode) +(add-hook 'c-mode-hook 'electric-pair-local-mode) (add-hook 'c-mode-hook 'flycheck-mode) (add-hook 'c-mode-hook 'oni-c--auto-fill-mode) @@ -41,6 +44,9 @@ 'display-fill-column-indicator-mode 'fci-mode)) +(define-abbrev c-mode-abbrev-table "and" "&&") +(define-abbrev c-mode-abbrev-table "or" "||") + ;;;###autoload(with-eval-after-load 'cc-mode (require 'oni-c)) (provide 'oni-c) |