Skip to content

Instantly share code, notes, and snippets.

@drewlander
Last active February 28, 2017 18:27
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 drewlander/932c0c2c04f94edad2c695f2274cd07b to your computer and use it in GitHub Desktop.
Save drewlander/932c0c2c04f94edad2c695f2274cd07b to your computer and use it in GitHub Desktop.
; list the repositories containing them
(setq package-archives '(("elpa" . "http://tromey.com/elpa/")
("gnu" . "http://elpa.gnu.org/packages/")
("melpa" . "https://melpa.org/packages/")
("marmalade" . "http://marmalade-repo.org/packages/")))
; activate all the packages (in particular autoloads)
(package-initialize)
; fetch the list of packages available
(unless package-archive-contents
(package-refresh-contents))
; list the packages you want
(setq package-list '(better-defaults
solarized-theme
neotree
multiple-cursors
helm
helm-projectile
helm-ag
ruby-electric
seeing-is-believing
rvm
inf-ruby
ruby-test-mode))
; install the missing packages
(dolist (package package-list)
(unless (package-installed-p package)
(package-install package)))
(require 'better-defaults)
(setq inhibit-splash-screen t
initial-scratch-message nil
initial-major-mode 'ruby-mode)
(load-theme 'wombat t)
;; Show line numbers
(global-linum-mode)
;; Typography
(set-face-attribute 'default nil
:family "Source Code Pro"
:height 150
:weight 'normal
:width 'normal)
(require 'helm)
(require 'helm-projectile)
(require 'helm-ag)
(global-set-key (kbd "M-x") #'helm-M-x)
(global-set-key (kbd "s-f") #'helm-projectile-ag)
(global-set-key (kbd "s-t") #'helm-projectile-find-file-dwim)
;; Autoclose paired syntax elements like parens, quotes, etc
(require 'ruby-electric)
(add-hook 'ruby-mode-hook 'ruby-electric-mode)
(rvm-use-default)
(setq seeing-is-believing-prefix "C-.")
(add-hook 'ruby-mode-hook 'seeing-is-believing)
(require 'seeing-is-believing)
(autoload 'inf-ruby-minor-mode "inf-ruby" "Run an inferior Ruby process" t)
(add-hook 'ruby-mode-hook 'inf-ruby-minor-mode)
(require 'ruby-test-mode)
(add-hook 'ruby-mode-hook 'ruby-test-mode)
(add-hook 'compilation-finish-functions
(lambda (buf strg)
(switch-to-buffer-other-window "*compilation*")
(read-only-mode)
(goto-char (point-max))
(local-set-key (kbd "q")
(lambda () (interactive) (quit-restore-window)))))
(setq backup-directory-alist
`((".*" . ,temporary-file-directory)))
(setq auto-save-file-name-transforms
`((".*" ,temporary-file-directory t)))
(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.
'(package-selected-packages
(quote
(xkcd all-the-icons neotree multiple-cursors magit solarized-theme seeing-is-believing rvm ruby-test-mode ruby-electric inf-ruby helm-projectile helm-ag color-theme-sanityinc-solarized better-defaults))))
(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.
)
(setq helm-ag-base-command "/usr/local/bin/ag --nocolor --nogroup")
(require 'multiple-cursors)
(global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines)
(global-set-key (kbd "C->") 'mc/mark-next-like-this)
(global-set-key (kbd "C-<") 'mc/mark-previous-like-this)
(global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this)
(require 'neotree)
(global-set-key [f8] 'neotree-toggle)
;; Save all tempfiles in $TMPDIR/emacs$UID/
(defconst emacs-tmp-dir (format "%s/%s%s/" temporary-file-directory "emacs" (user-uid)))
(setq backup-directory-alist
`((".*" . ,emacs-tmp-dir)))
(setq auto-save-file-name-transforms
`((".*" ,emacs-tmp-dir t)))
(setq auto-save-list-file-prefix
emacs-tmp-dir)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment