Skip to content

Instantly share code, notes, and snippets.

@nalzok
Last active March 2, 2019 03:38
Show Gist options
  • Save nalzok/76cbfa9ddf0f66a88dbd488372a15148 to your computer and use it in GitHub Desktop.
Save nalzok/76cbfa9ddf0f66a88dbd488372a15148 to your computer and use it in GitHub Desktop.
Simple Emacs configuration
;;; Face
(set-frame-font "Hack Nerd Font 16" nil t)
(add-to-list 'default-frame-alist '(height . 24))
(add-to-list 'default-frame-alist '(width . 80))
;;; Line number
(add-hook 'prog-mode-hook 'linum-mode)
;;; Setup MELPA
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://www.melpa.org/packages/") t)
(package-initialize)
;;; better-defaults
(require 'better-defaults)
;;; show-paren-mode
(show-paren-mode t)
(setq show-paren-style 'expression)
;;; powerline
(require 'powerline)
;;; dim
(require 'dim)
(dim-minor-names
'((company-mode "" company)
(undo-tree-mode "" undo-tree)
(smartparens-mode "" smartparens)
(eldoc-mode "" eldoc)))
;;; moe-theme
(require 'moe-theme)
(add-hook 'after-init-hook
(lambda ()
(load-theme 'moe-dark)
(moe-theme-set-color 'w/b)
(powerline-moe-theme)))
;;; nyan-mode
(require 'nyan-mode)
;;; windmove
(windmove-default-keybindings)
;;; dired
(add-hook 'dired-mode-hook 'auto-revert-mode)
;;; exec-path-from-shell
(require 'exec-path-from-shell)
(when (memq window-system '(mac ns x))
(exec-path-from-shell-initialize))
;;; company
(require 'company)
(add-hook 'after-init-hook 'global-company-mode)
;;; ess
(require 'ess-r-mode)
(setenv "LANG" "en_US.UTF-8") ; fix locale warning
;;; ess-smart-equals
(setq ess-smart-equals-extra-ops '(brace paren percent))
(with-eval-after-load 'ess-r-mode
(require 'ess-smart-equals)
(ess-smart-equals-activate))
;;; poly-R
(require 'poly-R)
;;; smartparens
(require 'smartparens)
(smartparens-global-mode t)
(setq sp-highlight-pair-overlay nil
sp-highlight-wrap-overlay nil
sp-highlight-wrap-tag-overlay nil)
;;; hightlight-numbers
(add-hook 'prog-mode-hook 'highlight-numbers-mode)
;;; undo-tree
(require 'undo-tree)
(setq undo-tree-auto-save-history t
undo-tree-history-directory-alist
(list (cons "." (expand-file-name "~/.emacs.d/undo-tree/"))))
(defun undo-tree-advice-history-save-file-name (old-function &rest arguments)
(concat (apply old-function arguments) ".tgz"))
(advice-add #'undo-tree-make-history-save-file-name :around
#'undo-tree-advice-history-save-file-name)
(global-undo-tree-mode)
;;; iedit
(require 'iedit)
;;; flymake-diagnostic-at-point
(with-eval-after-load 'flymake
(require 'flymake-diagnostic-at-point)
(add-hook 'flymake-mode-hook #'flymake-diagnostic-at-point-mode))
;;; pdf-tools
(require 'pdf-tools)
(pdf-loader-install)
(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-revert-interval 0.5)
'(auto-save-interval 200)
'(auto-save-timeout 20)
'(backup-by-copying t)
'(backup-directory-alist (quote ((".*" . "~/.emacs.d/backups"))))
'(blink-cursor-mode nil)
'(column-number-mode t)
'(confirm-kill-emacs (quote y-or-n-p))
'(custom-safe-themes
(quote
("26d49386a2036df7ccbe802a06a759031e4455f07bda559dcf221f53e8850e69" default)))
'(delete-old-versions t)
'(ess-r-flymake-linters "lintr::default_linters")
'(flymake-diagnostic-at-point-display-diagnostic-function (quote flymake-diagnostic-at-point-display-minibuffer))
'(flymake-diagnostic-at-point-error-prefix "===> ")
'(ido-auto-merge-work-directories-length -1)
'(inhibit-startup-screen t)
'(kept-new-versions 9)
'(kept-old-versions 6)
'(nyan-cat-face-number 1)
'(nyan-mode t)
'(package-selected-packages
(quote
(yaml-mode pdf-tools sudoku poly-R nyan-mode dim moe-theme powerline iedit flymake flymake-diagnostic-at-point better-defaults exec-path-from-shell company ess ess-smart-equals highlight-numbers smartparens undo-tree)))
'(pdf-view-display-size (quote fit-page))
'(polymode-exporter-output-file-format "%s_exported")
'(version-control 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.
)
(put 'narrow-to-region 'disabled nil)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment