diff options
Diffstat (limited to 'emacs.d')
-rw-r--r-- | emacs.d/functions.el | 51 |
1 files changed, 44 insertions, 7 deletions
diff --git a/emacs.d/functions.el b/emacs.d/functions.el index 6d2a5e5..9c8f7da 100644 --- a/emacs.d/functions.el +++ b/emacs.d/functions.el @@ -74,7 +74,7 @@ Currently adds | & ! . + = - / % * , < > ? : ->" (font-lock-add-keywords 'html-mode '(("{\\(\\*.*\\*\\)}" 1 font-comment-face) - ("{\\/?\\(extends\\|block\\|foreach\\|if\\)" + ("{\\/?\\(extends\\|block\\|foreach\\(else\\)?\\|if\\)" 1 font-lock-builtin-face) ("\\$\\(\\(?:\\sw\\|\\s_\\)+\\)\\(?:|\\(\\(?:\\sw\\|\\s_\\)+\\):\\)" (1 font-lock-variable-name-face) @@ -121,7 +121,24 @@ Currently adds | & ! . + = - / % * , < > ? : ->" (insert-char ?\; width)) (defun x-init () - "Start ide-skel and set some keys") + "Initialization only for X" + (require 'naquadah-theme) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; THEME SETTINGS ;; + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + (naquadah-theme-set-faces + 'naquadah + + ;; markdown-mode + '(markdown-link-face (:inherit 'link)) + '(markdown-header-face-1 (:inherit 'org-level-1)) + '(markdown-header-face-2 (:inherit 'org-level-2)) + '(markdown-header-face-3 (:inherit 'org-level-3)) + '(markdown-header-face-4 (:inherit 'org-level-4)) + '(markdown-header-face-5 (:inherit 'org-level-5)) + '(markdown-header-face-6 (:inherit 'org-level-6))) + + (add-hook 'emacs-startup-hook 'fullscreen)) (defun cli-init () "Add a space to the linum column" @@ -156,7 +173,9 @@ Currently adds | & ! . + = - / % * , < > ? : ->" ("\\b\\(\\.[0-9]+\\([eE][-+]?[0-9]+\\)?\\([lL]\\|[fF]\\|[dD]\\)?\\)\\b" 0 font-lock-constant-face))) (set-column-marker) - (rainbow-delimiters-mode)) + (rainbow-delimiters-mode) + (pretty-lambdas) + (auto-fill-mode 1)) (defun on-c-mode () (local-set-key [f8] 'c-toggle-header-source) @@ -178,10 +197,6 @@ Currently adds | & ! . + = - / % * , < > ? : ->" (auto-fill-mode 1)) (defun on-php-mode () - (defvar php-warn-if-mumamo-off nil) - (setq case-fold-search t) - (c-set-offset 'arglist-intro '+) - (c-set-offset 'arglist-close '0) (column-marker-1 76) (column-marker-2 81) (local-set-key [f6] 'comment-line)) @@ -189,3 +204,25 @@ Currently adds | & ! . + = - / % * , < > ? : ->" (defun on-mail-mode () (turn-on-auto-fill) (search-forward "\n\n")) + +(defun pretty-lambdas () + (font-lock-add-keywords + nil `(("(\\(lambda\\>\\)" + (0 (progn + (compose-region (match-beginning 1) + (match-end 1) + ?λ))))))) + +;; http://emacs-fu.blogspot.com/2009/01/navigating-through-source-code-using.html +(defun djcb-gtags-create-or-update () + "create or update the gnu global tag file" + (interactive) + (if (not (= 0 (call-process "global" nil nil nil " -p"))) ; tagfile + (let ((olddir default-directory) ; doesn't exist? + (topdir (read-directory-name + "gtags: top of source tree:" default-directory))) + (cd topdir) + (shell-command "gtags && echo 'created tagfile'") + (cd olddir)) ; restore + ;; tagfile already exists; update it + (shell-command "global -u && echo 'updated tagfile'"))) |