;; Initilize 3rd party package repository (require 'package) (let* ((no-ssl (and (memq system-type '(windows-nt ms-dos)) (not (gnutls-available-p)))) (proto (if no-ssl "http" "https"))) ;; Comment/uncomment these two lines to enable/disable MELPA and MELPA Stable as desired (add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t) ;;(add-to-list 'package-archives (cons "melpa-stable" (concat proto "://stable.melpa.org/packages/")) t) (when (< emacs-major-version 24) ;; For important compatibility libraries like cl-lib (add-to-list 'package-archives '("gnu" . (concat proto "://elpa.gnu.org/packages/"))))) (package-initialize) ;; These are the custom packages you want always installed. (setq package-list '(ac-html yasnippet multi-web-mode dockerfile-mode apache-mode php-mode flymake-haml)) ;; Install Packages. (dolist (package package-list ) (unless (package-installed-p package) (package-install package) ) ) ;; Activate modes. (ido-mode 1) (auto-complete-mode 1) (auto-revert-mode 1) (yas-global-mode 1) (setq-default fill-column 100) (put 'downcase-region 'disabled nil) (put 'upcase-region 'disabled nil) ;;; General configurations (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(css-indent-offset 2) '(package-selected-packages (quote (org jsx-mode typescript-mode rust-mode rjsx-mode react-snippets flymake-haml php-mode apache-mode dockerfile-mode multi-web-mode yasnippet ac-html))) '(sgml-basic-offset 4) '(sgml-basic-offset 4) '(truncate-lines t) '(yas-prompt-functions (quote (yas-dropdown-prompt) ) ) ) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(font-lock-string-face ((t (:foreground "white"))))) (require 'multi-web-mode) (setq mweb-default-major-mode 'html-mode) (setq mweb-tags '((php-mode "<\\?php\\|<\\? \\|<\\?=" "\\?>") (js-mode "") (css-mode ""))) (setq mweb-filename-extensions '("php" "htm" "html" "ctp" "phtml" "php4" "php5")) (multi-web-global-mode 1) (add-hook 'php-mode-hook 'my-php-mode-hook) (defun my-php-mode-hook () (setq indent-tabs-mode nil tab-width 8 c-basic-offset 4)) (require 'flymake-haml) ;; not required if installed from a package (add-hook 'json-mode 'flymake-json-load) (add-to-list 'auto-mode-alist '("\\.ts\\'" . typescript-mode)) (add-to-list 'auto-mode-alist '("\\.tsx\\'" . typescript-mode)) ;; turn off super script for org-mode so that underscores act like underscores (setq org-export-with-sub-superscripts nil) (require 'org-tempo)