emacs.d/init.el

306 lines
11 KiB
EmacsLisp
Raw Normal View History

2019-09-25 16:16:23 +02:00
2019-09-19 23:28:58 +02:00
(setq small-font "Iosevka Term-11")
(setq big-font "Iosevka Term-14")
2019-09-23 15:47:43 +02:00
;; start a server, unless one is already running
(when (require 'server nil t)
(unless (server-running-p)
(server-start)))
2019-09-19 23:28:58 +02:00
2019-07-09 14:23:34 +02:00
;; (add-to-list 'custom-theme-load-path (expand-file-name "~/.emacs.d/bundle/nord-theme/"))
2019-05-07 17:20:19 +02:00
(add-to-list 'load-path (expand-file-name "~/.emacs.d/bundle"))
2019-09-18 14:10:12 +02:00
2019-05-01 21:49:02 +02:00
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
2019-09-05 09:20:02 +02:00
2019-06-12 14:55:15 +02:00
(require 'package)
2019-07-09 13:19:00 +02:00
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
(not (gnutls-available-p))))
(proto (if no-ssl "http" "https")))
(when no-ssl
(warn "\
Your version of Emacs does not support SSL connections,
which is unsafe because it allows man-in-the-middle attacks.
There are two things you can do about this warning:
1. Install an Emacs version that does support SSL and be safe.
2. Remove this warning from your init file so you won't see it again."))
;; Comment/uncomment these two lines to enable/disable MELPA and MELPA Stable as desired
(add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t)
;;(add-to-list 'package-archives (cons "melpa-stable" (concat proto "://stable.melpa.org/packages/")) t)
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives (cons "gnu" (concat proto "://elpa.gnu.org/packages/")))))
2019-06-12 14:55:15 +02:00
(package-initialize)
2019-07-09 16:31:46 +02:00
2019-09-18 13:13:20 +02:00
(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.
2019-09-25 22:20:06 +02:00
'(variable-pitch ((t (:family "Roboto Condensed")))))
2019-09-18 13:13:20 +02:00
2019-05-01 18:41:31 +02:00
(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.
2019-06-12 14:55:15 +02:00
'(auto-save-default nil)
'(backup-directory-alist (quote (("" . "~/.emacs.d/_backup_files"))))
2019-07-09 17:01:14 +02:00
'(blink-cursor-mode nil)
2019-05-08 23:01:03 +02:00
'(cal-html-directory "~/Documents/Diary")
2019-05-09 00:28:17 +02:00
'(calendar-date-style (quote iso))
2019-09-17 16:30:36 +02:00
'(calendar-intermonth-text
(quote
(propertize
(format "%2d"
(car
(calendar-iso-from-absolute
(calendar-absolute-from-gregorian
(list month day year)))))
(quote font-lock-face)
(quote font-lock-function-name-face))))
2019-05-09 00:28:17 +02:00
'(calendar-week-start-day 1)
2019-08-15 09:44:44 +02:00
'(column-number-mode t)
2019-08-10 16:27:44 +02:00
'(custom-enabled-themes (quote (nord)))
2019-05-01 18:41:31 +02:00
'(custom-safe-themes
(quote
2019-08-11 20:32:07 +02:00
("82358261c32ebedfee2ca0f87299f74008a2e5ba5c502bde7aaa15db20ee3731" "4515feff287a98863b7b7f762197a78a7c2bfb6ec93879e7284dff184419268c" default)))
2019-09-05 09:20:02 +02:00
'(default-frame-alist
2019-09-19 19:06:59 +02:00
(quote
2019-09-26 21:47:25 +02:00
((fullscreen . maximized)
2019-09-21 13:54:13 +02:00
(width . 90)
2019-09-19 19:06:59 +02:00
(height . 46)
(font . "Iosevka Term-13.0")
(vertical-scroll-bars)
(horizontal-scroll-bars)
(menu-bar-lines . 0)
(line-spacing . 2)
2019-09-20 16:18:20 +02:00
(undecorated . t))))
'(delete-selection-mode t)
2019-05-09 00:28:17 +02:00
'(diary-file "~/Documents/Diary/diary")
2019-09-19 19:06:59 +02:00
'(display-battery-mode t)
2019-09-11 15:06:29 +02:00
'(display-line-numbers nil)
2019-09-20 16:18:20 +02:00
'(display-line-numbers-grow-only t)
'(display-line-numbers-type (quote relative))
'(display-line-numbers-widen nil)
2019-07-09 17:01:14 +02:00
'(display-time-mode t)
2019-05-03 11:49:08 +02:00
'(display-time-world-list
(quote
2019-05-09 00:28:17 +02:00
(("America/Los_Angeles" "Seattle")
("America/New_York" "New York")
("Europe/London" "London")
("Europe/Paris" "Paris")
("Asia/Calcutta" "Bangalore")
("Asia/Tokyo" "Tokyo"))))
2019-05-07 17:20:19 +02:00
'(fill-column 72)
2019-05-08 20:41:13 +02:00
'(font-lock-maximum-decoration t)
2019-07-12 16:33:54 +02:00
'(global-auto-revert-mode t)
2019-09-20 16:18:20 +02:00
'(global-display-line-numbers-mode t)
2019-05-08 20:41:13 +02:00
'(global-font-lock-mode t)
'(global-hl-line-mode t)
2019-09-18 14:10:12 +02:00
'(icomplete-mode t)
2019-05-07 17:20:19 +02:00
'(indent-tabs-mode nil)
2019-09-25 16:16:23 +02:00
'(inferior-lisp-program (executable-find "sbcl") t)
2019-06-12 14:55:15 +02:00
'(inhibit-startup-screen t)
2019-07-09 17:01:14 +02:00
'(line-number-mode t)
2019-05-09 15:51:09 +02:00
'(line-spacing 3)
2019-05-07 17:20:19 +02:00
'(linum-relative-backend (quote display-line-numbers-mode))
'(major-mode (quote text-mode))
2019-06-12 14:55:15 +02:00
'(make-backup-files nil)
2019-09-18 18:14:44 +02:00
'(max-lisp-eval-depth 24000)
'(max-specpdl-size 19500)
2019-07-16 14:16:07 +02:00
'(network-security-level (quote medium))
'(newsticker-download-logos nil)
'(newsticker-frontend (quote newsticker-plainview))
2019-09-21 22:43:21 +02:00
'(newsticker-show-descriptions-of-new-items nil)
2019-05-07 17:20:19 +02:00
'(newsticker-url-list-defaults
2019-05-06 17:05:58 +02:00
(quote
2019-05-07 17:20:19 +02:00
(("Emacs Wiki" "https://www.emacswiki.org/emacs?action=rss" nil 3600)
2019-09-10 12:52:21 +02:00
("Sachachua" "https://sachachua.com/blog/feed/" nil 3600)
2019-09-09 16:56:52 +02:00
("openSuse News" "https://news.opensuse.org/feed" nil 3600)
("Phoronix" "https://www.phoronix.com/rss.php" nil 3600)
("Ubuntu" "https://blog.ubuntu.com/feed" nil 3600)
2019-09-10 12:50:47 +02:00
("Netzpolitik" "https://logbuch-netzpolitik.de/feed" nil 3600)
2019-09-11 15:06:29 +02:00
("PBP" "https://pbpython.com/feeds/all.atom.xml" nil 3600)
("Planet Python" "https://planetpython.org/rss20.xml" nil 3600)
("lucumr" "http://lucumr.pocoo.org/feed.atom" nil 3600)
("doughellmann" "https://doughellmann.com/blog/feed/" nil 3600)
2019-09-16 17:01:36 +02:00
("Metaebene" "https://metaebene.me/feed/" nil 3600)
2019-09-17 19:05:20 +02:00
("Stack Exchange" "https://emacs.stackexchange.com/feeds" nil 3600)
("Stallman" "https://stallman.org/rss/rss.xml" nil 3600)
2019-09-23 16:11:57 +02:00
("Planet Lisp" "http://planet.lisp.org/" nil 3600)
2019-09-09 16:56:52 +02:00
("Python PEP" "https://www.python.org/dev/peps/peps.rss/" nil 3600))))
2019-08-01 20:22:54 +02:00
'(nord-comment-brightness 15)
'(nord-region-highlight "snowstorm")
2019-09-18 14:10:12 +02:00
'(nord-uniform-mode-lines t)
2019-09-25 16:16:23 +02:00
'(org-agenda-dim-blocked-tasks nil)
'(org-agenda-files (quote ("~/Documents/Journal")))
2019-09-25 16:16:23 +02:00
'(org-agenda-inhibit-startup nil)
'(org-agenda-use-tag-inheritance nil)
'(org-babel-load-languages
(quote
((js . t)
(emacs-lisp . t)
(python . t)
(sqlite . t)
2019-09-16 15:53:29 +02:00
(lisp . t)
(shell . t)
(css . t)
(calc . t))))
'(org-babel-shell-names
(quote
("sh" "bash" "csh" "ash" "dash" "ksh" "mksh" "posh")))
2019-08-01 14:42:29 +02:00
'(org-clock-persist t)
2019-08-01 20:22:54 +02:00
'(org-confirm-babel-evaluate nil)
'(org-default-notes-file "~/Documents/Journal/notes.org")
2019-09-17 16:30:36 +02:00
'(org-html-doctype "html5")
'(org-html-html5-fancy t)
2019-09-17 19:07:05 +02:00
'(org-log-done (quote time))
2019-09-20 16:18:20 +02:00
'(org-startup-folded nil)
'(org-startup-truncated nil)
2019-09-20 16:56:19 +02:00
'(org-todo-keywords
(quote
((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED"))))
2019-06-12 14:55:15 +02:00
'(package-enable-at-startup t)
2019-07-09 13:19:00 +02:00
'(package-selected-packages
(quote
2019-09-17 16:30:36 +02:00
(url-http-ntlm syslog-mode org-pomodoro ox-html5slide ox-hugo ox-impress-js ox-ioslide ox-jira ox-json ox-pandoc nov vimish-fold w3 pickle feature-mode elpy elnode ein latex-extra latex-preview-pane docker docker-api docker-cli docker-compose-mode dockerfile-mode python-docstring pytest py-autopep8 pydoc pylint python-info auto-complete-rst sphinx-doc sphinx-frontend sphinx-mode ox-mediawiki ox-minutes ox-nikola cargo racket-mode rust-mode slime gherkin-mode gitlab gitlab-ci-mode org-jira powershell helm gitconfig-mode gitignore-mode ox-rst typescript-mode ## skewer-mode ob-http ob-ipython ob-restclient linum-relative markdown-mode nord-theme restclient request restclient-test yaml-mode magit)))
2019-09-17 19:07:05 +02:00
'(python-shell-interpreter "python3" t)
2019-08-01 20:22:54 +02:00
'(request-log-level (quote debug))
'(request-message-level (quote debug))
2019-05-07 17:20:19 +02:00
'(require-final-newline t)
2019-09-06 09:21:51 +02:00
'(restclient-log-request t)
'(restclient-same-buffer-response t)
2019-07-09 17:01:14 +02:00
'(size-indication-mode nil)
2019-05-09 00:28:17 +02:00
'(timeclock-file "~/Documents/Diary/timelog")
'(timeclock-mode-line-display t)
2019-09-20 16:18:20 +02:00
'(tool-bar-mode nil)
'(truncate-lines nil)
'(visible-bell nil))
2019-05-06 17:05:58 +02:00
2019-07-09 16:31:46 +02:00
(require 'markdown-mode)
(require 'linum-relative)
(require 'fill-column-indicator)
(require 'tls)
(require 'request)
(require 'yaml-mode)
2019-09-16 09:13:29 +02:00
(require 'json)
(require 'url)
2019-07-09 14:23:34 +02:00
2019-05-03 11:49:08 +02:00
;; UTF-8 FTW
2019-05-02 13:16:44 +02:00
(prefer-coding-system 'utf-8)
2019-05-06 08:28:46 +02:00
(set-keyboard-coding-system 'utf-8)
(set-terminal-coding-system 'utf-8)
2019-05-02 19:40:34 +02:00
2019-05-03 11:49:08 +02:00
;; nuke trailing whitespace when writing to a file
(add-hook 'write-file-hooks 'delete-trailing-whitespace)
2019-09-18 16:35:12 +02:00
2019-05-06 17:05:58 +02:00
(add-hook 'markdown-mode-hook 'turn-on-font-lock)
(add-hook 'python-mode-hook 'turn-on-font-lock)
2019-05-03 11:49:08 +02:00
;; I got sick of typing "yes"
(defalias 'yes-or-no-p 'y-or-n-p)
;; ++++++++++++++++++++ OS
(when (eq system-type 'darwin)
2019-08-01 21:15:57 +02:00
(when (display-graphic-p)
(add-to-list 'default-frame-alist '(ns-transparent-titlebar . t))
2019-09-05 09:20:02 +02:00
(add-to-list 'default-frame-alist '(ns-appearance . dark))))
(when (eq system-type 'windows-nt)
2019-09-19 23:28:58 +02:00
;; %USERPROFILE%\AppData\Local\Programs\emacs-26.2-x86_64\bin\emacsclientw.exe -c -n -a runemacs.exe
2019-09-21 18:25:41 +02:00
;; (setq inferior-lisp-program (executable-find "sbcl"))
2019-09-21 20:16:14 +02:00
(setq sbcl-exe (expand-file-name "~/AppData/Local/Programs/Steel Bank Common Lisp/1.4.14/sbcl.exe"))
(setq sbcl-core (expand-file-name "~/AppData/Local/Programs/Steel Bank Common Lisp/1.4.14/sbcl.core"))
2019-09-21 18:25:41 +02:00
(setq slime-lisp-implementations `((sbcl (,sbcl-exe "--core" ,sbcl-core))))
2019-08-15 09:44:44 +02:00
(setq python-shell-interpreter "python")
2019-09-21 13:54:13 +02:00
(setq inferior-lisp-program "sbcl")
2019-09-21 20:16:14 +02:00
(add-to-list 'load-path (expand-file-name "~/AppData/Roaming/__secrets"))
2019-09-21 18:25:41 +02:00
(cd "~/opt")
2019-09-19 09:40:06 +02:00
(when (display-graphic-p)
2019-09-21 13:54:13 +02:00
(add-to-list 'default-frame-alist '(undecorated . nil))
(add-to-list 'default-frame-alist '(font . "Iosevka Term-11"))
2019-09-19 09:40:06 +02:00
(when (string= (system-name) "EVG01788WS")
2019-09-26 13:07:42 +02:00
(add-to-list 'default-frame-alist '(fullscreen . maximized))
2019-09-25 16:16:23 +02:00
(add-to-list 'load-path (expand-file-name "~/.emacs.d/__evo")))
2019-09-21 13:54:13 +02:00
(when (string= (system-name) "XPS-8930"))))
2019-05-06 17:05:58 +02:00
2019-05-15 12:59:56 +02:00
(when (eq system-type 'gnu/linux)
(setq slime-lisp-implementations '((sbcl ("/usr/bin/sbcl"))))
2019-09-05 09:20:02 +02:00
(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")
2019-09-19 19:25:11 +02:00
(when (display-graphic-p)
2019-09-25 16:16:23 +02:00
;; (toggle-frame-fullscreen)
2019-09-19 19:25:11 +02:00
(setq-default line-spacing 3)
2019-09-19 23:28:58 +02:00
(add-to-list 'default-frame-alist '(font . "Iosevka Term-14"))))
;; ++++++++++++++++++++ OS
2019-05-15 12:59:56 +02:00
2019-05-06 17:05:58 +02:00
(defun copy-whole-buffer ()
"Copy entire buffer to clipboard"
(interactive)
(clipboard-kill-ring-save (point-min) (point-max)))
2019-05-08 23:01:03 +02:00
2019-08-01 14:42:29 +02:00
(defun format-whole-buffer ()
"Copy entire buffer to clipboard"
(interactive)
(fill-paragraph (point-min) (point-max)))
2019-05-08 22:55:43 +02:00
(put 'upcase-region 'disabled nil)
2019-09-18 16:35:12 +02:00
2019-05-09 19:39:26 +02:00
(setq view-diary-entries-initially t
2019-08-01 21:15:57 +02:00
mark-diary-entries-in-calendar t
number-of-diary-entries 7)
2019-05-09 19:39:26 +02:00
(add-hook 'diary-display-hook 'fancy-diary-display)
(add-hook 'today-visible-calendar-hook 'calendar-mark-today)
2019-07-12 16:33:54 +02:00
2019-07-09 16:31:46 +02:00
(put 'narrow-to-region 'disabled nil)
(put 'narrow-to-page 'disabled nil)
2019-07-09 16:31:46 +02:00
(defun duplicate-line()
(interactive)
(move-beginning-of-line 1)
(kill-line)
(yank)
(open-line 1)
(next-line 1)
(yank)
2019-08-01 21:15:57 +02:00
)
2019-06-12 14:55:15 +02:00
;;(global-set-key (kbd "C-d") 'duplicate-line)
2019-07-09 16:31:46 +02:00
(add-to-list 'auto-mode-alist '("\\.yml\\'" . yaml-mode))
2019-07-17 19:36:05 +02:00
;; slime
(setq slime-contribs '(slime-fancy))
2019-09-23 15:47:43 +02:00
2019-08-21 16:59:17 +02:00
2019-09-11 17:33:20 +02:00
(require 'url)
(defun webscrap-page-raw (url)
(interactive)
(let 'url-request-method "GET")
(url-retrieve url
(lambda (status) (switch-to-buffer-other-window (current-buffer))))
)
2019-09-18 16:35:12 +02:00
;; ===================== Org-mode ====================== ;;
(add-hook 'org-mode-hook 'turn-on-font-lock)
(org-clock-persistence-insinuate)
2019-09-18 14:10:12 +02:00
;; ==================== GLOBAL KEYS ==================== ;;
2019-09-19 09:40:06 +02:00
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cc" 'org-capture)
(global-set-key "\C-cb" 'org-switchb)
(global-set-key "\C-xg" 'magit-status)
(global-set-key "\C-xM-g" 'magit-dispatch)
2019-09-18 14:10:12 +02:00
(global-unset-key "\C-z")
2019-09-18 14:10:12 +02:00
;; ================= ALWAYS AT THE END ================= ;;
;; Turn off chrome
2019-09-25 16:16:23 +02:00
;; (dolist (mode '(menu-bar-mode tool-bar-mode scroll-bar-mode))
;; (when (fboundp mode) (funcall mode -1)))
2019-09-18 14:10:12 +02:00
2019-08-21 16:59:17 +02:00
;; Local Variables:
;; mode: emacs-lisp
;; coding: utf-8-unix
;; End: