Skip to content

Instantly share code, notes, and snippets.

@jdcantrell
Created August 13, 2014 00:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdcantrell/9d81e8d01eb4a953e544 to your computer and use it in GitHub Desktop.
Save jdcantrell/9d81e8d01eb4a953e544 to your computer and use it in GitHub Desktop.
My attempt at emacs
;;; init.el --- where all the magic begins
;;
;; turn off mouse interface early in startup to avoid momentary display
;; you really don't need these; trust me.
(if (fboundp 'menu-bar-mode) (menu-bar-mode -1))
(if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
;; load path etc.
(setq dotfiles-dir (file-name-directory
(or (buffer-file-name) load-file-name)))
;; load up elpa, the package manager
(setq package-user-dir (concat dotfiles-dir "elpa"))
(require 'package)
(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/"))
(add-to-list 'package-archives '("elpa" . "http://tromey.com/elpa/"))
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))
(package-initialize)
;;Fix path
(when (memq window-system '(mac ns))
(exec-path-from-shell-initialize))
;;(require 'cl)
;;(require 'saveplace)
;;(require 'ffap)
;;(require 'uniquify)
;;(require 'ansi-color)
;;(require 'recentf)
;;Fonts
(add-to-list 'default-frame-alist '(font . "Menlo-14"))
(set-face-attribute 'default t :font "Menlo-14")
;;Theme
(load-theme `base16-monokai t)
;;Make lines and borders smaller
(add-to-list 'default-frame-alist '(internal-border-width . 0))
(add-to-list 'default-frame-alist '(menu-bar-lines . 0))
(add-to-list 'default-frame-alist '(tool-bar-lines . 0))
(add-to-list 'default-frame-alist '(cursor-type . box))
(set-cursor-color "#ffffff")
;;Remove border on mode line
(set-face-attribute 'mode-line nil :box nil)
;;Behavoirs
(setq inhibit-startup-message t)
;;Remove whitespace on save
(add-hook 'before-save-hook 'whitespace-cleanup)
;;Tab to two spaces
(setq-default c-basic-offset 2)
(setq-default c-default-style "bsd")
(setq-default indent-tabs-mode nil)
(setq tab-width 2)
;;Fix bell
(setq visible-bell 1)
(setq ring-bell-function 'ignore)
;;No line wrap
(set-default 'truncate-lines t)
;;Extensions
(require 'evil)
(evil-mode 1)
'(evil-default-cursor (quote (t "white")))
(require 'git-gutter-fringe+)
(setq git-gutter-fr+:side 'right-fringe)
;;Flycheck everywhere
(add-hook 'after-init-hook #'global-flycheck-mode)
(require 'php-mode)
;;Todo move to system custom config
;;phpcs settings
(setq flycheck-php-phpcs-executable "/usr/local/bin/phpcs")
(setq flycheck-phpcs-standard (expand-file-name "~/.phpcs.xml"))
;;phpmd settings
(setq flycheck-phpmd-rulesets '())
(add-to-list 'flycheck-phpmd-rulesets (expand-file-name "~/.phpmd.xml"))
(setq flycheck-php-phpmd-executable "/usr/local/bin/phpmd")
;;jshint
(setq flycheck-javascript-jshint-executable "/usr/local/bin/jshint")
;;smex
(require 'smex)
(global-set-key (kbd "M-x") 'smex)
(global-set-key (kbd "M-X") 'smex-major-mode-commands)
;; you can keep system- or user-specific customizations here
(setq system-specific-config (concat dotfiles-dir system-name ".el"))
(if (file-exists-p system-specific-config) (load system-specific-config))
;;; init.el ends here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment