Skip to content

Instantly share code, notes, and snippets.

@tristanstraub
Created March 1, 2019 00:37
Show Gist options
  • Save tristanstraub/49b291b936b96c51e1d8498ef7325e07 to your computer and use it in GitHub Desktop.
Save tristanstraub/49b291b936b96c51e1d8498ef7325e07 to your computer and use it in GitHub Desktop.
(setq-default indent-tabs-mode nil)
(load "server")
(unless (server-running-p)
(server-start))
(defun mac-metas ()
"for mac keyboard"
(setq mac-option-modifier 'super)
(setq mac-command-modifier 'meta))
(mac-metas)
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.org/packages/") t)
(package-initialize)
;; (package-refresh-contents)
;; DEFAULTS
(global-linum-mode 1)
(fset 'yes-or-no-p 'y-or-n-p)
(prefer-coding-system 'utf-8)
(global-auto-revert-mode t)
(setq create-lockfiles nil)
(defvar dotfiles-dir nil)
(setq dotfiles-dir (expand-file-name "./" "~/"))
;; Don't clutter up directories with files~
(setq backup-directory-alist `(("." . ,(expand-file-name
(concat dotfiles-dir "backups")))))
;; Don't clutter with #files either
(setq auto-save-file-name-transforms
`((".*" ,(expand-file-name (concat dotfiles-dir "backups")))))
(global-set-key (kbd "C-c r") 'revert-buffer)
(global-set-key (kbd "M-j") 'join-line)
(add-hook 'before-save-hook 'delete-trailing-whitespace)
(load-theme 'deeper-blue)
(package-install 'exec-path-from-shell)
(when (memq window-system '(mac ns x))
(exec-path-from-shell-initialize))
;; MAGIT
(package-install 'magit)
(global-set-key (kbd "C-x g") 'magit-status)
;; IVY
(package-install 'swiper)
(ivy-mode 1)
(setq ivy-use-virtual-buffers t)
(global-set-key "\C-s" 'swiper)
(global-set-key "\C-r" 'swiper)
;;(global-set-key (kbd "C-c C-r") 'ivy-resume)
(define-key ivy-minibuffer-map (kbd "C-d") 'ivy-dired)
;; CLOJURE
(package-install 'cider)
(package-install 'paredit)
(defun clojure-mode-settings ()
(paredit-mode 1)
(cider-mode 1)
(show-paren-mode)
(yas-minor-mode 1) ; for adding require/use/import
(cljr-add-keybindings-with-prefix "C-c C-m"))
(add-hook 'clojure-mode-hook 'clojure-mode-settings)
;; HELM
(package-install 'helm)
(push "~/.emacs.d/site-lisp/helm-cmd-t" load-path)
(require 'helm)
(require 'helm-config)
(require 'helm-for-files)
(require 'helm-cmd-t)
(global-set-key (kbd "M-t") 'helm-cmd-t)
(package-install 'helm-projectile)
;; show full path in helm results
(setq helm-ff-transformer-show-only-basename nil)
;; ALIGN-CLJLET
(package-install 'align-cljlet)
(eval-after-load "clojure-mode"
'(progn
(define-key clojure-mode-map (kbd "C-c l") 'align-cljlet)))
;; MULTICURSORS
(package-install 'expand-region)
(package-install 'multiple-cursors)
;; (global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines)
;; (global-set-key (kbd "C-<") 'mc/mark-previous-like-this)
(global-set-key (kbd "C->") 'mc/mark-next-like-this)
(global-set-key (kbd "C-;") 'mc/mark-all-dwim)
;; ACE-JUMP
(package-install 'ace-jump-mode)
(define-key global-map (kbd "C-0") 'ace-jump-mode)
;; UNDO TREE
(package-install 'undo-tree)
(global-undo-tree-mode)
;; TERRAFORM
(package-install 'hcl-mode)
(add-to-list 'auto-mode-alist '("\\.tf\\'" . hcl-mode))
;; CUSTOM
(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.
'(cider-prompt-for-symbol nil)
'(package-selected-packages
(quote
(hcl-mode tf-mode undo-tree ace-jump-mode multiple-cursors expand-region align-cljlet paredit helm-highlight-files helm-projectile helm-git-grep helm-ls-git helm-cmd-t helm cider exec-path-from-shell swiper magit)))
'(show-paren-mode 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.
)
@tristanstraub
Copy link
Author

Cleaned up my emacs init.el. No babel "load" anymore, using "package-install" instead of "el-get-install". Seems to work well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment