Skip to content

Instantly share code, notes, and snippets.

Created May 21, 2016 02:44
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 anonymous/0443ece696273d7636851f72c0189b38 to your computer and use it in GitHub Desktop.
Save anonymous/0443ece696273d7636851f72c0189b38 to your computer and use it in GitHub Desktop.
;; window size
(when window-system (set-frame-size (selected-frame) 95 45))
;; change how backups are handled
(setq backup-directory-alist '(("." . "~/.emacsbackups")))
(setq backup-by-copying t)
;; disable tabs
(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
;; melpa packages
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(when (< emacs-major-version 24)
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
(package-initialize)
;; company mode
(add-hook 'after-init-hook 'global-company-mode)
(setq-default company-selection-wrap-around t)
(setq company-require-match 'never)
(setq company-idle-delay 0)
(eval-after-load 'company
'(progn
(define-key company-active-map (kbd "TAB") 'company-complete-common-or-cycle)
(define-key company-active-map (kbd "<tab>") 'company-complete-common-or-cycle)))
(eval-after-load 'company
'(progn
(define-key company-active-map (kbd "S-TAB") 'company-select-previous)
(define-key company-active-map (kbd "<backtab>") 'company-select-previous)))
(setq company-frontends
'(company-pseudo-tooltip-unless-just-one-frontend
company-preview-frontend
company-echo-metadata-frontend))
;; evil mode
(require 'evil)
(setq evil-motion-state-modes
(append evil-emacs-state-modes evil-motion-state-modes))
(setq evil-emacs-state-modes nil)
(evil-mode 1)
;; solarized theme
(setq x-underline-at-descent-line t)
(load-theme 'solarized-dark t)
;; ELIXIR
(require 'alchemist)
;; C++
(add-hook 'c++-mode-hook 'irony-mode)
(add-hook 'c-mode-hook 'irony-mode)
(add-hook 'objc-mode-hook 'irony-mode)
(eval-after-load 'company
'(add-to-list 'company-backends 'company-irony))
(defun my-irony-mode-hook ()
(define-key irony-mode-map [remap completion-at-point]
'irony-completion-at-point-async)
(define-key irony-mode-map [remap complete-symbol]
'irony-completion-at-point-async))
(add-hook 'irony-mode-hook 'my-irony-mode-hook)
(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment