diff --git a/emacs/.emacs b/emacs/.emacs index 7e79ec2..2d9e1d4 100755 --- a/emacs/.emacs +++ b/emacs/.emacs @@ -5,12 +5,14 @@ (package-initialize) (add-to-list 'package-archives - '("melpa" . "http://melpa.milkbox.net/packages/") + '("melpa" . "http://melpa.org/packages/") t) (custom-set-variables - ;; custom-set-variables was added by Custom -- don't edit or cut/paste it! - ;; Your init file should contain only one such instance. + ;; 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. '(c-basic-offset 2) '(c-tab-always-indent t) '(canlock-password "201dd6597717bea7c6569288a099ce4c838cd1a7") @@ -19,6 +21,7 @@ '(default-input-method "latin-1-prefix") '(global-font-lock-mode t nil (font-lock)) '(make-backup-files nil) + '(package-selected-packages (quote (py-autopep8 lua-mode go-mode))) '(pc-select-meta-moves-sexps t) '(pc-select-selection-keys-only t) '(pc-selection-mode t t) @@ -27,8 +30,10 @@ '(transient-mark-mode t) '(version-control (quote never))) (custom-set-faces - ;; custom-set-faces was added by Custom -- don't edit or cut/paste it! - ;; Your init file should contain only one such instance. + ;; 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. '(mmm-default-submode-face ((t nil)))) (put 'narrow-to-region 'disabled nil) @@ -37,10 +42,10 @@ ;; General custom variables (setq require-final-newline 't) (set-language-environment "UTF-8") +(setq inhibit-eol-conversion 't) ;; Kill GUI elements -(menu-bar-mode -1) -(tool-bar-mode -1) +(menu-bar-mode 0) ;; *** Programming (global-set-key (kbd "C-x g") 'goto-line) @@ -51,7 +56,29 @@ (setq-default tab-width 4) (setq-default python-indent-offset 2) (setq-default css-indent-offset 2) +(setq js-indent-level 4) (column-number-mode) ;; Use the right mode for Arduino sketches (add-to-list 'auto-mode-alist '("\\.ino\\'" . c++-mode)) + +(add-to-list 'load-path "~/.emacs.d/lisp") +(require 'yaml-mode) +(require 'slim-mode) +(require 'haml-mode) + +;; Markdown support +(autoload 'markdown-mode "markdown-mode" + "Major mode for editing Markdown files" t) +(add-to-list 'auto-mode-alist '("\\.text\\'" . markdown-mode)) +(add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode)) +(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode)) + +(add-hook 'go-mode-hook + (lambda () + (add-hook 'before-save-hook 'gofmt-before-save) + (setq tab-width 2) + (setq indent-tabs-mode 0))) + +(require 'py-autopep8) +(add-hook 'python-mode-hook 'py-autopep8-enable-on-save)