Skip to content

Instantly share code, notes, and snippets.

@chris-olszewski
Created May 3, 2015 21:12
Show Gist options
  • Save chris-olszewski/6cbbaf2cf5cfb41fb78a to your computer and use it in GitHub Desktop.
Save chris-olszewski/6cbbaf2cf5cfb41fb78a to your computer and use it in GitHub Desktop.
;; general config options
;; backup config
(setq backup-directory-alist '(("." . "~/.emacs.d/backups")))
(setq backup-by-copying t)
(setq create-lockfiles nil)
;; package stuff
(require 'package)
(package-initialize)
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t)
(add-to-list 'auto-mode-alist '("\\.json$" . js.mode))
(defvar basic-packages '(
auto-complete
yasnippet
js2-mode
ac-js2-mode)
"Default Packages")
;; make sure all basic packages are installed
(defun packages-installed-p ()
(loop for pkg in basic-packages
when (not (package-installed-p pkg)) do (return nil)
finally (return t)))
(unless (packages-installed-p)
(message "%s" "Refreshing package database...")
(package-refresh-contents)
(dolist (pkg basic-packages)
(when (not (package-installed-p pkg))
(package-install pkg))))
(add-hook 'js-mode-hook 'js2-minor-mode)
(add-hook 'js2-mode-hook 'ac-js2-mode)
;; yasnippet
(require 'yasnippet)
(yas-global-mode 1)
;; auto-complete
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/ac-dict")
(ac-config-default)
;; setting up trigger key
(ac-set-trigger-key "TAB")
(ac-set-trigger-key "<tab>")
(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.
'(inhibit-startup-screen t))
(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.
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment