Skip to content

Instantly share code, notes, and snippets.

@runekaagaard
Last active November 24, 2022 11:17
Show Gist options
  • Save runekaagaard/d8e5d2bedd11d835d3b1 to your computer and use it in GitHub Desktop.
Save runekaagaard/d8e5d2bedd11d835d3b1 to your computer and use it in GitHub Desktop.
;; Bootstrap packages.
(require 'package)
(add-to-list 'package-archives
'("melpa-stable" . "https://stable.melpa.org/packages/"))
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))
(package-initialize)
(if (not (package-installed-p 'use-package))
(progn
(package-refresh-contents)
(package-install 'use-package)))
(require 'use-package)
;; Installed packages.
(use-package elpy :ensure t :pin melpa-stable)
(use-package whole-line-or-region :ensure t :pin melpa-stable)
;;(use-package solarized-theme :ensure t :pin melpa-stable)
(use-package neotree :ensure t :pin melpa-stable)
(use-package exec-path-from-shell :ensure t :pin melpa-stable)
(use-package iedit :ensure t :pin melpa-stable)
(use-package smex :ensure t :pin melpa-stable)
(use-package projectile :ensure t :pin melpa-stable)
;;(use-package base16-theme :ensure t)
(use-package zenburn-theme :ensure t)
;; Elpy.
(elpy-enable)
(setq elpy-rpc-backend "jedi")
;; Windmove
(global-set-key (kbd "s-<left>") 'windmove-left)
(global-set-key (kbd "s-<right>") 'windmove-right)
(global-set-key (kbd "s-<up>") 'windmove-up)
(global-set-key (kbd "s-<down>") 'windmove-down)
;; UI
(scroll-bar-mode -1)
(tool-bar-mode -1)
;; important for golden-ratio to better work
(setq window-combination-resize t)
;; Show column number in mode line
(setq column-number-mode t)
;; When emacs asks for "yes" or "no", let "y" or "n" sufficide
(fset 'yes-or-no-p 'y-or-n-p)
;;(load-theme 'zenburn-theme t)
(setq inhibit-startup-message t)
(global-set-key [f8] 'neotree-toggle)
;; Session persistence.
;; History.
(setq savehist-file "~/.emacs.data/savehist"
enable-recursive-minibuffers t ; Allow commands in minibuffers
history-length 1000
savehist-additional-variables '(kill-ring mark-ring global-mark-ring search-ring regexp-search-ring extended-command-history)
savehist-autosave-interval 60)
(savehist-mode +1)
;; Desktops
(desktop-save-mode 1)
;; Bookmarks.
(setq bookmark-save-flag 1)
(setq bookmark-default-file "~/.emacs.data/bookmarks")
;; Ido
(setq ido-everywhere t)
(ido-mode 1)
(flx-ido-mode 1)
(setq ido-enable-flex-matching t)
;; disable ido faces to see flx highlights.
(setq ido-use-faces nil)
;; Projectile
(projectile-global-mode)
(setq projectile-enable-caching t)
;; Smex
(smex-initialize)
(global-set-key (kbd "M-x") 'smex)
(global-set-key (kbd "M-X") 'smex-major-mode-commands)
;; This is your old M-x.
(global-set-key (kbd "C-c C-c M-x") 'execute-extended-command)
;; Osx fixes
(when (memq window-system '(mac ns))
;; Use exec path from shell.
(exec-path-from-shell-initialize)
;; Curly/square brackets works on right alt.
(setq mac-option-key-is-meta t)
(setq mac-right-option-modifier nil)
)
;; Key bindings.
(global-set-key (kbd "C-x t") 'kill-this-buffer)
(global-set-key "\M- " 'hippie-expand)
;; Performance
;; increase memory threshold for GC
(setq gc-cons-threshold 20000000)
;; Gnus
(setq gnus-select-method '(nnnil ""))
(setq gnus-secondary-select-methods
'((nntp "news.gmane.org")
(nnimap "imap.gmail.com"
(nnimap-address "imap.gmail.com")
(nnimap-server-port 993)
(nnimap-stream ssl)
(nnimap-authenticator login))))
(setq message-send-mail-function 'smtpmail-send-it
smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil))
smtpmail-auth-credentials '(("smtp.gmail.com" 587 "[email protected]" nil))
smtpmail-default-smtp-server "smtp.gmail.com"
smtpmail-smtp-server "smtp.gmail.com"
smtpmail-smtp-service 587
starttls-use-gnutls t)
;; Customize.
(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.
'(ansi-color-names-vector
["#3F3F3F" "#CC9393" "#7F9F7F" "#F0DFAF" "#8CD0D3" "#DC8CC3" "#93E0E3" "#DCDCCC"])
'(custom-safe-themes
(quote
("8aebf25556399b58091e533e455dd50a6a9cba958cc4ebb0aab175863c25b9a4" "f5eb916f6bd4e743206913e6f28051249de8ccfd070eae47b5bde31ee813d55f" default)))
'(fci-rule-color "#383838")
'(nrepl-message-colors
(quote
("#CC9393" "#DFAF8F" "#F0DFAF" "#7F9F7F" "#BFEBBF" "#93E0E3" "#94BFF3" "#DC8CC3")))
'(vc-annotate-background "#2B2B2B")
'(vc-annotate-color-map
(quote
((20 . "#BC8383")
(40 . "#CC9393")
(60 . "#DFAF8F")
(80 . "#D0BF8F")
(100 . "#E0CF9F")
(120 . "#F0DFAF")
(140 . "#5F7F5F")
(160 . "#7F9F7F")
(180 . "#8FB28F")
(200 . "#9FC59F")
(220 . "#AFD8AF")
(240 . "#BFEBBF")
(260 . "#93E0E3")
(280 . "#6CA0A3")
(300 . "#7CB8BB")
(320 . "#8CD0D3")
(340 . "#94BFF3")
(360 . "#DC8CC3"))))
'(vc-annotate-very-old-color "#DC8CC3")
'(whole-line-or-region-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.
)
(put 'narrow-to-region 'disabled nil)
osascript -e 'quit app "Emacs"'
rm -rf ~/.emacs.d
mkdir ~/.emacs.d
curl https://gist.githubusercontent.com/runekaagaard/d8e5d2bedd11d835d3b1/raw/init.el > ~/.emacs.d/init.el
open -a Emacs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment