Browse Source

Fixing indentation

master
Levi Olson 5 years ago
parent
commit
56b6d9c8a6
1 changed files with 224 additions and 223 deletions
  1. +224
    -223
      init.org

+ 224
- 223
init.org View File

@ -161,11 +161,11 @@
(add-to-list 'default-frame-alist (cons 'left 1000))
#+END_SRC
** Enable Disabled Commands
#+BEGIN_SRC emacs-lisp :results silent
(put 'narrow-to-region 'disabled nil)
(put 'upcase-region 'disabled nil)
(put 'downcase-region 'disabled nil)
#+END_SRC
#+BEGIN_SRC emacs-lisp :results silent
(put 'narrow-to-region 'disabled nil)
(put 'upcase-region 'disabled nil)
(put 'downcase-region 'disabled nil)
#+END_SRC
** Splash Screen
#+BEGIN_SRC emacs-lisp :results silent
(require 'dashboard)
@ -228,90 +228,91 @@
(defalias 'yes-or-no-p 'y-or-n-p)
#+END_SRC
** Custom Modes
#+BEGIN_SRC emacs-lisp :results silent
(require 'font-lock)
(defvar openhab-mode-hook nil)
(defvar openhab-mode-map
(let ((map (make-keymap)))
(define-key map "\C-j" 'newline-and-indent)
map)
"Keymap for OPENHAB major mode.")
(add-to-list 'auto-mode-alist '("\\.sitemap\\'" . openhab-mode))
(add-to-list 'auto-mode-alist '("\\.items\\'" . openhab-mode))
(add-to-list 'auto-mode-alist '("\\.rules\\'" . openhab-mode))
(add-to-list 'auto-mode-alist '("\\.things\\'" . openhab-mode))
(defconst openhab-font-lock-keywords
`(
("\<.*\>" . font-lock-constant-face)
(,(regexp-opt
'(
;; KEYWORDS
"Selection" "Slider" "List" "Setpoint" "Video" "Chart" "Webview" "Colorpicker"
"Timer" "Number" "String"
"Switch" "Rollershutter" "Number" "String" "Dimmer" "Contact" "DateTime" "Color"
"Text" "Group" "Image" "Frame"
"Thing" "Bridge"
"Time" "System"
"sitemap"
"rule" "when" "then" "end"
"if" "val"
"import" "var" "say" "postUpdate" "switch" "println" "case" "or" "sendCommand"
)
'words)
(1 font-lock-keyword-face))
(,(regexp-opt
'(
"ON" "OFF" "on" "off"
"AND" "OR" "NAND" "NOR" "AVG" "SUM" "MAX" "MIN"
"true" "false"
)
'words)
(1 font-lock-constant-face))
(,(regexp-opt
'(
"name" "label" "item" "period" "refresh" "icon" "mappings" "minValue" "maxValue" "step" "switchsupport" "url" "height" "refresh" "visibility" "valuecolor"
)
'words)
(1 font-lock-type-face))
("\(.*\)" . font-lock-variable-name-face)
("[^a-zA-Z0-9_:]\\([0-9]*\\)[^a-zA-Z0-9_:]" . (1 font-lock-variable-name-face))
("\s@\s" . font-lock-variable-name-face)
("\s\\([a-zA-Z0-9_:]*\\)\\(\s\\|$\\)" . (1 font-lock-type-face))
("=\\([a-zA-Z_]*\\)" . (1 font-lock-string-face))
("\\([a-zA-Z]*\\)=" . (1 font-lock-type-face))
)
"The regexps to highlight in openHAB mode.")
(defvar openhab-mode-syntax-table
(let ((st (make-syntax-table)))
(modify-syntax-entry ?/ ". 12b" st) ;; C-style comments // ...
(modify-syntax-entry ?\n "> b" st) ;; \n ends comment
;; Block comments /*...*/
(modify-syntax-entry ?\/ ". 14" st)
(modify-syntax-entry ?* ". 23" st)
st)
"Syntax table for openhab-mode.")
(defun openhab-mode ()
"Major mode for editing OPENHAB config files."
(interactive)
(kill-all-local-variables)
(set-syntax-table openhab-mode-syntax-table)
(use-local-map openhab-mode-map)
(set (make-local-variable 'font-lock-defaults) '(openhab-font-lock-keywords nil t))
(electric-pair-mode -1)
(flycheck-mode -1)
(setq major-mode 'openhab-mode)
(setq mode-name "OpenHAB")
(run-hooks 'openhab-mode-hook))
(provide 'openhab-mode)
#+END_SRC
*** OpenHAB Mode
#+BEGIN_SRC emacs-lisp :results silent
(require 'font-lock)
(defvar openhab-mode-hook nil)
(defvar openhab-mode-map
(let ((map (make-keymap)))
(define-key map "\C-j" 'newline-and-indent)
map)
"Keymap for OPENHAB major mode.")
(add-to-list 'auto-mode-alist '("\\.sitemap\\'" . openhab-mode))
(add-to-list 'auto-mode-alist '("\\.items\\'" . openhab-mode))
(add-to-list 'auto-mode-alist '("\\.rules\\'" . openhab-mode))
(add-to-list 'auto-mode-alist '("\\.things\\'" . openhab-mode))
(defconst openhab-font-lock-keywords
`(
("\<.*\>" . font-lock-constant-face)
(,(regexp-opt
'(
;; KEYWORDS
"Selection" "Slider" "List" "Setpoint" "Video" "Chart" "Webview" "Colorpicker"
"Timer" "Number" "String"
"Switch" "Rollershutter" "Number" "String" "Dimmer" "Contact" "DateTime" "Color"
"Text" "Group" "Image" "Frame"
"Thing" "Bridge"
"Time" "System"
"sitemap"
"rule" "when" "then" "end"
"if" "val"
"import" "var" "say" "postUpdate" "switch" "println" "case" "or" "sendCommand"
)
'words)
(1 font-lock-keyword-face))
(,(regexp-opt
'(
"ON" "OFF" "on" "off"
"AND" "OR" "NAND" "NOR" "AVG" "SUM" "MAX" "MIN"
"true" "false"
)
'words)
(1 font-lock-constant-face))
(,(regexp-opt
'(
"name" "label" "item" "period" "refresh" "icon" "mappings" "minValue" "maxValue" "step" "switchsupport" "url" "height" "refresh" "visibility" "valuecolor"
)
'words)
(1 font-lock-type-face))
("\(.*\)" . font-lock-variable-name-face)
("[^a-zA-Z0-9_:]\\([0-9]*\\)[^a-zA-Z0-9_:]" . (1 font-lock-variable-name-face))
("\s@\s" . font-lock-variable-name-face)
("\s\\([a-zA-Z0-9_:]*\\)\\(\s\\|$\\)" . (1 font-lock-type-face))
("=\\([a-zA-Z_]*\\)" . (1 font-lock-string-face))
("\\([a-zA-Z]*\\)=" . (1 font-lock-type-face))
)
"The regexps to highlight in openHAB mode.")
(defvar openhab-mode-syntax-table
(let ((st (make-syntax-table)))
(modify-syntax-entry ?/ ". 12b" st) ;; C-style comments // ...
(modify-syntax-entry ?\n "> b" st) ;; \n ends comment
;; Block comments /*...*/
(modify-syntax-entry ?\/ ". 14" st)
(modify-syntax-entry ?* ". 23" st)
st)
"Syntax table for openhab-mode.")
(defun openhab-mode ()
"Major mode for editing OPENHAB config files."
(interactive)
(kill-all-local-variables)
(set-syntax-table openhab-mode-syntax-table)
(use-local-map openhab-mode-map)
(set (make-local-variable 'font-lock-defaults) '(openhab-font-lock-keywords nil t))
(electric-pair-mode -1)
(flycheck-mode -1)
(setq major-mode 'openhab-mode)
(setq mode-name "OpenHAB")
(run-hooks 'openhab-mode-hook))
(provide 'openhab-mode)
#+END_SRC
** Tools
*** General
#+BEGIN_SRC emacs-lisp :results silent
@ -400,88 +401,88 @@
#+END_SRC
*** Mu4e
#+BEGIN_SRC emacs-lisp :results silent
(add-to-list 'load-path "/usr/local/share/emacs/site-lisp/mu/mu4e")
(require 'mu4e)
;; default
(setq mu4e-maildir "~/Mail"
mu4e-mu-binary "/usr/local/bin/mu"
mu4e-get-mail-command "offlineimap" ;; Allow updating with the "U" command
mu4e-sent-messages-behavior 'delete ;; Delete sent messages
mu4e-view-show-images t ;; attempt to show images
mu4e-view-image-max-width 400 ;; max image size
message-kill-buffer-on-exit t ;; don't keep messages around
mu4e-use-fancy-chars t ;; use 'fancy' chars
mu4e-update-interval 300 ;; 5 mins
)
(setq mu4e-contexts
`( ,(make-mu4e-context
:name "Vlocity"
:enter-func (lambda () (mu4e-message "Entering Vlocity"))
:leave-func (lambda () (mu4e-message "Leaving Vlocity"))
;; we match based on the contact-fields of the message
:match-func (lambda (msg)
(when msg
(string= (mu4e-message-field msg :maildir) "/Vlocity")))
:vars '( ( user-mail-address . "lolson@vlocity.com" )
( smtpmail-mail-address . "lolson@vlocity.com" )
( user-full-name . "Levi Olson" )
( mu4e-compose-signature .
(concat
"--\n"
"Levi Olson\n"
"Senior UI Developer"))
( mu4e-sent-folder . "/Vlocity/[Gmail].Sent Mail" )
( mu4e-drafts-folder . "/Vlocity/[Gmail].Drafts" )
( mu4e-trash-folder . "/Vlocity/[Gmail].Trash" )
( mu4e-maildir-shortcuts . (("/Vlocity/INBOX" . ?i)
("/Vlocity/[Gmail].Sent Mail" . ?s)
("/Vlocity/[Gmail].Trash" . ?t)
("/Vlocity/[Gmail].All Mail" . ?a)))))
,(make-mu4e-context
:name "Gmail"
:enter-func (lambda () (mu4e-message "Entering Gmail"))
:leave-func (lambda () (mu4e-message "Leaving Gmail"))
;; this matches maildir /Arkham and its sub-directories
:match-func (lambda (msg)
(when msg
(string= (mu4e-message-field msg :maildir) "/Gmail")))
:vars '( ( user-mail-address . "olson.levi@gmail.com" )
( smtpmail-mail-address . "olson.levi@gmail.com" )
( user-full-name . "Levi Olson" )
( mu4e-compose-signature .
(concat
"--\n"
"Levi\n"))
( mu4e-sent-folder . "/Gmail/[Gmail].Sent Mail" )
( mu4e-drafts-folder . "/Gmail/[Gmail].Drafts" )
( mu4e-trash-folder . "/Gmail/[Gmail].Trash" )
( mu4e-maildir-shortcuts . (("/Gmail/INBOX" . ?i)
("/Gmail/[Gmail].Sent Mail" . ?s)
("/Gmail/[Gmail].Trash" . ?t)
("/Gmail/[Gmail].All Mail" . ?a))
)))))
;; (defcustom smtpmail-smtp-user nil
;; "User name to use when looking up credentials in the authinfo file.
;; If non-nil, only consider credentials for the specified user."
;; :version "24.1"
;; :type '(choice (const nil) string)
;; :group 'smtpmail)
;; How to handle HTML emails
;; (setq mu4e-html2text-command "textutil -stdin -format html -convert txt -stdout")
;; Add option to view HTML in browser
(add-to-list 'mu4e-headers-actions
'("in browser" . mu4e-action-view-in-browser) t)
(add-to-list 'mu4e-view-actions
'("in browser" . mu4e-action-view-in-browser) t)
#+END_SRC
#+BEGIN_SRC emacs-lisp :results silent
(add-to-list 'load-path "/usr/local/share/emacs/site-lisp/mu/mu4e")
(require 'mu4e)
;; default
(setq mu4e-maildir "~/Mail"
mu4e-mu-binary "/usr/local/bin/mu"
mu4e-get-mail-command "offlineimap" ;; Allow updating with the "U" command
mu4e-sent-messages-behavior 'delete ;; Delete sent messages
mu4e-view-show-images t ;; attempt to show images
mu4e-view-image-max-width 400 ;; max image size
message-kill-buffer-on-exit t ;; don't keep messages around
mu4e-use-fancy-chars t ;; use 'fancy' chars
mu4e-update-interval 300 ;; 5 mins
)
(setq mu4e-contexts
`( ,(make-mu4e-context
:name "Vlocity"
:enter-func (lambda () (mu4e-message "Entering Vlocity"))
:leave-func (lambda () (mu4e-message "Leaving Vlocity"))
;; we match based on the contact-fields of the message
:match-func (lambda (msg)
(when msg
(string= (mu4e-message-field msg :maildir) "/Vlocity")))
:vars '( ( user-mail-address . "lolson@vlocity.com" )
( smtpmail-mail-address . "lolson@vlocity.com" )
( user-full-name . "Levi Olson" )
( mu4e-compose-signature .
(concat
"--\n"
"Levi Olson\n"
"Senior UI Developer"))
( mu4e-sent-folder . "/Vlocity/[Gmail].Sent Mail" )
( mu4e-drafts-folder . "/Vlocity/[Gmail].Drafts" )
( mu4e-trash-folder . "/Vlocity/[Gmail].Trash" )
( mu4e-maildir-shortcuts . (("/Vlocity/INBOX" . ?i)
("/Vlocity/[Gmail].Sent Mail" . ?s)
("/Vlocity/[Gmail].Trash" . ?t)
("/Vlocity/[Gmail].All Mail" . ?a)))))
,(make-mu4e-context
:name "Gmail"
:enter-func (lambda () (mu4e-message "Entering Gmail"))
:leave-func (lambda () (mu4e-message "Leaving Gmail"))
;; this matches maildir /Arkham and its sub-directories
:match-func (lambda (msg)
(when msg
(string= (mu4e-message-field msg :maildir) "/Gmail")))
:vars '( ( user-mail-address . "olson.levi@gmail.com" )
( smtpmail-mail-address . "olson.levi@gmail.com" )
( user-full-name . "Levi Olson" )
( mu4e-compose-signature .
(concat
"--\n"
"Levi\n"))
( mu4e-sent-folder . "/Gmail/[Gmail].Sent Mail" )
( mu4e-drafts-folder . "/Gmail/[Gmail].Drafts" )
( mu4e-trash-folder . "/Gmail/[Gmail].Trash" )
( mu4e-maildir-shortcuts . (("/Gmail/INBOX" . ?i)
("/Gmail/[Gmail].Sent Mail" . ?s)
("/Gmail/[Gmail].Trash" . ?t)
("/Gmail/[Gmail].All Mail" . ?a))
)))))
;; (defcustom smtpmail-smtp-user nil
;; "User name to use when looking up credentials in the authinfo file.
;; If non-nil, only consider credentials for the specified user."
;; :version "24.1"
;; :type '(choice (const nil) string)
;; :group 'smtpmail)
;; How to handle HTML emails
;; (setq mu4e-html2text-command "textutil -stdin -format html -convert txt -stdout")
;; Add option to view HTML in browser
(add-to-list 'mu4e-headers-actions
'("in browser" . mu4e-action-view-in-browser) t)
(add-to-list 'mu4e-view-actions
'("in browser" . mu4e-action-view-in-browser) t)
#+END_SRC
*** Projectile
#+BEGIN_SRC emacs-lisp :results silent
(require 'projectile)
@ -931,72 +932,72 @@
#+END_SRC
*** Doom Modeline
#+BEGIN_SRC emacs-lisp :results silent
(require 'doom-modeline)
(doom-modeline-mode 1)
#+BEGIN_SRC emacs-lisp :results silent
(require 'doom-modeline)
(doom-modeline-mode 1)
;; How tall the mode-line should be (only respected in GUI Emacs).
(setq doom-modeline-height 35)
;; How tall the mode-line should be (only respected in GUI Emacs).
(setq doom-modeline-height 35)
;; How wide the mode-line bar should be (only respected in GUI Emacs).
(setq doom-modeline-bar-width 4)
;; How wide the mode-line bar should be (only respected in GUI Emacs).
(setq doom-modeline-bar-width 4)
;; Determines the style used by `doom-modeline-buffer-file-name'.
;;
;; Given ~/Projects/FOSS/emacs/lisp/comint.el
;; truncate-upto-project => ~/P/F/emacs/lisp/comint.el
;; truncate-from-project => ~/Projects/FOSS/emacs/l/comint.el
;; truncate-with-project => emacs/l/comint.el
;; truncate-except-project => ~/P/F/emacs/l/comint.el
;; truncate-upto-root => ~/P/F/e/lisp/comint.el
;; truncate-all => ~/P/F/e/l/comint.el
;; relative-from-project => emacs/lisp/comint.el
;; relative-to-project => lisp/comint.el
;; file-name => comint.el
;; buffer-name => comint.el<2> (uniquify buffer name)
;;
;; If you are expereicing the laggy issue, especially while editing remote files
;; with tramp, please try `file-name' style.
;; Please refer to https://github.com/bbatsov/projectile/issues/657.
(setq doom-modeline-buffer-file-name-style 'truncate-upto-project)
;; Determines the style used by `doom-modeline-buffer-file-name'.
;;
;; Given ~/Projects/FOSS/emacs/lisp/comint.el
;; truncate-upto-project => ~/P/F/emacs/lisp/comint.el
;; truncate-from-project => ~/Projects/FOSS/emacs/l/comint.el
;; truncate-with-project => emacs/l/comint.el
;; truncate-except-project => ~/P/F/emacs/l/comint.el
;; truncate-upto-root => ~/P/F/e/lisp/comint.el
;; truncate-all => ~/P/F/e/l/comint.el
;; relative-from-project => emacs/lisp/comint.el
;; relative-to-project => lisp/comint.el
;; file-name => comint.el
;; buffer-name => comint.el<2> (uniquify buffer name)
;;
;; If you are expereicing the laggy issue, especially while editing remote files
;; with tramp, please try `file-name' style.
;; Please refer to https://github.com/bbatsov/projectile/issues/657.
(setq doom-modeline-buffer-file-name-style 'truncate-upto-project)
;; What executable of Python will be used (if nil nothing will be showed).
(setq doom-modeline-python-executable "python")
;; What executable of Python will be used (if nil nothing will be showed).
(setq doom-modeline-python-executable "python")
;; Whether show `all-the-icons' or not (if nil nothing will be showed).
(setq doom-modeline-icon t)
;; Whether show `all-the-icons' or not (if nil nothing will be showed).
(setq doom-modeline-icon t)
;; Whether show the icon for major mode. It respects `doom-modeline-icon'.
(setq doom-modeline-major-mode-icon t)
;; Whether show the icon for major mode. It respects `doom-modeline-icon'.
(setq doom-modeline-major-mode-icon t)
;; Display color icons for `major-mode'. It respects `all-the-icons-color-icons'.
(setq doom-modeline-major-mode-color-icon nil)
;; Display color icons for `major-mode'. It respects `all-the-icons-color-icons'.
(setq doom-modeline-major-mode-color-icon nil)
;; Whether display minor modes or not. Non-nil to display in mode-line.
(setq doom-modeline-minor-modes nil)
;; Whether display minor modes or not. Non-nil to display in mode-line.
(setq doom-modeline-minor-modes nil)
;; If non-nil, a word count will be added to the selection-info modeline segment.
(setq doom-modeline-enable-word-count nil)
;; If non-nil, a word count will be added to the selection-info modeline segment.
(setq doom-modeline-enable-word-count nil)
;; If non-nil, only display one number for checker information if applicable.
(setq doom-modeline-checker-simple-format t)
;; If non-nil, only display one number for checker information if applicable.
(setq doom-modeline-checker-simple-format t)
;; Whether display perspective name or not. Non-nil to display in mode-line.
(setq doom-modeline-persp-name t)
;; Whether display perspective name or not. Non-nil to display in mode-line.
(setq doom-modeline-persp-name t)
;; Whether display `lsp' state or not. Non-nil to display in mode-line.
(setq doom-modeline-lsp t)
;; Whether display `lsp' state or not. Non-nil to display in mode-line.
(setq doom-modeline-lsp t)
;; Whether display github notifications or not. Requires `ghub` package.
(setq doom-modeline-github nil)
;; Whether display github notifications or not. Requires `ghub` package.
(setq doom-modeline-github nil)
;; The interval of checking github.
(setq doom-modeline-github-interval (* 30 60))
;; The interval of checking github.
(setq doom-modeline-github-interval (* 30 60))
;; Whether display environment version or not.
(setq doom-modeline-env-version t)
;; Whether display environment version or not.
(setq doom-modeline-env-version t)
;; Whether display mu4e notifications or not. Requires `mu4e-alert' package.
(setq doom-modeline-mu4e t)
#+END_SRC
;; Whether display mu4e notifications or not. Requires `mu4e-alert' package.
(setq doom-modeline-mu4e t)
#+END_SRC

Loading…
Cancel
Save