emacs.d/init.el

168 lines
5.9 KiB
EmacsLisp
Raw Normal View History

2019-05-17 20:32:09 +02:00
2019-05-01 19:03:10 +02:00
;; -*- coding: utf-8 -*-
2019-05-07 17:20:19 +02:00
(add-to-list 'custom-theme-load-path (expand-file-name "~/.emacs.d/bundle/nord-theme/"))
(add-to-list 'load-path (expand-file-name "~/.emacs.d/bundle"))
(add-to-list 'load-path (expand-file-name "~/.emacs.d/bundle/markdown-mode"))
(add-to-list 'load-path (expand-file-name "~/.emacs.d/bundle/linum-relative"))
2019-05-01 21:49:02 +02:00
2019-05-08 22:55:43 +02:00
(setq nord-region-highlight "snowstorm")
(setq nord-comment-brightness 15)
2019-05-07 17:20:19 +02:00
(load-theme 'nord t)
2019-05-01 21:49:02 +02:00
2019-05-07 17:20:19 +02:00
(require 'markdown-mode)
(require 'linum-relative)
(require 'fill-column-indicator)
(require 'tls)
2019-05-06 17:05:58 +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-06-12 14:55:15 +02:00
(require 'package)
2019-05-07 17:20:19 +02:00
(add-to-list 'package-archives
'("melpa-stable" . "https://stable.melpa.org/packages/"))
2019-06-12 14:55:15 +02:00
(package-initialize)
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-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))
'(calendar-week-start-day 1)
2019-05-01 18:41:31 +02:00
'(custom-safe-themes
(quote
2019-05-03 11:49:08 +02:00
("4515feff287a98863b7b7f762197a78a7c2bfb6ec93879e7284dff184419268c" default)))
2019-05-09 00:28:17 +02:00
'(diary-file "~/Documents/Diary/diary")
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)
'(global-font-lock-mode t)
'(global-hl-line-mode t)
2019-05-07 17:20:19 +02:00
'(indent-tabs-mode nil)
2019-06-12 14:55:15 +02:00
'(inhibit-startup-screen 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)
'(newsticker-download-logos nil)
'(newsticker-frontend (quote newsticker-plainview))
'(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)
("Linuxjournal" "https://www.linuxjournal.com/node/feed")
("Phoronix" "https://www.phoronix.com/rss.php")
2019-05-17 20:32:09 +02:00
("Ubuntu" "https://blog.ubuntu.com/feed")
("Python PEP" "https://www.python.org/dev/peps/peps.rss/")
2019-06-17 22:13:50 +02:00
("openSuse News" "https://news.opensuse.org/feed"))))
'(org-agenda-files (quote ("~/Documents/Journal")))
'(org-default-notes-file "~/Documents/Journal/notes.org")
2019-06-12 14:55:15 +02:00
'(package-enable-at-startup t)
2019-05-07 17:20:19 +02:00
'(package-selected-packages (quote (magit)))
'(require-final-newline t)
2019-05-09 00:28:17 +02:00
'(timeclock-file "~/Documents/Diary/timelog")
'(timeclock-mode-line-display t)
2019-05-07 17:20:19 +02:00
'(visible-bell 1))
2019-05-06 17:05:58 +02:00
2019-05-01 18:41:31 +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-05-09 15:51:09 +02:00
)
2019-06-17 11:05:20 +02:00
(when (display-graphic-p)
(add-to-list 'default-frame-alist '(font . "Hack-10")))
2019-05-03 16:13:49 +02:00
;; set modes
2019-05-04 23:27:15 +02:00
(line-number-mode -1)
(column-number-mode -1)
2019-05-02 16:51:25 +02:00
(blink-cursor-mode -1)
2019-05-04 23:27:15 +02:00
(display-battery-mode -1)
(display-time-mode 1)
(size-indication-mode -1)
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-05-06 08:28:46 +02:00
(add-hook 'org-mode-hook 'turn-on-font-lock)
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)
;; Turn off chrome
(dolist (mode '(menu-bar-mode tool-bar-mode scroll-bar-mode))
(when (fboundp mode) (funcall mode -1)))
;; start a server, unless one is already running
2019-05-04 23:27:15 +02:00
(when (require 'server nil t) (unless (server-running-p) (server-start)))
2019-05-03 11:49:08 +02:00
2019-05-03 16:13:49 +02:00
;; custom packages
(when (eq system-type 'darwin)
(when (display-graphic-p)
;;(set-default-font "RobotoMono Nerd Font 13")
(set-frame-font "RobotoMono Nerd Font 13")
(add-to-list 'default-frame-alist '(font . "RobotoMono Nerd Font-13"))
(add-to-list 'default-frame-alist '(ns-transparent-titlebar . t))
(add-to-list 'default-frame-alist '(ns-appearance . dark))
(add-to-list 'default-frame-alist '(height . 60))
(add-to-list 'default-frame-alist '(width . 80))))
(when (eq system-type 'windows-nt)
(setq-default line-spacing 5)
(add-to-list 'load-path (expand-file-name "~/.emacs.d/__evo"))
(require 'evo-feeds)
(when (display-graphic-p)
2019-06-12 14:55:15 +02:00
(add-to-list 'default-frame-alist '(height . 60))
(add-to-list 'default-frame-alist '(width . 80))
(add-to-list 'default-frame-alist '(alpha . (96)))))
2019-05-06 17:05:58 +02:00
2019-05-15 12:59:56 +02:00
(when (eq system-type 'gnu/linux)
2019-06-12 15:01:48 +02:00
(setq-default line-spacing 3)
2019-05-15 12:59:56 +02:00
(when (display-graphic-p)
2019-06-12 15:01:48 +02:00
(add-to-list 'default-frame-alist '(height . 50))
2019-05-15 12:59:56 +02:00
(add-to-list 'default-frame-alist '(width . 80))))
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-05-08 22:55:43 +02:00
(put 'upcase-region 'disabled nil)
2019-05-09 19:39:26 +02:00
(setq view-diary-entries-initially t
mark-diary-entries-in-calendar t
number-of-diary-entries 7)
(add-hook 'diary-display-hook 'fancy-diary-display)
(add-hook 'today-visible-calendar-hook 'calendar-mark-today)
2019-05-09 22:04:06 +02:00
(global-set-key "\C-cc" 'org-capture)
(global-set-key "\C-ca" 'org-agenda)
2019-05-12 16:54:03 +02:00
(setq org-todo-keywords
'((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED")))
(put 'narrow-to-region 'disabled nil)
(put 'narrow-to-page 'disabled nil)
(defun duplicate-line()
(interactive)
(move-beginning-of-line 1)
(kill-line)
(yank)
(open-line 1)
(next-line 1)
(yank)
)
2019-06-12 14:55:15 +02:00
;;(global-set-key (kbd "C-d") 'duplicate-line)