Skip to content

Instantly share code, notes, and snippets.

@siscia
Created March 28, 2016 17:29
Show Gist options
  • Save siscia/f910e79a2998512d7265 to your computer and use it in GitHub Desktop.
Save siscia/f910e79a2998512d7265 to your computer and use it in GitHub Desktop.
(require 'package)
(add-to-list 'package-archives
'("marmalade" .
"http://marmalade-repo.org/packages/"))
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)
;;(require 'auto-complete-config)
;;(add-to-list 'ac-dictionary-directories "~/.emacs.d//ac-dict")
;;(ac-config-default)
;; Color Theme
(load-theme 'wombat)
(defun volatile-kill-buffer ()
"Kill current buffer unconditionally."
(interactive)
(let ((buffer-modified-p nil))
(kill-buffer (current-buffer))))
(global-set-key (kbd "C-x q") 'volatile-kill-buffer) ;; Unconditionally kill unmodified buffers.
;;goto-line
(global-set-key "\C-l" 'goto-line)
;; To save file in another directory that does not exist yet
(add-hook 'before-save-hook
(lambda ()
(when buffer-file-name
(let ((dir (file-name-directory buffer-file-name)))
(when (and (not (file-exists-p dir))
(y-or-n-p (format "Directory %s does not exist. Create it?" dir)))
(make-directory dir t))))))
;; Put autosave files (ie #foo#) and backup files (ie foo~) in ~/.emacs.d/.
(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.
'(auto-save-file-name-transforms (quote ((".*" "~/.emacs.d/autosaves/\\1" t))))
'(backup-directory-alist (quote ((".*" . "~/.emacs.d/backups/"))))
'(markdown-command "kramdown")
'(package-selected-packages
(quote
(elixir-mode rust-mode smartparens markdown-mode company cider aok)))
'(safe-local-variable-values
(quote
((eval put-clojure-indent
(quote c-for)
(quote defun))))))
;; create the autosave dir if necessary, since emacs won't.
(make-directory "~/.emacs.d/autosaves/" t)
;;;;;;;;;; CLOJURE STUFF ;;;;;;;;;;;;;
;; install clojure-mode
(unless (package-installed-p 'clojure-mode)
(package-refresh-contents)
(package-install 'clojure-mode))
(unless (package-installed-p 'smartparens)
(package-refresh-contents)
(package-install 'smartparens))
(unless (package-installed-p 'cider)
(package-refresh-contents)
(package-install 'cider))
;; add smartparens to clojure-mode
(smartparens-mode)
(add-hook 'clojure-mode-hook (lambda ()
(company-mode)
(smartparens-mode)
(require 'smartparens-clojure)))
(add-hook 'smartparens-mode-hook 'sp-use-paredit-bindings)
;; cinder
;; add eldoc to cinder
(add-hook 'cider-mode-hook (lambda ()
(cider-turn-on-eldoc-mode)
(company-mode)))
(add-hook 'cider-repl-mode-hook (lambda ()
(cider-turn-on-eldoc-mode)
(smartparens-mode)
(company-mode)))
;; hide annoing buffers
(setq nrepl-hide-special-buffers t)
;; rainbow delimiter
;; follow here to install: https://github.com/jlr/rainbow-delimiters#installation-instructions
(add-to-list 'load-path (expand-file-name "~/.emacs.d/lisp/"))
(require 'rainbow-delimiters)
(add-hook 'prog-mode-hook 'rainbow-delimiters-mode)
;;Manage multiple frames
(global-set-key (kbd "S-M-<left>") 'windmove-left)
(global-set-key (kbd "S-M-<right>") 'windmove-right)
(global-set-key (kbd "S-M-<up>") 'windmove-up)
(global-set-key (kbd "S-M-<down>") 'windmove-down)
;;idention automatic
(add-hook 'clojure-mode-hook '(lambda ()
(local-set-key (kbd "RET") 'newline-and-indent)))
;; markdown
(autoload 'markdown-mode "markdown-mode"
"Major mode for editing Markdown files" t)
(add-to-list 'auto-mode-alist '("\\.text\\'" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode))
(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))
(add-hook 'markdown-mode-hook
(lambda ()
(visual-line-mode)))
(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