diff --git a/custom.el b/custom.el index 317da69..69fbb04 100644 --- a/custom.el +++ b/custom.el @@ -1,3 +1,4 @@ + (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. @@ -10,7 +11,7 @@ '(anzu-search-threshold 1000) '(package-selected-packages (quote - (markdown-mode sublime-themes sml-modeline smart-mode-line-powerline-theme nlinum flycheck anzu)))) + (rainbow-mode scss-mode sass-mode less-css-mode ac-php smarty-mode php-mode pkgbuild-mode markdown-mode flycheck anzu sml-modeline smart-mode-line-powerline-theme smart-mode-line nlinum sublime-themes)))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. diff --git a/init.el b/init.el index 3b6d552..d7e6c91 100644 --- a/init.el +++ b/init.el @@ -23,6 +23,7 @@ ;;;------------------------------ ;;; Features ;;;------------------------------ +(require 'init-security) (require 'init-elpa) ;; theme (require 'init-theme) @@ -37,6 +38,14 @@ (require 'init-flycheck) ;; Languages (require 'init-markdown) +(require 'init-python) +(require 'init-pkgbuild) +(require 'init-php) +(require 'init-less) +(require 'init-sass) +(require 'init-scss) +;; Plus +(require 'init-rainbow) ;;; Loads custom file (when (file-exists-p custom-file) diff --git a/lisp/init-editing-utils.el b/lisp/init-editing-utils.el index 0319519..5f65ef7 100644 --- a/lisp/init-editing-utils.el +++ b/lisp/init-editing-utils.el @@ -9,6 +9,12 @@ ;;(when (eval-when-compile (version< "24.4" emacs-version)) ;; (electric-indent-mode 1)) +;; Active auto-revert-mode that automatically reloads modified files out of Emacs. +;; It is very useful to see logs (like auto-revert-tail-mode) among many other cases. +(global-auto-revert-mode) +(setq global-auto-revert-non-file-buffers t + auto-revert-verbose nil) + ;;---------------------------------------------------------------------------- ;; Show matching parens ;;---------------------------------------------------------------------------- @@ -19,7 +25,6 @@ ;;---------------------------------------------------------------------------- (set-default 'truncate-lines t) (setq show-trailing-whitespace nil) -(setq site-lisp-path (file-name-as-directory (expand-file-name "site-lisp/" user-emacs-directory))) ;;---------------------------------------------------------------------------- ;; Some basic preferences diff --git a/lisp/init-flycheck.el b/lisp/init-flycheck.el index a3f6c37..d7a7ac5 100644 --- a/lisp/init-flycheck.el +++ b/lisp/init-flycheck.el @@ -1,2 +1,12 @@ (require-package 'flycheck) + +;; Enable for only languages +;;(add-hook 'emacs-lisp-mode-hook 'flycheck-mode) +(add-hook 'c++-mode-hook 'flycheck-mode) +(add-hook 'html-mode-hook 'flycheck-mode) +(add-hook 'sh-mode-hook 'flycheck-mode) +(add-hook 'js-mode-hook 'flycheck-mode) +(add-hook 'php-mode-hook 'flycheck-mode) +;; (add-hook 'after-init-hook 'global-flycheck-mode) + (provide 'init-flycheck) diff --git a/lisp/init-gui.el b/lisp/init-gui.el index ccc0786..3339e21 100644 --- a/lisp/init-gui.el +++ b/lisp/init-gui.el @@ -8,7 +8,8 @@ (tool-bar-mode 0) (set-scroll-bar-mode nil) (menu-bar-mode 0) -(setq make-backup-files nil) +(setq make-backup-files nil) ; stop creating backup~ files +(setq auto-save-default nil) ; stop creating #autosave# files ;;---------------------------------------------------------------------------- ;; Editor configuration diff --git a/lisp/init-less.el b/lisp/init-less.el new file mode 100644 index 0000000..5245e5f --- /dev/null +++ b/lisp/init-less.el @@ -0,0 +1,7 @@ +;;---------------------------------------------------------------------------- +;; Less Mode +;;---------------------------------------------------------------------------- +(require-package 'less-css-mode) +(add-to-list 'auto-mode-alist '("\\.less$" . less-css-mode)) + +(provide 'init-less) diff --git a/lisp/init-php.el b/lisp/init-php.el new file mode 100644 index 0000000..d4fa09b --- /dev/null +++ b/lisp/init-php.el @@ -0,0 +1,64 @@ +(require-package 'php-mode) + +(require-package 'smarty-mode) + +;; From EmacsWiki: https://www.emacswiki.org/emacs/PhpMode +(defun my/php-symbol-lookup () + (interactive) + (let ((symbol (symbol-at-point))) + (if (not symbol) + (message "No symbol at point.") + + (browse-url (concat "https://php.net/manual-lookup.php?pattern=" + (symbol-name symbol)))))) + + +(defun my/php-function-lookup () + (interactive) + (let* ((function (symbol-name (or (symbol-at-point) + (error "No function at point.")))) + (buf (url-retrieve-synchronously (concat "https://php.net/manual-lookup.php?pattern=" function)))) + (with-current-buffer buf + (goto-char (point-min)) + (let (desc) + (when (re-search-forward "
\\(\\(.\\|\n\\)*?\\)
" nil t) + (setq desc + (concat desc "\n\n" + (replace-regexp-in-string + " +" " " + (replace-regexp-in-string + "\n" "" + (replace-regexp-in-string "<.*?>" "" (match-string-no-properties 1)))))))) + + (if desc + (message desc) + (message "Could not extract function info. Press C-F1 to go the description.")))) + (kill-buffer buf))) + +(require-package 'ac-php) + +(defun my/php-mode-stuff () + (local-set-key (kbd "