2017-11-29 12:45:52 +00:00
|
|
|
|
;;; init --- Summary
|
|
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
|
2016-11-01 16:03:01 +00:00
|
|
|
|
(setq custom-file (concat user-emacs-directory "customizations.el"))
|
|
|
|
|
(load custom-file)
|
|
|
|
|
|
2016-10-19 06:05:12 +00:00
|
|
|
|
;; Initialize the package system and use-package
|
2016-10-21 12:44:02 +00:00
|
|
|
|
(setq load-prefer-newer t)
|
2016-10-19 06:05:12 +00:00
|
|
|
|
(require 'package)
|
|
|
|
|
(add-to-list 'package-archives
|
|
|
|
|
'("gnu" . "http://elpa.gnu.org/packages/"))
|
2016-11-07 13:46:53 +00:00
|
|
|
|
(add-to-list 'package-archives
|
|
|
|
|
'("melpa-stable" . "https://stable.melpa.org/packages/") t)
|
2016-10-19 06:05:12 +00:00
|
|
|
|
(add-to-list 'package-archives
|
2016-11-07 13:00:06 +00:00
|
|
|
|
'("melpa" . "https://melpa.org/packages/") t)
|
2016-10-19 06:05:12 +00:00
|
|
|
|
(add-to-list 'package-archives
|
2016-11-07 13:00:06 +00:00
|
|
|
|
'("marmalade" . "http://marmalade-repo.org/packages/") t)
|
2017-01-05 20:41:48 +00:00
|
|
|
|
(add-to-list 'package-archives
|
|
|
|
|
'("org" . "http://orgmode.org/elpa/") t)
|
2016-08-18 20:01:20 +00:00
|
|
|
|
(package-initialize)
|
|
|
|
|
|
2017-11-29 12:45:52 +00:00
|
|
|
|
(setq-default use-package-always-ensure t)
|
2017-04-05 12:21:19 +00:00
|
|
|
|
|
2016-10-19 06:05:12 +00:00
|
|
|
|
(unless (package-installed-p 'use-package)
|
|
|
|
|
(package-refresh-contents)
|
|
|
|
|
(package-install 'use-package))
|
|
|
|
|
|
2017-04-05 12:22:07 +00:00
|
|
|
|
(use-package use-package
|
|
|
|
|
:pin melpa-stable)
|
|
|
|
|
|
2016-10-21 16:44:36 +00:00
|
|
|
|
;; Set up my personal keymap early so I can use it in use-package
|
|
|
|
|
;; calls
|
2016-10-27 14:48:28 +00:00
|
|
|
|
(defvar gpolonkai/pers-map (make-sparse-keymap)
|
|
|
|
|
"My own, personal, keymap!")
|
2016-10-21 16:44:36 +00:00
|
|
|
|
(define-prefix-command 'gpolonkai/pers-map)
|
|
|
|
|
(define-key ctl-x-map "t" 'gpolonkai/pers-map)
|
|
|
|
|
|
2016-09-29 08:50:50 +00:00
|
|
|
|
;; Add path to my custom lisp functions
|
2016-09-15 14:08:54 +00:00
|
|
|
|
(add-to-list 'load-path (concat
|
|
|
|
|
user-emacs-directory
|
|
|
|
|
(convert-standard-filename "lisp/")))
|
|
|
|
|
|
2016-11-18 08:45:50 +00:00
|
|
|
|
;; Load my own functions
|
|
|
|
|
(load "gnu-c-header")
|
|
|
|
|
(load "round-number-to-decimals")
|
|
|
|
|
(load "zim")
|
|
|
|
|
(load "enclose-string")
|
|
|
|
|
(load "buf-manipulation")
|
|
|
|
|
(load "text-manip")
|
|
|
|
|
(load "frame-manip")
|
|
|
|
|
(load "file-manip")
|
|
|
|
|
(load "window-manip")
|
2017-11-29 12:55:44 +00:00
|
|
|
|
(load "xdg-paths")
|
2016-11-18 08:45:50 +00:00
|
|
|
|
|
|
|
|
|
;; Define aliases
|
|
|
|
|
(defalias 'yes-or-no-p 'y-or-n-p)
|
|
|
|
|
|
2016-09-29 08:50:50 +00:00
|
|
|
|
(set-face-attribute 'default t :font "Hack-10")
|
|
|
|
|
(set-frame-font "Hack-10" nil t)
|
2014-10-05 12:57:41 +00:00
|
|
|
|
|
2016-10-25 11:11:25 +00:00
|
|
|
|
;; UI hacks: turn off the scroll bar (that’s why Nyan-cat is here),
|
|
|
|
|
;; the toolbar (I don’t really use it), and the menu bar (I rarely use
|
|
|
|
|
;; it, and in those rare occasions I can simply turn it on)
|
|
|
|
|
(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
|
|
|
|
|
(if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
|
|
|
|
|
(if (fboundp 'menu-bar-mode) (menu-bar-mode -1))
|
2016-11-07 12:16:31 +00:00
|
|
|
|
;; Maximize the frame
|
|
|
|
|
(set-frame-parameter nil 'fullscreen 'maximized)
|
2016-10-25 11:11:25 +00:00
|
|
|
|
|
2017-04-12 05:46:57 +00:00
|
|
|
|
(defun termux-p ()
|
|
|
|
|
"Check if Emacs is running under Termux."
|
|
|
|
|
(string-match-p
|
|
|
|
|
(regexp-quote "/com.termux/")
|
|
|
|
|
(expand-file-name "~")))
|
|
|
|
|
|
2016-09-29 08:50:50 +00:00
|
|
|
|
;; Load some custom libraries
|
2017-04-18 08:58:46 +00:00
|
|
|
|
(use-package thingatpt
|
|
|
|
|
:ensure nil)
|
2016-10-10 13:30:24 +00:00
|
|
|
|
|
2016-10-10 18:31:01 +00:00
|
|
|
|
(use-package helm
|
|
|
|
|
:init
|
|
|
|
|
(require 'helm-config)
|
|
|
|
|
(setq helm-M-x-fuzzy-match t
|
|
|
|
|
helm-buffers-fuzzy-matching t
|
|
|
|
|
helm-recentf-fuzzy-match t)
|
|
|
|
|
:config
|
|
|
|
|
(helm-mode t)
|
|
|
|
|
:bind
|
|
|
|
|
(("M-x" . helm-M-x)
|
2016-10-27 14:43:03 +00:00
|
|
|
|
:map ctl-x-map
|
|
|
|
|
("C-f" . helm-find-files)
|
2017-04-04 20:08:32 +00:00
|
|
|
|
("b" . helm-mini)
|
|
|
|
|
:map helm-map
|
|
|
|
|
("/" . gpolonkai/helm-ff-slash-dir-complete)))
|
2016-10-10 18:31:01 +00:00
|
|
|
|
|
2016-10-10 18:32:55 +00:00
|
|
|
|
(use-package helm-swoop
|
|
|
|
|
:bind
|
|
|
|
|
(("M-i" . helm-swoop)))
|
|
|
|
|
|
2016-10-11 17:44:37 +00:00
|
|
|
|
(use-package ggtags
|
|
|
|
|
:config
|
|
|
|
|
(add-hook 'c-mode-hook
|
|
|
|
|
(lambda ()
|
|
|
|
|
(ggtags-mode t)))
|
|
|
|
|
(add-hook 'c-mode-common-hook
|
|
|
|
|
(lambda ()
|
|
|
|
|
(when (derived-mode-p 'c-mode 'c++-mode 'java-mode)
|
|
|
|
|
(ggtags-mode t)))))
|
2016-10-10 18:31:01 +00:00
|
|
|
|
|
2016-10-10 18:34:00 +00:00
|
|
|
|
(use-package helm-gtags
|
|
|
|
|
:init
|
|
|
|
|
(setq-default helm-gtags-auto-update t
|
|
|
|
|
helm-gtags-ignore-case t
|
|
|
|
|
helm-gtags-path-style 'relative)
|
|
|
|
|
:config
|
|
|
|
|
(add-hook 'c-mode-hook
|
|
|
|
|
(lambda ()
|
|
|
|
|
(helm-gtags-mode t)))
|
|
|
|
|
:bind
|
|
|
|
|
(:map helm-gtags-mode-map
|
|
|
|
|
("M-t" . helm-gtags-find-tag)
|
|
|
|
|
("M-r" . helm-gtags-find-rtag)
|
|
|
|
|
("M-s" . helm-gtags-find-symbol)
|
|
|
|
|
("M-g M-p" . helm-gtags-parse-file)
|
|
|
|
|
("C-c <" . helm-gtags-previous-history)
|
|
|
|
|
("C-c >" . helm-gtags-next-history)
|
|
|
|
|
("M-," . helm-gtags-pop-stack)))
|
|
|
|
|
|
2016-10-10 13:30:24 +00:00
|
|
|
|
;; Whitespace mode
|
|
|
|
|
;;
|
|
|
|
|
;; It is turned on by default, and can be toggled with F10
|
|
|
|
|
(use-package whitespace
|
2016-10-13 09:03:31 +00:00
|
|
|
|
:demand
|
2016-10-10 13:30:24 +00:00
|
|
|
|
:config
|
2018-03-19 10:38:11 +00:00
|
|
|
|
(defun prevent-whitespace-mode-for-magit ()
|
|
|
|
|
(not (derived-mode-p 'magit-mode)))
|
|
|
|
|
(add-function :before-while whitespace-enable-predicate 'prevent-whitespace-mode-for-magit)
|
2016-10-13 09:03:31 +00:00
|
|
|
|
(global-whitespace-mode 1)
|
2017-09-18 13:31:59 +00:00
|
|
|
|
(setq whitespace-line-column 100)
|
2016-10-10 13:30:24 +00:00
|
|
|
|
:bind
|
2016-10-13 09:03:31 +00:00
|
|
|
|
(([f10] . whitespace-mode)
|
|
|
|
|
([(shift f10)] . global-whitespace-mode)))
|
2016-10-10 13:32:28 +00:00
|
|
|
|
|
|
|
|
|
;; Multiple cursors
|
|
|
|
|
(use-package multiple-cursors
|
2017-04-18 09:00:59 +00:00
|
|
|
|
:init
|
|
|
|
|
(defvar gpolonkai/mc-prefix-map (make-sparse-keymap)
|
|
|
|
|
"Prefix keymap for multiple-cursors")
|
|
|
|
|
(define-prefix-command 'gpolonkai/mc-prefix-map)
|
|
|
|
|
(define-key global-map (kbd "C-c m") 'gpolonkai/mc-prefix-map)
|
2016-10-10 13:32:28 +00:00
|
|
|
|
:config
|
|
|
|
|
(add-hook 'multiple-cursors-mode-enabled-hook
|
|
|
|
|
(lambda ()
|
|
|
|
|
(setq blink-matching-paren nil)))
|
|
|
|
|
(add-hook 'multiple-cursors-mode-disabled-hook
|
|
|
|
|
(lambda ()
|
|
|
|
|
(setq blink-matching-paren t)))
|
2017-04-18 09:00:59 +00:00
|
|
|
|
:bind (:map gpolonkai/mc-prefix-map
|
|
|
|
|
("t" . mc/mark-all-like-this)
|
|
|
|
|
("m" . mc/mark-all-like-this-dwim)
|
|
|
|
|
("l" . mc/edit-lines)
|
|
|
|
|
("e" . mc/edit-ends-of-lines)
|
|
|
|
|
("a" . mc/edit-beginnings-of-lines)
|
|
|
|
|
("n" . mc/mark-next-like-this)
|
|
|
|
|
("p" . mc/mark-previous-like-this)
|
|
|
|
|
("s" . mc/mark-sgml-tag-pair)
|
|
|
|
|
("d" . mc/mark-all-like-this-in-defun)))
|
2016-10-10 13:33:12 +00:00
|
|
|
|
|
2016-10-10 18:36:10 +00:00
|
|
|
|
(use-package eshell
|
|
|
|
|
:config
|
|
|
|
|
(add-hook 'eshell-mode-hook
|
2016-10-24 21:10:57 +00:00
|
|
|
|
(lambda () (local-set-key (kbd "C-d") #'eshell-C-d)))
|
|
|
|
|
:bind
|
|
|
|
|
(:map gpolonkai/pers-map
|
|
|
|
|
("e" . eshell)))
|
2016-10-10 18:36:10 +00:00
|
|
|
|
|
2016-10-10 13:33:12 +00:00
|
|
|
|
;; Save place
|
|
|
|
|
(use-package saveplace
|
|
|
|
|
:config
|
|
|
|
|
(setq-default save-place t)
|
|
|
|
|
(setq save-place-file (expand-file-name ".places" user-emacs-directory)))
|
2016-10-10 18:37:51 +00:00
|
|
|
|
|
|
|
|
|
;; Nyanyanyanyanya
|
2016-10-10 18:37:24 +00:00
|
|
|
|
(use-package nyan-mode
|
2016-10-11 17:41:01 +00:00
|
|
|
|
:init
|
|
|
|
|
(setq-default nyan-animate-nyancat t
|
|
|
|
|
nyan-wavy-trail t)
|
2016-10-10 18:37:24 +00:00
|
|
|
|
:config
|
|
|
|
|
(nyan-mode t))
|
|
|
|
|
|
2016-10-14 20:10:04 +00:00
|
|
|
|
(when (display-graphic-p)
|
|
|
|
|
(use-package nyan-prompt
|
2017-09-18 13:27:14 +00:00
|
|
|
|
:disabled t
|
2016-10-14 20:10:04 +00:00
|
|
|
|
:config
|
|
|
|
|
(add-hook 'eshell-load-hook 'nyan-prompt-enable)))
|
2016-10-10 18:37:51 +00:00
|
|
|
|
|
2016-10-10 13:36:08 +00:00
|
|
|
|
;; Zone!
|
2016-11-09 07:58:20 +00:00
|
|
|
|
(when (display-graphic-p)
|
|
|
|
|
(use-package zone-nyan
|
2016-11-09 09:38:40 +00:00
|
|
|
|
:after
|
|
|
|
|
zone
|
2016-11-09 07:58:20 +00:00
|
|
|
|
:config
|
|
|
|
|
(setq-default zone-nyan-hide-progress t)
|
|
|
|
|
(setq zone-programs (vconcat zone-programs [zone-nyan]))))
|
2016-10-11 17:42:57 +00:00
|
|
|
|
|
2016-10-25 17:05:54 +00:00
|
|
|
|
(defun gpolonkai/zone-enable ()
|
2017-11-29 12:45:52 +00:00
|
|
|
|
"Enable zoning out."
|
2016-10-25 17:05:54 +00:00
|
|
|
|
(interactive)
|
2016-10-27 14:43:50 +00:00
|
|
|
|
(zone-when-idle 60)
|
2016-11-09 09:12:53 +00:00
|
|
|
|
(message "I will zone out after idling for 60 seconds."))
|
2016-10-25 17:05:54 +00:00
|
|
|
|
|
2016-10-10 13:36:08 +00:00
|
|
|
|
(use-package zone
|
2016-10-25 17:05:54 +00:00
|
|
|
|
:demand
|
2016-10-10 13:36:08 +00:00
|
|
|
|
:config
|
2016-10-25 17:05:54 +00:00
|
|
|
|
(zone-when-idle 60)
|
|
|
|
|
:bind
|
|
|
|
|
(:map gpolonkai/pers-map
|
|
|
|
|
("zi" . gpolonkai/zone-enable)
|
|
|
|
|
("zq" . zone-leave-me-alone)))
|
2016-10-10 13:36:08 +00:00
|
|
|
|
|
2016-10-10 18:38:49 +00:00
|
|
|
|
;; Magit and friends
|
|
|
|
|
(use-package magit
|
|
|
|
|
:init
|
|
|
|
|
(setq magit-auto-revert-mode nil)
|
|
|
|
|
(setq magit-last-seen-setup-instructions "1.4.0")
|
|
|
|
|
:bind
|
2016-10-27 14:43:03 +00:00
|
|
|
|
(:map ctl-x-map
|
|
|
|
|
("g" . magit-status)))
|
2016-10-10 18:38:49 +00:00
|
|
|
|
|
2016-10-10 13:43:24 +00:00
|
|
|
|
(use-package origami
|
|
|
|
|
:demand
|
|
|
|
|
:config
|
|
|
|
|
(define-prefix-command 'origami-mode-map)
|
2016-10-27 14:43:03 +00:00
|
|
|
|
(define-key ctl-x-map (kbd "C-z") 'origami-mode-map)
|
2016-10-10 13:43:24 +00:00
|
|
|
|
(global-origami-mode)
|
|
|
|
|
:bind
|
|
|
|
|
(:map origami-mode-map
|
|
|
|
|
("o" . origami-open-node)
|
|
|
|
|
("O" . origami-open-node-recursively)
|
|
|
|
|
("c" . origami-close-node)
|
|
|
|
|
("C" . origami-close-node-recursively)
|
|
|
|
|
("a" . origami-toggle-node)
|
|
|
|
|
("A" . origami-recursively-toggle-node)
|
|
|
|
|
("R" . origami-open-all-nodes)
|
|
|
|
|
("M" . origami-close-all-nodes)
|
|
|
|
|
("v" . origami-show-only-node)
|
|
|
|
|
("k" . origami-previous-fold)
|
|
|
|
|
("j" . origami-forward-fold)
|
|
|
|
|
("x" . origami-reset)))
|
|
|
|
|
|
2016-10-14 13:31:09 +00:00
|
|
|
|
(use-package helm-ag
|
2016-10-10 18:39:31 +00:00
|
|
|
|
:bind
|
2016-10-27 14:43:03 +00:00
|
|
|
|
(:map gpolonkai/pers-map
|
|
|
|
|
("s" . helm-do-ag)))
|
2016-10-10 18:39:31 +00:00
|
|
|
|
|
2016-10-14 13:31:34 +00:00
|
|
|
|
(use-package smartparens
|
2016-10-14 09:11:56 +00:00
|
|
|
|
:demand
|
2016-10-10 18:40:03 +00:00
|
|
|
|
:config
|
|
|
|
|
(show-smartparens-global-mode t)
|
|
|
|
|
(add-hook 'prog-mode-hook
|
|
|
|
|
'turn-on-smartparens-strict-mode)
|
|
|
|
|
(add-hook 'markdown-mode-hook
|
2016-10-11 15:56:04 +00:00
|
|
|
|
'turn-on-smartparens-strict-mode)
|
|
|
|
|
:bind
|
2016-11-18 14:50:11 +00:00
|
|
|
|
(([f9] . smartparens-strict-mode)
|
2017-01-26 08:05:49 +00:00
|
|
|
|
("C-c s u" . sp-unwrap-sexp)
|
|
|
|
|
("C-c s k" . sp-kill-sexp)))
|
2014-10-05 12:57:41 +00:00
|
|
|
|
|
2016-10-10 18:41:49 +00:00
|
|
|
|
(use-package smart-mode-line
|
2016-11-09 07:38:17 +00:00
|
|
|
|
:after
|
|
|
|
|
org
|
2016-10-10 18:41:49 +00:00
|
|
|
|
:config
|
2016-11-09 07:38:17 +00:00
|
|
|
|
(add-to-list 'sml/replacer-regexp-list
|
|
|
|
|
'("^~/Projects/" ":Proj:")
|
|
|
|
|
t)
|
2016-11-10 10:48:31 +00:00
|
|
|
|
(add-to-list 'sml/replacer-regexp-list
|
|
|
|
|
'("^~/Projektek/" ":Proj:")
|
|
|
|
|
t)
|
2016-11-09 07:38:17 +00:00
|
|
|
|
(add-to-list 'sml/replacer-regexp-list
|
|
|
|
|
(list (concat "^" (regexp-quote user-documents-directory))
|
|
|
|
|
":Doc:")
|
|
|
|
|
t)
|
2016-11-10 10:48:31 +00:00
|
|
|
|
(add-to-list 'sml/replacer-regexp-list
|
|
|
|
|
'("^:Proj:jekyll/gergelypolonkai.github.io/" ":Blog:")
|
|
|
|
|
t)
|
2016-11-21 15:46:07 +00:00
|
|
|
|
(add-to-list 'sml/replacer-regexp-list
|
|
|
|
|
(list "^:Proj:python/" ":Proj:Py:")
|
|
|
|
|
t)
|
2017-04-11 22:12:05 +00:00
|
|
|
|
(sml/setup)
|
|
|
|
|
(setq-default header-line-format
|
|
|
|
|
'(""
|
2017-04-20 13:48:04 +00:00
|
|
|
|
mode-line-mule-info
|
2017-04-11 22:12:05 +00:00
|
|
|
|
mode-line-client
|
|
|
|
|
mode-line-modified
|
|
|
|
|
mode-line-remote
|
|
|
|
|
mode-line-frame-identification
|
|
|
|
|
mode-line-buffer-identification
|
2017-04-20 13:48:04 +00:00
|
|
|
|
sml/pos-id-separator
|
2017-04-11 22:12:05 +00:00
|
|
|
|
(vc-mode vc-mode)
|
|
|
|
|
mode-line-position))
|
|
|
|
|
(delete '(vc-mode vc-mode) mode-line-format)
|
|
|
|
|
(delete 'mode-line-frame-identification mode-line-format)
|
|
|
|
|
(delete 'mode-line-buffer-identification mode-line-format)
|
|
|
|
|
(delete 'mode-line-position mode-line-format)
|
2017-04-20 13:48:04 +00:00
|
|
|
|
(delete 'mode-line-mule-info mode-line-format)
|
|
|
|
|
(delete 'mode-line-modified mode-line-format)
|
|
|
|
|
(delete 'mode-line-client mode-line-format)
|
|
|
|
|
(delete 'mode-line-remote mode-line-format)
|
|
|
|
|
;; Add sml/pre-id-separator after mode-line-front-space
|
|
|
|
|
(let* ((front-space-position (1+ (cl-position 'mode-line-front-space mode-line-format)))
|
|
|
|
|
(mode-line-rest (nthcdr front-space-position mode-line-format))
|
|
|
|
|
(mode-line-beg (subseq mode-line-format 0 front-space-position)))
|
|
|
|
|
(setq-default mode-line-format (nconc mode-line-beg
|
|
|
|
|
(list sml/pre-id-separator)
|
|
|
|
|
mode-line-rest)))
|
2017-04-11 22:12:05 +00:00
|
|
|
|
)
|
2016-10-10 18:41:49 +00:00
|
|
|
|
|
2016-10-10 13:47:55 +00:00
|
|
|
|
(use-package company
|
2016-10-12 08:39:04 +00:00
|
|
|
|
:config
|
2017-11-08 07:21:22 +00:00
|
|
|
|
(setq company-idle-delay nil
|
|
|
|
|
company-frontends '(company-pseudo-tooltip-frontend
|
|
|
|
|
company-echo-metadata-frontend))
|
2016-10-12 08:39:04 +00:00
|
|
|
|
(global-company-mode))
|
|
|
|
|
|
|
|
|
|
(use-package helm-company
|
|
|
|
|
:after
|
|
|
|
|
company
|
|
|
|
|
helm
|
2016-10-10 13:47:55 +00:00
|
|
|
|
:bind
|
|
|
|
|
(:map company-mode-map
|
2017-04-04 20:23:51 +00:00
|
|
|
|
("C-c j" . helm-company)
|
2016-10-10 13:47:55 +00:00
|
|
|
|
:map company-active-map
|
2017-04-04 20:23:51 +00:00
|
|
|
|
("C-c j" . helm-company)))
|
2016-10-10 13:47:55 +00:00
|
|
|
|
|
2016-10-10 18:41:13 +00:00
|
|
|
|
(use-package projectile
|
2017-11-08 07:19:46 +00:00
|
|
|
|
:pin melpa-stable
|
2016-10-10 18:41:13 +00:00
|
|
|
|
:config
|
|
|
|
|
(projectile-global-mode t))
|
|
|
|
|
|
2016-10-10 18:42:39 +00:00
|
|
|
|
(use-package helm-projectile
|
|
|
|
|
:init
|
|
|
|
|
(setq projectile-completion-system 'helm)
|
|
|
|
|
:config
|
|
|
|
|
(helm-projectile-on))
|
|
|
|
|
|
2016-10-10 18:42:10 +00:00
|
|
|
|
(use-package drag-stuff
|
|
|
|
|
:config
|
2016-11-30 16:32:51 +00:00
|
|
|
|
(drag-stuff-global-mode t)
|
|
|
|
|
(drag-stuff-define-keys))
|
2016-10-10 18:42:10 +00:00
|
|
|
|
|
2016-10-11 17:43:56 +00:00
|
|
|
|
;; Git gutter
|
2016-11-09 09:13:43 +00:00
|
|
|
|
;; If we are in text-only mode, there is no fringe.
|
|
|
|
|
(let ((gitgutter-package
|
|
|
|
|
(if (display-graphic-p)
|
|
|
|
|
"git-gutter-fringe"
|
|
|
|
|
"git-gutter")))
|
|
|
|
|
(eval `(use-package ,gitgutter-package
|
|
|
|
|
:demand
|
|
|
|
|
:config
|
|
|
|
|
(global-git-gutter-mode t)
|
|
|
|
|
:bind
|
|
|
|
|
(:map gpolonkai/pers-map
|
2016-12-19 10:18:01 +00:00
|
|
|
|
("gg" . git-gutter:update-all-windows)
|
|
|
|
|
("gn" . git-gutter:next-hunk)
|
|
|
|
|
("gp" . git-gutter:previous-hunk)))))
|
2016-10-11 17:43:56 +00:00
|
|
|
|
|
2016-12-08 09:27:13 +00:00
|
|
|
|
;; From gmane.emacs.orgmode
|
|
|
|
|
;; (http://article.gmane.org/gmane.emacs.orgmode/75222)
|
|
|
|
|
(defun f-ediff-org-showhide (buf command &rest cmdargs)
|
2017-11-29 12:45:52 +00:00
|
|
|
|
"If buffer BUF exists and in `org-mode', execute COMMAND with CMDARGS."
|
2016-12-08 09:27:13 +00:00
|
|
|
|
(when buf
|
|
|
|
|
(when (eq (buffer-local-value 'major-mode (get-buffer buf)) 'org-mode)
|
|
|
|
|
(save-excursion
|
|
|
|
|
(set-buffer buf)
|
|
|
|
|
(apply command cmdargs)))))
|
|
|
|
|
|
|
|
|
|
(defun f-ediff-org-unfold-tree-element ()
|
|
|
|
|
"Unfold tree at diff location."
|
|
|
|
|
(f-ediff-org-showhide ediff-buffer-A 'org-reveal)
|
|
|
|
|
(f-ediff-org-showhide ediff-buffer-B 'org-reveal)
|
|
|
|
|
(f-ediff-org-showhide ediff-buffer-C 'org-reveal))
|
|
|
|
|
|
|
|
|
|
(defun f-ediff-org-fold-tree ()
|
|
|
|
|
"Fold tree back to top level."
|
|
|
|
|
(f-ediff-org-showhide ediff-buffer-A 'hide-sublevels 1)
|
|
|
|
|
(f-ediff-org-showhide ediff-buffer-B 'hide-sublevels 1)
|
|
|
|
|
(f-ediff-org-showhide ediff-buffer-C 'hide-sublevels 1))
|
|
|
|
|
|
2016-10-12 08:36:56 +00:00
|
|
|
|
;; Org mode
|
|
|
|
|
(use-package org
|
2016-10-21 21:02:22 +00:00
|
|
|
|
:demand
|
2016-10-12 08:36:56 +00:00
|
|
|
|
:init
|
|
|
|
|
(require 'xdg-paths)
|
|
|
|
|
(setq-default org-crypt-key "B0740C4C"
|
|
|
|
|
org-default-notes-file (concat user-documents-directory
|
|
|
|
|
(convert-standard-filename
|
|
|
|
|
"/orgmode/notes.org"))
|
|
|
|
|
org-directory (concat user-documents-directory
|
|
|
|
|
(convert-standard-filename "/orgmode/"))
|
|
|
|
|
org-agenda-files (concat user-documents-directory
|
|
|
|
|
(convert-standard-filename
|
|
|
|
|
"/orgmode/agenda_files"))
|
|
|
|
|
org-ellipsis "…#"
|
|
|
|
|
org-startup-folded 'content
|
|
|
|
|
org-mobile-directory (concat user-documents-directory
|
|
|
|
|
(convert-standard-filename
|
|
|
|
|
"/orgmode/mobile/"))
|
|
|
|
|
org-mobile-inbox-for-pull (concat
|
|
|
|
|
user-documents-directory
|
|
|
|
|
(convert-standard-filename
|
2016-10-20 06:42:55 +00:00
|
|
|
|
"/orgmode/from-mobile.org"))
|
2017-08-07 08:43:50 +00:00
|
|
|
|
org-log-done 'time
|
2017-10-01 11:20:19 +00:00
|
|
|
|
org-src-preserve-indentation t
|
2017-11-08 07:25:41 +00:00
|
|
|
|
org-log-into-drawer t
|
2017-11-29 12:47:53 +00:00
|
|
|
|
org-tags-column 0
|
|
|
|
|
org-startup-indented t)
|
2016-10-19 13:59:31 +00:00
|
|
|
|
:config
|
2016-12-22 09:45:51 +00:00
|
|
|
|
(require 'ox-md)
|
2016-10-19 13:59:31 +00:00
|
|
|
|
(unless (boundp 'org-capture-templates)
|
|
|
|
|
(setq org-capture-templates nil))
|
|
|
|
|
(add-to-list 'org-capture-templates
|
|
|
|
|
'("p" "Blog post"
|
2017-09-25 09:09:05 +00:00
|
|
|
|
entry (file+olp+datetree (concat org-directory "blog.org"))
|
2016-10-20 12:12:28 +00:00
|
|
|
|
"* %^{Title} :blog:\n :PROPERTIES:\n :on: %T\n :END:\n %i%?"))
|
2016-11-17 21:36:30 +00:00
|
|
|
|
(add-to-list 'org-capture-templates
|
|
|
|
|
'("g" "GT2 note"
|
|
|
|
|
entry (file+headline (concat org-directory "gt2-notes.org")
|
|
|
|
|
"Captures")
|
|
|
|
|
"** %^{Title}\n :PROPERTIES:\n :on: %T\n :END:\n %i%?"))
|
2016-11-28 07:30:21 +00:00
|
|
|
|
(setq org-time-stamp-formats '("<%Y-%m-%d>" . "<%Y-%m-%d %H:%M>")
|
|
|
|
|
org-todo-keywords '((sequence "TODO(t)"
|
|
|
|
|
"DOING(w@/!)"
|
|
|
|
|
"BLOCKED(b@/!)"
|
|
|
|
|
"|"
|
2017-04-12 07:16:14 +00:00
|
|
|
|
"CANCELED(c@/!)"
|
2016-11-28 07:30:21 +00:00
|
|
|
|
"REVIEW(r@/!)"
|
|
|
|
|
"DONE(d@/!)"))
|
|
|
|
|
org-goto-interface 'outline-path-completion
|
2016-11-28 07:51:36 +00:00
|
|
|
|
org-goto-max-level 10
|
|
|
|
|
org-html-checkbox-type 'unicode
|
|
|
|
|
org-html-checkbox-types
|
|
|
|
|
'((unicode (on . "<span class=\"task-done\">☑</span>")
|
|
|
|
|
(off . "<span class=\"task-todo\">☐</span>")
|
2016-11-28 09:18:13 +00:00
|
|
|
|
(trans . "<span class=\"task-in-progress\">▣</span>")))
|
|
|
|
|
org-src-window-setup 'current-window)
|
2016-12-08 09:27:13 +00:00
|
|
|
|
(add-hook 'ediff-select-hook 'f-ediff-org-unfold-tree-element)
|
|
|
|
|
(add-hook 'ediff-unselect-hook 'f-ediff-org-fold-tree)
|
2016-10-21 21:02:22 +00:00
|
|
|
|
:bind
|
2016-10-24 07:32:53 +00:00
|
|
|
|
(:map gpolonkai/pers-map
|
|
|
|
|
("a" . org-agenda-list)
|
2016-11-03 09:53:48 +00:00
|
|
|
|
("c" . org-capture)
|
2017-04-17 21:09:51 +00:00
|
|
|
|
("l" . org-store-link)
|
2016-10-24 07:32:53 +00:00
|
|
|
|
:map org-mode-map
|
2016-11-09 09:14:19 +00:00
|
|
|
|
("SPC" . org-space-key)
|
2016-11-15 21:07:39 +00:00
|
|
|
|
("C-c l" . org-toggle-link-display)
|
|
|
|
|
("C-a" . gpolonkai/move-to-beginning-of-line)
|
|
|
|
|
("C-e" . gpolonkai/move-to-end-of-line)))
|
2016-10-12 08:36:56 +00:00
|
|
|
|
|
2016-10-12 08:39:25 +00:00
|
|
|
|
(use-package org-bullets
|
|
|
|
|
:init
|
|
|
|
|
(add-hook 'org-mode-hook
|
|
|
|
|
(lambda ()
|
|
|
|
|
(if (display-graphic-p) org-bullets-mode))))
|
|
|
|
|
|
2016-10-10 18:40:40 +00:00
|
|
|
|
;; Waka-waka
|
|
|
|
|
(use-package wakatime-mode
|
|
|
|
|
:init
|
2017-04-11 22:12:58 +00:00
|
|
|
|
(setq-default wakatime-cli-path (executable-find "wakatime"))
|
2016-10-10 18:40:40 +00:00
|
|
|
|
:config
|
|
|
|
|
(global-wakatime-mode t))
|
|
|
|
|
|
2016-10-13 09:01:25 +00:00
|
|
|
|
(use-package ace-window
|
2016-11-17 13:01:17 +00:00
|
|
|
|
:config
|
|
|
|
|
(setq aw-background nil
|
|
|
|
|
aw-dispatch-always t)
|
|
|
|
|
(add-to-list 'aw-dispatch-alist
|
|
|
|
|
'(?s gpolonkai/scroll-window-up " Scroll window up")
|
|
|
|
|
t)
|
|
|
|
|
(add-to-list 'aw-dispatch-alist
|
|
|
|
|
'(?S gpolonkai/scroll-window-down " Scroll window down")
|
|
|
|
|
t)
|
|
|
|
|
(add-to-list 'aw-dispatch-alist
|
|
|
|
|
'(?q gpolonkai/bury-window " Bury (quit) window")
|
|
|
|
|
t)
|
2016-10-13 09:01:25 +00:00
|
|
|
|
:bind
|
2016-11-15 08:59:32 +00:00
|
|
|
|
(:map ctl-x-map
|
|
|
|
|
("o" . ace-window)))
|
2016-10-13 09:01:25 +00:00
|
|
|
|
|
2016-10-14 09:12:52 +00:00
|
|
|
|
(use-package avy
|
|
|
|
|
:demand
|
|
|
|
|
:config
|
|
|
|
|
(avy-setup-default)
|
|
|
|
|
:bind
|
2016-11-07 12:20:45 +00:00
|
|
|
|
(("M-g c" . avy-goto-char)
|
2016-10-14 09:12:52 +00:00
|
|
|
|
("C-'" . avy-goto-char-2)
|
|
|
|
|
("M-g f" . avy-goto-line)
|
|
|
|
|
("M-g w" . avy-goto-word-1)
|
|
|
|
|
("M-g e" . avy-goto-word-0)))
|
|
|
|
|
|
2016-10-14 10:17:25 +00:00
|
|
|
|
(use-package diminish
|
|
|
|
|
:defer t)
|
|
|
|
|
|
2016-10-14 10:30:22 +00:00
|
|
|
|
(use-package focus
|
|
|
|
|
:bind
|
|
|
|
|
(([f8] . focus-mode)))
|
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package coffee-mode)
|
2016-10-14 13:35:29 +00:00
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package command-log-mode)
|
2016-10-14 13:35:29 +00:00
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package company-c-headers)
|
2016-10-14 13:35:29 +00:00
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package company-shell)
|
2016-10-14 13:35:29 +00:00
|
|
|
|
|
|
|
|
|
(use-package electric-case
|
|
|
|
|
:config
|
2016-11-14 22:59:19 +00:00
|
|
|
|
(add-hook 'c-mode-hook 'electric-case-c-init))
|
2016-10-14 13:35:29 +00:00
|
|
|
|
|
2017-04-20 13:48:55 +00:00
|
|
|
|
(use-package electric-operator
|
2016-11-14 07:37:55 +00:00
|
|
|
|
:config
|
2017-04-20 13:48:55 +00:00
|
|
|
|
(add-hook 'c-mode-common-hook 'electric-operator-mode)
|
|
|
|
|
;; Apply electric-operator-mode to vala-mode, too
|
|
|
|
|
(apply #'electric-operator-add-rules-for-mode 'vala-mode
|
|
|
|
|
electric-operator-prog-mode-rules))
|
2016-10-14 13:35:29 +00:00
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package emamux)
|
2016-10-14 13:35:29 +00:00
|
|
|
|
|
2017-10-09 13:22:54 +00:00
|
|
|
|
(use-package flycheck
|
|
|
|
|
:config
|
|
|
|
|
(global-flycheck-mode))
|
2016-10-14 13:35:29 +00:00
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package flycheck-pkg-config)
|
2016-10-14 13:35:29 +00:00
|
|
|
|
|
2016-10-24 08:48:38 +00:00
|
|
|
|
(use-package git-messenger
|
2016-10-26 21:25:22 +00:00
|
|
|
|
:bind
|
|
|
|
|
(:map gpolonkai/pers-map
|
|
|
|
|
("gm" . git-messenger:popup-message)))
|
2016-10-14 13:35:29 +00:00
|
|
|
|
|
|
|
|
|
(use-package git-timemachine
|
|
|
|
|
:bind
|
|
|
|
|
(([f6] . git-timemachine-toggle)))
|
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package gitconfig-mode)
|
2016-10-14 13:35:29 +00:00
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package gitignore-mode)
|
2016-10-14 13:35:29 +00:00
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package gnugo)
|
2016-10-14 13:35:29 +00:00
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package gobgen)
|
2016-10-14 13:35:29 +00:00
|
|
|
|
|
|
|
|
|
(use-package goto-last-change
|
|
|
|
|
:bind
|
|
|
|
|
(("M-g /" . goto-last-change)))
|
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package helm-chrome)
|
2016-10-14 13:35:29 +00:00
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package helm-flycheck)
|
2016-10-14 13:35:29 +00:00
|
|
|
|
|
2016-10-20 08:22:38 +00:00
|
|
|
|
(use-package helm-flyspell
|
|
|
|
|
:demand
|
|
|
|
|
:bind
|
|
|
|
|
(:map flyspell-mode-map
|
|
|
|
|
("C-M-i" . helm-flyspell-correct)))
|
2016-10-14 13:35:29 +00:00
|
|
|
|
|
2016-10-17 08:28:24 +00:00
|
|
|
|
(use-package helm-github-stars
|
|
|
|
|
:init
|
|
|
|
|
(setq-default helm-github-stars-username "gergelypolonkai"))
|
2016-10-14 13:35:29 +00:00
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package helm-google)
|
2016-10-14 13:35:29 +00:00
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package hyde)
|
2016-10-14 13:35:29 +00:00
|
|
|
|
|
2016-10-24 08:48:38 +00:00
|
|
|
|
(use-package id-manager
|
2016-11-18 12:24:32 +00:00
|
|
|
|
:config
|
2016-11-18 12:25:12 +00:00
|
|
|
|
(load "idm")
|
2016-11-18 12:24:32 +00:00
|
|
|
|
(setq idm-database-file (expand-file-name "idm-db.gpg" user-emacs-directory))
|
|
|
|
|
:bind
|
|
|
|
|
(:map gpolonkai/pers-map
|
|
|
|
|
("i" . idm-open-list-command)))
|
2016-10-14 13:35:29 +00:00
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package identica-mode)
|
2016-10-14 13:35:29 +00:00
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package jinja2-mode)
|
2016-10-14 13:35:29 +00:00
|
|
|
|
|
2016-10-24 08:48:38 +00:00
|
|
|
|
(use-package js2-mode
|
2016-12-22 09:46:42 +00:00
|
|
|
|
:pin melpa-stable)
|
2016-10-14 13:35:29 +00:00
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package json-mode)
|
2016-10-14 13:35:29 +00:00
|
|
|
|
|
2016-10-24 08:48:38 +00:00
|
|
|
|
(use-package markdown-mode
|
2016-10-28 05:12:38 +00:00
|
|
|
|
:config
|
|
|
|
|
(push '("\\.markdown\\'" . markdown-mode) auto-mode-alist)
|
|
|
|
|
(push '("\\.md\\'" . markdown-mode) auto-mode-alist))
|
2016-10-14 13:35:29 +00:00
|
|
|
|
|
2016-10-24 08:48:38 +00:00
|
|
|
|
(use-package mc-extras
|
2017-01-26 08:05:07 +00:00
|
|
|
|
:demand
|
|
|
|
|
:bind
|
|
|
|
|
(:map mc/keymap
|
|
|
|
|
("C-c m =" . mc/compare-chars)))
|
2016-10-14 13:35:29 +00:00
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package ng2-mode)
|
2016-10-14 13:35:29 +00:00
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package org-projectile)
|
2016-10-14 13:35:29 +00:00
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package sass-mode)
|
2016-10-14 13:35:29 +00:00
|
|
|
|
|
2016-10-14 13:33:50 +00:00
|
|
|
|
(use-package smart-mode-line-powerline-theme
|
|
|
|
|
:init
|
|
|
|
|
(setq-default sml/theme 'powerline))
|
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package spinner)
|
2016-10-14 13:35:29 +00:00
|
|
|
|
|
2016-10-24 08:48:38 +00:00
|
|
|
|
(use-package sx
|
2016-10-24 12:36:59 +00:00
|
|
|
|
:demand
|
|
|
|
|
:bind
|
|
|
|
|
(:map gpolonkai/pers-map
|
|
|
|
|
("qi" . sx-inbox)
|
|
|
|
|
("qs" . sx-search)))
|
2016-10-14 13:35:29 +00:00
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package typescript-mode)
|
2016-10-14 13:35:29 +00:00
|
|
|
|
|
2016-10-14 13:35:01 +00:00
|
|
|
|
(use-package vala-mode
|
|
|
|
|
:init
|
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.vala\\'" . vala-mode)))
|
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package xlicense)
|
2016-10-14 13:30:39 +00:00
|
|
|
|
|
2016-10-14 13:35:01 +00:00
|
|
|
|
(use-package yaml-mode
|
|
|
|
|
:init
|
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.yml\\'" . yaml-mode)))
|
|
|
|
|
|
2016-10-17 08:17:24 +00:00
|
|
|
|
(use-package helm-smex
|
|
|
|
|
:bind
|
2016-10-27 14:43:03 +00:00
|
|
|
|
(("M-S-x" . helm-smex)))
|
2016-10-17 08:17:24 +00:00
|
|
|
|
|
2016-10-17 08:22:20 +00:00
|
|
|
|
(use-package ediff
|
|
|
|
|
:init
|
|
|
|
|
(setq-default ediff-merge-split-window-function 'split-window-horizontally
|
|
|
|
|
ediff-split-window-function 'split-window-vertically
|
|
|
|
|
ediff-window-setup-function 'ediff-setup-windows-plain))
|
|
|
|
|
|
2016-10-17 15:43:18 +00:00
|
|
|
|
(use-package plantuml-mode
|
|
|
|
|
:init
|
|
|
|
|
(setq plantuml-jar-path
|
2016-10-24 08:49:02 +00:00
|
|
|
|
(expand-file-name
|
|
|
|
|
;; Make sure we have a download location even if XDG is not
|
|
|
|
|
;; working
|
|
|
|
|
(cond
|
|
|
|
|
((xdg-user-dir "DOWNLOAD")
|
|
|
|
|
(concat (xdg-user-dir "DOWNLOAD") "/plantuml.jar"))
|
|
|
|
|
(t
|
|
|
|
|
"~/Downloads/plantuml.jar"))))
|
2016-10-17 15:43:18 +00:00
|
|
|
|
(defvaralias 'org-plantuml-jar-path 'plantuml-jar-path)
|
|
|
|
|
:config
|
|
|
|
|
(org-babel-do-load-languages
|
|
|
|
|
'org-babel-load-languages
|
|
|
|
|
'((plantuml . t))))
|
2016-10-17 14:24:31 +00:00
|
|
|
|
|
2016-10-21 17:39:14 +00:00
|
|
|
|
(use-package org-random-todo
|
2016-10-27 07:57:25 +00:00
|
|
|
|
:demand
|
2016-10-21 17:39:14 +00:00
|
|
|
|
:config
|
|
|
|
|
;; Don’t bug me too often…
|
2016-10-27 07:57:25 +00:00
|
|
|
|
(setq org-random-todo-how-often 3600)
|
|
|
|
|
:bind
|
|
|
|
|
(:map gpolonkai/pers-map
|
|
|
|
|
("r" . org-random-todo)))
|
2016-10-19 07:23:01 +00:00
|
|
|
|
|
2016-10-20 06:42:55 +00:00
|
|
|
|
(use-package calendar
|
2017-04-18 22:31:32 +00:00
|
|
|
|
:ensure nil
|
2016-10-20 06:42:55 +00:00
|
|
|
|
:init
|
2016-10-20 12:13:03 +00:00
|
|
|
|
(setq calendar-week-start-day 1
|
|
|
|
|
calendar-latitude 47.4
|
|
|
|
|
calendar-longitude 19.0
|
|
|
|
|
calendar-location-name "Budapest, Hungary"
|
|
|
|
|
calendar-time-zone 60
|
|
|
|
|
calendar-standard-time-zone-name "CET"
|
|
|
|
|
calendar-daylight-time-zone-name "CEST"))
|
2016-10-20 06:42:55 +00:00
|
|
|
|
|
2016-10-20 08:20:38 +00:00
|
|
|
|
(use-package yasnippet
|
2016-11-23 08:49:33 +00:00
|
|
|
|
:demand
|
2016-10-20 08:20:38 +00:00
|
|
|
|
:config
|
2017-09-25 09:08:40 +00:00
|
|
|
|
(yas-global-mode 1))
|
2016-10-20 08:20:38 +00:00
|
|
|
|
|
|
|
|
|
(use-package vala-snippets
|
|
|
|
|
:after
|
|
|
|
|
yasnippet)
|
|
|
|
|
|
2016-10-20 12:09:15 +00:00
|
|
|
|
(use-package hungarian-holidays
|
|
|
|
|
:config
|
|
|
|
|
(hungarian-holidays-add))
|
|
|
|
|
|
2016-10-20 12:29:42 +00:00
|
|
|
|
(use-package beacon
|
2016-10-21 16:46:10 +00:00
|
|
|
|
:demand
|
2016-10-20 12:29:42 +00:00
|
|
|
|
:config
|
2016-10-21 16:46:10 +00:00
|
|
|
|
(beacon-mode 1)
|
|
|
|
|
:bind
|
|
|
|
|
(:map gpolonkai/pers-map
|
|
|
|
|
("b" . beacon-blink)))
|
2016-10-20 12:29:42 +00:00
|
|
|
|
|
2016-10-20 13:36:33 +00:00
|
|
|
|
(use-package flyspell
|
|
|
|
|
:config
|
|
|
|
|
(add-hook 'prog-mode-hook
|
2016-10-21 07:32:50 +00:00
|
|
|
|
'flyspell-prog-mode)
|
2016-10-20 13:36:33 +00:00
|
|
|
|
(add-hook 'text-mode-hook
|
2016-10-21 07:32:50 +00:00
|
|
|
|
'flyspell-mode))
|
2016-10-20 13:36:33 +00:00
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package helm-descbinds)
|
2016-10-20 13:50:01 +00:00
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package helm-describe-modes)
|
2016-10-20 13:50:01 +00:00
|
|
|
|
|
2016-10-21 06:18:18 +00:00
|
|
|
|
(use-package autorevert
|
|
|
|
|
:config
|
|
|
|
|
(global-auto-revert-mode 1))
|
|
|
|
|
|
2016-10-21 07:31:35 +00:00
|
|
|
|
(use-package rainbow-delimiters
|
|
|
|
|
:config
|
|
|
|
|
(add-hook 'prog-mode-hook
|
|
|
|
|
#'rainbow-delimiters-mode))
|
|
|
|
|
|
2016-10-24 08:48:38 +00:00
|
|
|
|
(use-package rainbow-mode
|
2017-04-07 16:23:10 +00:00
|
|
|
|
:config
|
|
|
|
|
(add-hook 'css-mode-hook 'rainbow-mode)
|
|
|
|
|
(add-hook 'scss-mode-hook 'rainbow-mode)
|
|
|
|
|
(add-hook 'sass-mode 'rainbow-mode))
|
2016-10-21 07:31:35 +00:00
|
|
|
|
|
2016-10-21 08:18:21 +00:00
|
|
|
|
(use-package hungry-delete
|
|
|
|
|
:config
|
|
|
|
|
(global-hungry-delete-mode))
|
|
|
|
|
|
2016-10-21 12:04:24 +00:00
|
|
|
|
(use-package hl-line
|
|
|
|
|
:config
|
|
|
|
|
(global-hl-line-mode))
|
|
|
|
|
|
2016-10-21 12:43:37 +00:00
|
|
|
|
(use-package eww
|
|
|
|
|
:config
|
|
|
|
|
(setq eww-search-prefix "https://www.google.com/?q="))
|
|
|
|
|
|
2016-10-21 13:24:21 +00:00
|
|
|
|
(use-package electric
|
|
|
|
|
:config
|
|
|
|
|
;; This seems to be the default, but let’s make sure…
|
|
|
|
|
(electric-indent-mode 1))
|
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package restclient)
|
2016-10-21 13:23:54 +00:00
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package company-restclient)
|
2016-10-21 13:23:54 +00:00
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package restclient-helm)
|
2016-10-21 13:23:54 +00:00
|
|
|
|
|
2016-10-21 17:37:08 +00:00
|
|
|
|
(use-package alert
|
|
|
|
|
:config
|
2017-04-12 06:24:19 +00:00
|
|
|
|
(setq alert-default-style
|
|
|
|
|
(if (termux-p)
|
|
|
|
|
(progn
|
|
|
|
|
;; TODO Remove this as soon as my PR gets merged
|
|
|
|
|
;; https://github.com/jwiegley/alert/pull/41
|
|
|
|
|
(unless (fboundp 'alert-termux-notify)
|
|
|
|
|
(defcustom alert-termux-command (executable-find "termux-notification")
|
|
|
|
|
"Path to the termux-notification command.
|
|
|
|
|
This is found in the termux-api package, and it requires the Termux
|
|
|
|
|
API addon app to be installed."
|
|
|
|
|
:type 'file
|
|
|
|
|
:group 'alert)
|
|
|
|
|
|
|
|
|
|
(defun alert-termux-notify (info)
|
|
|
|
|
"Send INFO using termux-notification.
|
|
|
|
|
Handles :TITLE and :MESSAGE keywords from the
|
|
|
|
|
INFO plist."
|
|
|
|
|
(if alert-termux-command
|
|
|
|
|
(let ((args (nconc
|
|
|
|
|
(when (plist-get info :title)
|
|
|
|
|
(list "-t" (alert-encode-string (plist-get info :title))))
|
|
|
|
|
(list "-c" (alert-encode-string (plist-get info :message))))))
|
|
|
|
|
(apply #'call-process alert-termux-command nil
|
|
|
|
|
(list (get-buffer-create " *termux-notification output*") t)
|
|
|
|
|
nil args))
|
|
|
|
|
(alert-message-notify info)))
|
|
|
|
|
|
|
|
|
|
(alert-define-style 'termux :title "Notify using termux"
|
|
|
|
|
:notifier #'alert-termux-notify))
|
|
|
|
|
'termux)
|
|
|
|
|
'notifications)))
|
2016-10-21 17:37:08 +00:00
|
|
|
|
|
2016-10-24 07:49:07 +00:00
|
|
|
|
(use-package newsticker
|
2016-10-24 12:36:50 +00:00
|
|
|
|
:demand
|
2016-10-24 07:49:07 +00:00
|
|
|
|
:config
|
|
|
|
|
(setq newsticker-url-list '(("(or emacs irrelevant)"
|
|
|
|
|
"http://oremacs.com/atom.xml"
|
|
|
|
|
nil nil nil)
|
|
|
|
|
("think"
|
|
|
|
|
"http://batsov.com/atom.xml"
|
|
|
|
|
nil nil nil)
|
|
|
|
|
("Endless Parentheses"
|
|
|
|
|
"http://endlessparentheses.com/atom.xml"
|
2016-10-24 12:36:50 +00:00
|
|
|
|
nil nil nil)
|
2016-10-24 10:19:37 +00:00
|
|
|
|
("Irreal"
|
|
|
|
|
"http://irreal.org/blog/?feed=rss2"
|
2016-10-25 06:25:29 +00:00
|
|
|
|
nil nil nil)
|
|
|
|
|
;; The followint may supersede previous entries
|
|
|
|
|
("Planet Emacs"
|
|
|
|
|
"http://planet.emacsen.org/atom.xml"
|
2016-10-24 10:19:37 +00:00
|
|
|
|
nil nil nil)))
|
2016-10-24 07:49:07 +00:00
|
|
|
|
:bind
|
|
|
|
|
(:map gpolonkai/pers-map
|
|
|
|
|
("n" . newsticker-show-news)))
|
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package cheatsheet)
|
2016-10-24 10:20:04 +00:00
|
|
|
|
|
2016-11-03 17:30:09 +00:00
|
|
|
|
(use-package nxml-mode
|
2017-04-07 16:26:15 +00:00
|
|
|
|
:ensure nil
|
2016-10-24 07:48:25 +00:00
|
|
|
|
:config
|
|
|
|
|
(setq nxml-attribute-indent 4
|
|
|
|
|
nxml-child-indent 2
|
|
|
|
|
nxml-outline-child-indent 4))
|
|
|
|
|
|
2016-10-24 07:56:15 +00:00
|
|
|
|
(use-package savehist
|
|
|
|
|
:config
|
|
|
|
|
(savehist-mode 1))
|
|
|
|
|
|
2016-10-24 09:10:19 +00:00
|
|
|
|
;; Before this can be used, make sure the Symbola font is installed:
|
|
|
|
|
;; https://zhm.github.io/symbola/
|
|
|
|
|
(defun --set-emoji-font (frame)
|
|
|
|
|
"Adjust the font setting of FRAME so Emacs can display Emoji properly."
|
2016-10-24 16:09:07 +00:00
|
|
|
|
(when (fboundp 'set-fontset-font)
|
|
|
|
|
(if (eq system-type 'darwin)
|
|
|
|
|
;; For NS/Cocoa
|
|
|
|
|
(set-fontset-font t 'symbol
|
|
|
|
|
(font-spec :family "Apple Color Emoji")
|
|
|
|
|
frame 'prepend)
|
|
|
|
|
;; For Linux
|
2016-10-25 07:53:07 +00:00
|
|
|
|
(set-fontset-font t 'symbol
|
2016-10-24 16:09:07 +00:00
|
|
|
|
(font-spec :family "Symbola")
|
|
|
|
|
frame 'prepend))))
|
2016-10-24 09:10:19 +00:00
|
|
|
|
|
|
|
|
|
(use-package company-emoji
|
|
|
|
|
:after
|
|
|
|
|
company
|
|
|
|
|
:init
|
|
|
|
|
(--set-emoji-font nil)
|
|
|
|
|
:config
|
|
|
|
|
(add-to-list 'company-backends 'company-emoji)
|
|
|
|
|
(add-hook 'after-make-frame-functions
|
|
|
|
|
'--set-emoji-font))
|
|
|
|
|
|
2016-10-26 21:24:19 +00:00
|
|
|
|
(use-package zygospore
|
|
|
|
|
:bind
|
2016-11-03 18:31:18 +00:00
|
|
|
|
(:map ctl-x-map
|
|
|
|
|
("1" . zygospore-toggle-delete-other-windows)))
|
2016-10-26 21:24:19 +00:00
|
|
|
|
|
2016-10-27 14:43:22 +00:00
|
|
|
|
(use-package webjump
|
|
|
|
|
:bind
|
|
|
|
|
(:map gpolonkai/pers-map
|
|
|
|
|
("j" . webjump)))
|
|
|
|
|
|
2016-10-27 14:48:15 +00:00
|
|
|
|
(use-package which-func
|
|
|
|
|
:config
|
|
|
|
|
(add-hook 'prog-mode-hook
|
|
|
|
|
(lambda ()
|
|
|
|
|
(which-func-mode)))
|
|
|
|
|
(setq which-func-unknown "∅"))
|
|
|
|
|
|
2016-10-28 05:12:16 +00:00
|
|
|
|
(use-package ace-popup-menu
|
|
|
|
|
:config
|
|
|
|
|
(ace-popup-menu-mode 1))
|
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package bind-key)
|
2016-10-28 05:32:55 +00:00
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package kanban)
|
2016-11-01 13:01:34 +00:00
|
|
|
|
|
2016-11-01 12:52:52 +00:00
|
|
|
|
(use-package achievements
|
|
|
|
|
:config
|
|
|
|
|
(achievements-mode 1))
|
|
|
|
|
|
2016-11-02 06:35:25 +00:00
|
|
|
|
(use-package auto-highlight-symbol
|
|
|
|
|
:config
|
|
|
|
|
(global-auto-highlight-symbol-mode t))
|
|
|
|
|
|
2017-09-18 13:27:48 +00:00
|
|
|
|
(use-package recentf
|
|
|
|
|
:ensure nil
|
|
|
|
|
:config
|
|
|
|
|
(run-at-time nil (* 5 60) 'recentf-save-list)
|
|
|
|
|
(add-to-list 'recentf-exclude (concat user-emacs-directory "elpa")))
|
|
|
|
|
|
2016-11-02 07:00:20 +00:00
|
|
|
|
(use-package auto-package-update
|
|
|
|
|
:config
|
|
|
|
|
(setq auto-package-update-interval 7
|
2016-11-25 09:18:35 +00:00
|
|
|
|
auto-package-update-delete-old-versions t)
|
|
|
|
|
;; Let’s do this in after-init-hook, as use-package invocations may modify
|
|
|
|
|
;; the list of installed packages
|
|
|
|
|
(add-hook 'after-init-hook 'auto-package-update-maybe))
|
2016-11-02 07:00:20 +00:00
|
|
|
|
|
2016-11-02 21:23:55 +00:00
|
|
|
|
(use-package cookie1
|
|
|
|
|
:demand t
|
|
|
|
|
:config
|
|
|
|
|
(setq cookie-file (concat user-emacs-directory "fortune-cookies.txt"))
|
|
|
|
|
:bind
|
|
|
|
|
(:map gpolonkai/pers-map
|
|
|
|
|
("k" . cookie)))
|
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package ace-mc)
|
2016-11-09 09:13:56 +00:00
|
|
|
|
|
2016-11-07 15:04:50 +00:00
|
|
|
|
(use-package dired-k
|
|
|
|
|
:bind
|
|
|
|
|
(:map dired-mode-map
|
|
|
|
|
("K" . dired-k)))
|
|
|
|
|
|
2016-11-07 15:17:30 +00:00
|
|
|
|
(use-package form-feed
|
|
|
|
|
:config
|
|
|
|
|
(add-hook 'emacs-lisp-mode-hook 'form-feed-mode))
|
|
|
|
|
|
2016-11-07 22:57:35 +00:00
|
|
|
|
(use-package anzu
|
|
|
|
|
:config
|
|
|
|
|
(global-anzu-mode 1))
|
|
|
|
|
|
2016-11-09 07:23:51 +00:00
|
|
|
|
(use-package auto-virtualenv
|
2016-11-15 21:05:58 +00:00
|
|
|
|
:config
|
|
|
|
|
(add-hook 'python-mode-hook 'auto-virtualenv-set-virtualenv)
|
|
|
|
|
(add-hook 'projectile-after-switch-project-hook
|
|
|
|
|
'auto-virtualenv-set-virtualenv))
|
2016-11-09 07:23:51 +00:00
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package flymake-python-pyflakes)
|
2016-11-09 07:25:21 +00:00
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package gitlab)
|
2016-11-10 08:49:26 +00:00
|
|
|
|
|
2016-11-10 10:32:35 +00:00
|
|
|
|
(use-package files
|
2017-04-07 16:26:15 +00:00
|
|
|
|
:ensure nil
|
2016-11-10 10:32:35 +00:00
|
|
|
|
:config
|
|
|
|
|
(setq backup-directory-alist
|
|
|
|
|
`((".*" . ,temporary-file-directory)))
|
|
|
|
|
(setq auto-save-file-name-transforms
|
|
|
|
|
`((".*" ,temporary-file-directory t))))
|
|
|
|
|
|
2016-11-11 08:51:27 +00:00
|
|
|
|
(use-package helm-c-yasnippet
|
|
|
|
|
:demand t
|
|
|
|
|
:config
|
|
|
|
|
(setq helm-yas-space-match-any-greedy t)
|
|
|
|
|
:bind
|
|
|
|
|
(("C-c y" . helm-yas-complete)))
|
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package helm-hunks)
|
2016-11-11 10:24:34 +00:00
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package helm-pydoc)
|
2016-11-11 11:43:35 +00:00
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package hl-todo)
|
2016-11-11 22:26:40 +00:00
|
|
|
|
|
2016-11-14 18:44:24 +00:00
|
|
|
|
(use-package glasses
|
|
|
|
|
:config
|
|
|
|
|
(add-hook 'prog-mode-hook 'glasses-mode))
|
|
|
|
|
|
2016-11-14 19:20:32 +00:00
|
|
|
|
(when (display-graphic-p)
|
|
|
|
|
(use-package eshell-fringe-status
|
|
|
|
|
:config
|
|
|
|
|
(add-hook 'eshell-mode-hook 'eshell-fringe-status-mode)))
|
|
|
|
|
|
2016-11-14 19:29:44 +00:00
|
|
|
|
(use-package eshell-prompt-extras
|
|
|
|
|
:config
|
|
|
|
|
(with-eval-after-load "esh-opt"
|
|
|
|
|
(autoload 'epe-theme-lambda "eshell-prompt-extras")
|
|
|
|
|
(setq eshell-highlight-prompt nil
|
|
|
|
|
eshell-prompt-function 'epe-theme-lambda)))
|
|
|
|
|
|
2016-11-16 22:00:30 +00:00
|
|
|
|
(use-package expand-region
|
|
|
|
|
:bind
|
2017-10-02 11:32:58 +00:00
|
|
|
|
(("C-@" . er/expand-region)))
|
2016-11-16 22:00:30 +00:00
|
|
|
|
|
2016-11-17 22:30:47 +00:00
|
|
|
|
(use-package anaconda-mode
|
|
|
|
|
:config
|
|
|
|
|
(add-hook 'python-mode-hook 'anaconda-mode)
|
|
|
|
|
(add-hook 'python-mode-hook 'anaconda-eldoc-mode))
|
|
|
|
|
|
|
|
|
|
(use-package company-anaconda
|
|
|
|
|
:after
|
|
|
|
|
company
|
|
|
|
|
:config
|
|
|
|
|
(add-to-list 'company-backends 'company-anaconda))
|
|
|
|
|
|
2016-11-18 12:26:23 +00:00
|
|
|
|
(use-package mediawiki
|
|
|
|
|
:after
|
|
|
|
|
id-manager
|
|
|
|
|
:config
|
|
|
|
|
(add-to-list 'mediawiki-site-alist
|
|
|
|
|
'("WikEmacs"
|
|
|
|
|
"http://wikemacs.org/wiki/"
|
|
|
|
|
(gpolonkai/idm-get-id-for-account "WikEmacs")
|
|
|
|
|
(gpolonkai/idm-get-password-for-account "WikEmacs"))))
|
|
|
|
|
|
2016-11-18 13:42:13 +00:00
|
|
|
|
(use-package github-notifier
|
2016-11-18 14:20:40 +00:00
|
|
|
|
:after
|
|
|
|
|
id-manager
|
2016-11-18 13:42:13 +00:00
|
|
|
|
:config
|
|
|
|
|
(setq github-notifier-token (gpolonkai/idm-get-password-for-account "GitHub"))
|
|
|
|
|
(github-notifier-mode))
|
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package gist)
|
2016-11-18 14:19:15 +00:00
|
|
|
|
|
2016-11-21 10:39:39 +00:00
|
|
|
|
(use-package company-web
|
|
|
|
|
:config
|
|
|
|
|
(require 'company-web-html))
|
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package enlive)
|
2016-11-21 10:39:39 +00:00
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package po-mode)
|
2016-11-21 15:45:53 +00:00
|
|
|
|
|
2016-11-23 07:41:59 +00:00
|
|
|
|
(use-package dashboard
|
|
|
|
|
:after
|
|
|
|
|
projectile
|
|
|
|
|
:config
|
2016-12-02 13:38:49 +00:00
|
|
|
|
(add-to-list 'dashboard-items '(projects . 5) t)
|
2016-11-23 07:41:59 +00:00
|
|
|
|
(dashboard-setup-startup-hook))
|
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package csharp-mode)
|
2016-11-30 16:35:00 +00:00
|
|
|
|
|
2016-12-02 13:41:06 +00:00
|
|
|
|
(use-package web-mode
|
|
|
|
|
:config
|
2017-10-02 11:40:33 +00:00
|
|
|
|
(setq web-mode-enable-auto-indentation nil)
|
2016-12-05 10:35:12 +00:00
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode)))
|
2016-12-02 13:41:06 +00:00
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package dockerfile-mode)
|
2017-01-11 08:10:02 +00:00
|
|
|
|
|
2017-04-18 22:31:32 +00:00
|
|
|
|
(use-package phi-search)
|
2017-01-26 08:06:29 +00:00
|
|
|
|
|
|
|
|
|
(use-package phi-search-mc
|
|
|
|
|
:config
|
|
|
|
|
(phi-search-mc/setup-keys))
|
2017-04-07 16:23:53 +00:00
|
|
|
|
|
|
|
|
|
(use-package secretaria
|
2017-04-11 22:14:20 +00:00
|
|
|
|
:after
|
|
|
|
|
alert
|
2017-04-07 16:23:53 +00:00
|
|
|
|
:config
|
|
|
|
|
;; use this for getting a reminder every 30 minutes of those tasks
|
|
|
|
|
;; scheduled for today and which have no time of day defined.
|
|
|
|
|
(add-hook 'after-init-hook
|
|
|
|
|
#'secretaria-today-unknown-time-appt-always-remind-me))
|
2017-04-11 22:15:11 +00:00
|
|
|
|
|
|
|
|
|
(when (termux-p)
|
|
|
|
|
(use-package browse-url
|
|
|
|
|
:ensure nil
|
|
|
|
|
:config
|
|
|
|
|
(advice-add 'browse-url-default-browser :override
|
|
|
|
|
(lambda (url &rest args)
|
|
|
|
|
(start-process-shell-command
|
|
|
|
|
"open-url"
|
|
|
|
|
nil
|
|
|
|
|
(concat "am start -a android.intent.action.VIEW --user 0 -d "
|
|
|
|
|
url))))))
|
2017-01-26 08:06:29 +00:00
|
|
|
|
|
2017-04-19 19:57:15 +00:00
|
|
|
|
(use-package less-css-mode)
|
|
|
|
|
|
2017-08-21 22:13:15 +00:00
|
|
|
|
(use-package feature-mode)
|
|
|
|
|
|
2017-08-07 08:44:10 +00:00
|
|
|
|
(use-package helm-bibtex
|
|
|
|
|
:after
|
|
|
|
|
org
|
|
|
|
|
:config
|
|
|
|
|
(setq bibtex-completion-bibliography (concat user-documents-directory
|
|
|
|
|
(convert-standard-filename
|
|
|
|
|
"/orgmode/references.bib"))
|
|
|
|
|
bibtex-completion-library-path (concat user-documents-directory
|
|
|
|
|
(convert-standard-filename
|
|
|
|
|
"/orgmode/bibtex-pdfs"))
|
|
|
|
|
bibtex-completion-notes-path (concat user-documents-directory
|
|
|
|
|
(convert-standard-filename
|
|
|
|
|
"/orgmode/bibliography/helm-bibtex-notes"))
|
|
|
|
|
bibtex-completion-pdf-open-function 'org-open-file))
|
|
|
|
|
|
|
|
|
|
(use-package org-ref
|
|
|
|
|
:after
|
|
|
|
|
org
|
|
|
|
|
:config
|
|
|
|
|
(setq org-ref-bibliography-notes (concat user-documents-directory
|
|
|
|
|
(convert-standard-filename
|
|
|
|
|
"/orgmode/bibliography-notes"))
|
|
|
|
|
org-ref-default-bibliography '((concat user-documents-directory
|
|
|
|
|
(convert-standard-filename
|
|
|
|
|
"/orgmode/references.bib")))
|
|
|
|
|
org-ref-pdf-directory (concat user-documents-directory
|
|
|
|
|
(convert-standard-filename
|
|
|
|
|
"/orgmode/bibtex-pdfs"))))
|
|
|
|
|
|
2017-09-22 11:48:32 +00:00
|
|
|
|
(use-package ag
|
|
|
|
|
:after projectile
|
|
|
|
|
:bind
|
|
|
|
|
(:map projectile-mode-map
|
|
|
|
|
("C-c p C-a" . ag-project)))
|
|
|
|
|
|
2017-10-02 11:33:25 +00:00
|
|
|
|
(use-package fancy-narrow
|
|
|
|
|
:config
|
|
|
|
|
(fancy-narrow-mode))
|
|
|
|
|
|
2017-10-02 11:33:39 +00:00
|
|
|
|
(use-package fillcode
|
|
|
|
|
:config
|
|
|
|
|
(add-hook 'python-mode-hook 'fillcode-mode))
|
|
|
|
|
|
2017-11-08 07:24:22 +00:00
|
|
|
|
(use-package undo-tree)
|
|
|
|
|
|
2017-08-07 08:44:10 +00:00
|
|
|
|
;; open pdf with system pdf viewer (works on mac)
|
|
|
|
|
(setq bibtex-completion-pdf-open-function
|
|
|
|
|
(lambda (fpath)
|
|
|
|
|
(start-process "open" "*open*" "open" fpath)))
|
|
|
|
|
|
|
|
|
|
;; alternative
|
|
|
|
|
;; (setq bibtex-completion-pdf-open-function 'org-open-file))
|
|
|
|
|
|
2017-01-11 08:10:21 +00:00
|
|
|
|
(add-hook 'python-mode-hook
|
|
|
|
|
(lambda ()
|
|
|
|
|
(add-to-list 'prettify-symbols-alist
|
|
|
|
|
'("not" . 172))
|
|
|
|
|
(add-to-list 'prettify-symbols-alist
|
2017-08-07 06:30:00 +00:00
|
|
|
|
'("in" . 8712))
|
|
|
|
|
(add-to-list 'prettify-symbols-alist
|
|
|
|
|
'("def" . 402))))
|
2017-01-11 08:10:21 +00:00
|
|
|
|
|
2016-09-29 08:50:50 +00:00
|
|
|
|
;; `c-mode' settings
|
|
|
|
|
(add-hook 'c-mode-common-hook
|
|
|
|
|
(lambda ()
|
|
|
|
|
(local-set-key (kbd "C-c o") 'ff-find-other-file)
|
|
|
|
|
(c-set-style "PERSONAL")
|
|
|
|
|
(setq tab-width 4
|
|
|
|
|
indent-tabs-mode nil)
|
2016-10-11 17:44:37 +00:00
|
|
|
|
(c-toggle-auto-newline 1)))
|
2016-09-29 08:50:50 +00:00
|
|
|
|
(add-hook 'c-initialization-hook
|
|
|
|
|
(lambda ()
|
|
|
|
|
(define-key c-mode-base-map (kbd "C-m") 'c-context-line-break)))
|
|
|
|
|
(defvaralias 'c-basic-offset 'tab-width)
|
|
|
|
|
(defvaralias 'cperl-indent-level 'tab-width)
|
2014-10-07 20:17:48 +00:00
|
|
|
|
(defconst my-c-style
|
|
|
|
|
'((c-tab-always-indent . t)
|
|
|
|
|
(c-comment-only-line-offset . 4)
|
|
|
|
|
(c-hanging-braces-alist . ((substatement-open after)
|
|
|
|
|
(brace-list-open)))
|
|
|
|
|
(c-hanging-colons-alist . ((member-init-intro before)
|
|
|
|
|
(inher-intro)
|
|
|
|
|
(case-label after)
|
|
|
|
|
(label after)
|
|
|
|
|
(access-label after)))
|
|
|
|
|
(c-cleanup-list . (scope-operator
|
|
|
|
|
empty-defun-braces
|
|
|
|
|
defun-close-semi))
|
|
|
|
|
(c-offsets-alist . ((arglist-close . +)
|
|
|
|
|
(arglist-intro . ++)
|
|
|
|
|
(substatement-open . 0)
|
|
|
|
|
(case-label . 4)
|
|
|
|
|
(block-open . 0)
|
2014-11-16 15:42:08 +00:00
|
|
|
|
(knr-argdecl-intro . -)
|
|
|
|
|
(comment-intro . 0)))
|
2014-10-07 20:17:48 +00:00
|
|
|
|
(c-echo-syntactic-information-p . t))
|
2017-11-29 12:45:52 +00:00
|
|
|
|
"My C Programming Style.")
|
2014-10-07 20:17:48 +00:00
|
|
|
|
(c-add-style "PERSONAL" my-c-style)
|
2016-09-29 08:50:50 +00:00
|
|
|
|
(setq c-offset-alist '((member-init-intro . ++)))
|
2016-02-16 08:12:19 +00:00
|
|
|
|
|
2016-09-29 08:50:50 +00:00
|
|
|
|
;; Custom key bindings
|
2016-10-28 05:32:55 +00:00
|
|
|
|
(bind-keys
|
|
|
|
|
:map global-map
|
|
|
|
|
("M-(" . æ-enclose-region)
|
|
|
|
|
("<C-return>" . open-line-below)
|
|
|
|
|
("<C-S-return>" . open-line-above)
|
2016-11-07 12:22:46 +00:00
|
|
|
|
("M-t" . nil) ;; Remove the old keybinding
|
|
|
|
|
("M-t c" . transpose-chars)
|
|
|
|
|
("M-t w" . transpose-words)
|
|
|
|
|
("M-t l" . transpose-lines)
|
|
|
|
|
("M-t e" . transpose-sexps)
|
|
|
|
|
("M-t s" . transpose-sentences)
|
|
|
|
|
("M-t p" . transpose-paragraphs)
|
2016-11-15 07:55:42 +00:00
|
|
|
|
("M-t W" . transpose-windows)
|
2016-11-15 07:58:45 +00:00
|
|
|
|
("C-a" . gpolonkai/move-to-beginning-of-line)
|
|
|
|
|
("C-e" . gpolonkai/move-to-end-of-line)
|
2016-11-28 04:23:11 +00:00
|
|
|
|
("M-q" . sachachua/fill-or-unfill-paragraph)
|
2017-04-04 20:07:11 +00:00
|
|
|
|
("C-c r" . round-number-at-point-to-decimals)
|
2017-04-17 21:09:51 +00:00
|
|
|
|
("C-s" . isearch-forward-regexp)
|
|
|
|
|
("C-r" . isearch-backward-regexp)
|
|
|
|
|
("C-M-s" . isearch-forward)
|
|
|
|
|
("C-M-r" . isearch-backward)
|
2016-10-28 05:32:55 +00:00
|
|
|
|
:map ctl-x-map
|
2016-11-07 12:22:03 +00:00
|
|
|
|
("C-y" . duplicate-line)
|
2016-10-28 05:32:55 +00:00
|
|
|
|
("_" . maximize-window)
|
|
|
|
|
("C-r" . rename-current-buffer-file)
|
|
|
|
|
("C-d" . delete-current-buffer-file)
|
|
|
|
|
("~" . toggle-char-case)
|
2016-11-17 12:35:33 +00:00
|
|
|
|
("|" . toggle-window-split)
|
2016-11-21 10:40:02 +00:00
|
|
|
|
("k" . gpolonkai/kill-this-buffer)
|
2016-11-25 09:29:12 +00:00
|
|
|
|
("M-c" . gpolonkai/kill-this-buffer-delete-this-window)
|
2016-11-21 10:40:02 +00:00
|
|
|
|
("M-k" . gpolonkai/undo-buffer-kill)
|
2017-08-07 06:44:14 +00:00
|
|
|
|
("C-b" . bury-buffer)
|
2016-10-28 05:32:55 +00:00
|
|
|
|
:map isearch-mode-map
|
2016-11-03 18:32:28 +00:00
|
|
|
|
("<C-return>" . isearch-exit-other-end)
|
2017-03-22 22:23:38 +00:00
|
|
|
|
("<S-return>" . isearch-exit-mark-match)
|
2016-10-28 05:32:55 +00:00
|
|
|
|
:map gpolonkai/pers-map
|
2016-11-03 18:32:28 +00:00
|
|
|
|
("m" . hidden-mode-line-mode)
|
|
|
|
|
("C-i e" . "gergely@polonkai.eu")
|
2016-11-07 12:23:17 +00:00
|
|
|
|
("C-i w" . "http://gergely.polonkai.eu/")
|
2016-11-14 23:47:14 +00:00
|
|
|
|
("C-p" . package-list-packages)
|
|
|
|
|
("o i" . gpolonkai/visit-init-file)
|
2017-11-21 09:15:41 +00:00
|
|
|
|
("o o" . gpolonkai/visit-org-index)
|
|
|
|
|
("u" . browse-url-at-point)
|
|
|
|
|
("C" . clean-buffer-list))
|
2016-10-19 15:07:41 +00:00
|
|
|
|
|
2017-04-18 09:00:05 +00:00
|
|
|
|
;; TODO: This doesn’t work with use-package and bind-key for some reason.
|
|
|
|
|
;; But why?
|
|
|
|
|
(define-key 'help-command (kbd "C-l") 'find-library)
|
|
|
|
|
(define-key 'help-command (kbd "C-f") 'find-function)
|
|
|
|
|
(define-key 'help-command (kbd "C-k") 'find-function-on-key)
|
|
|
|
|
(define-key 'help-command (kbd "C-v") 'find-variable)
|
|
|
|
|
|
2016-10-20 12:17:30 +00:00
|
|
|
|
;; Kudos goes to
|
|
|
|
|
;; http://endlessparentheses.com/leave-the-cursor-at-start-of-match-after-isearch.html
|
2016-10-19 15:07:41 +00:00
|
|
|
|
(defun isearch-exit-other-end ()
|
2017-11-29 12:45:52 +00:00
|
|
|
|
"Exit isearch, at the opposite end of the string."
|
2016-10-19 15:07:41 +00:00
|
|
|
|
(interactive)
|
|
|
|
|
|
|
|
|
|
(isearch-exit)
|
|
|
|
|
(goto-char isearch-other-end))
|
2016-09-15 15:49:29 +00:00
|
|
|
|
|
2017-03-22 22:23:38 +00:00
|
|
|
|
;; Kudos goes to http://emacs.stackexchange.com/a/31321/507
|
|
|
|
|
(defun isearch-exit-mark-match ()
|
|
|
|
|
"Exit isearch and mark the current match."
|
|
|
|
|
(interactive)
|
|
|
|
|
(isearch-exit)
|
|
|
|
|
(push-mark isearch-other-end)
|
|
|
|
|
(activate-mark))
|
|
|
|
|
|
2016-09-29 08:50:50 +00:00
|
|
|
|
;; Set up some global minor modes
|
|
|
|
|
(global-prettify-symbols-mode t)
|
|
|
|
|
|
|
|
|
|
;; Enable some functions
|
|
|
|
|
(put 'downcase-region 'disabled nil)
|
|
|
|
|
(put 'upcase-region 'disabled nil)
|
2016-11-17 07:25:17 +00:00
|
|
|
|
(put 'erase-buffer 'disabled nil)
|
2017-01-11 08:11:29 +00:00
|
|
|
|
(put 'narrow-to-region 'disabled nil)
|
2017-09-18 13:28:34 +00:00
|
|
|
|
(put 'set-goal-column 'disabled nil)
|
2016-09-29 08:50:50 +00:00
|
|
|
|
|
|
|
|
|
;; text-mode settings
|
2016-09-26 08:15:12 +00:00
|
|
|
|
(add-hook 'text-mode-hook (lambda () (visual-line-mode t)))
|
|
|
|
|
|
2016-09-29 08:50:50 +00:00
|
|
|
|
;; Add some symbols to be prettified
|
|
|
|
|
(setq prettify-symbols-alist
|
2017-08-07 06:30:00 +00:00
|
|
|
|
'(("lambda" . 955) ; λ
|
|
|
|
|
("function" . 402) ; ƒ
|
|
|
|
|
("->" . 8594) ; →
|
|
|
|
|
("=>" . 8658) ; ⇒
|
|
|
|
|
("map" . 8614) ; ↦
|
|
|
|
|
("not" . 172)) ; ¬
|
2016-11-10 10:36:48 +00:00
|
|
|
|
|
|
|
|
|
;; …and some pairs to complete
|
|
|
|
|
;; TODO: maybe add-to-list is a better way to do it
|
|
|
|
|
insert-pair-alist '(
|
|
|
|
|
(40 41) ; ()
|
|
|
|
|
(91 93) ; []
|
|
|
|
|
(123 125) ; {}
|
|
|
|
|
(60 62) ; <>
|
|
|
|
|
(34 34) ; ""
|
|
|
|
|
(39 39) ; ''
|
|
|
|
|
(96 39) ; `'
|
|
|
|
|
(8220 8221) ; “”
|
|
|
|
|
(8222 8221) ; „”
|
|
|
|
|
(8216 8217) ; ‘’
|
|
|
|
|
(8249 8250) ; ‹›
|
|
|
|
|
(8250 8249) ; ›‹
|
|
|
|
|
(171 187) ; «»
|
|
|
|
|
(187 171)) ; »«
|
|
|
|
|
|
|
|
|
|
;; Set the frame title to the current file name
|
|
|
|
|
frame-title-format '((:eval (concat system-name
|
|
|
|
|
": "
|
|
|
|
|
(if (buffer-file-name)
|
|
|
|
|
(abbreviate-file-name
|
|
|
|
|
(buffer-file-name))
|
|
|
|
|
"%b")))))
|
2017-04-04 20:08:32 +00:00
|
|
|
|
|
|
|
|
|
(defun gpolonkai/helm-ff-slash-dir-complete ()
|
2017-11-29 12:45:52 +00:00
|
|
|
|
"Make forward slash (/) do completion in helm."
|
2017-04-04 20:08:32 +00:00
|
|
|
|
(interactive)
|
|
|
|
|
(if (and (equal "Find Files" (assoc-default 'name (helm-get-current-source)))
|
|
|
|
|
(stringp (helm-get-selection))
|
|
|
|
|
(file-directory-p (helm-get-selection)))
|
|
|
|
|
(helm-execute-persistent-action)
|
|
|
|
|
(insert "/")))
|
2017-01-05 20:43:00 +00:00
|
|
|
|
|
2017-09-25 09:07:02 +00:00
|
|
|
|
;; TODO: 'cursor-color is sometimes nil, but why?
|
|
|
|
|
(setq default-cursor-color (or (frame-parameter nil 'cursor-color) "#ffd85c"))
|
2017-01-05 20:43:00 +00:00
|
|
|
|
(setq yasnippet-can-fire-cursor-color "purple")
|
|
|
|
|
|
|
|
|
|
;; It will test whether it can expand, if yes, cursor color -> purple.
|
|
|
|
|
(defun yasnippet-can-fire-p (&optional field)
|
2017-11-29 12:45:52 +00:00
|
|
|
|
"Check if the word before point can be expanded with yasnippet.
|
|
|
|
|
|
|
|
|
|
TODO: What is FIELD for?"
|
2017-01-05 20:43:00 +00:00
|
|
|
|
(interactive)
|
|
|
|
|
(setq yas--condition-cache-timestamp (current-time))
|
|
|
|
|
(let (templates-and-pos)
|
|
|
|
|
(unless (and yas-expand-only-for-last-commands
|
|
|
|
|
(not (member last-command yas-expand-only-for-last-commands)))
|
|
|
|
|
(setq templates-and-pos (if field
|
|
|
|
|
(save-restriction
|
|
|
|
|
(narrow-to-region (yas--field-start field)
|
|
|
|
|
(yas--field-end field))
|
|
|
|
|
(yas--templates-for-key-at-point))
|
|
|
|
|
(yas--templates-for-key-at-point))))
|
|
|
|
|
(and templates-and-pos (first templates-and-pos))))
|
|
|
|
|
|
|
|
|
|
;; Taken from http://pages.sachachua.com/.emacs.d/Sacha.html
|
|
|
|
|
(defun sachachua/change-cursor-color-when-can-expand (&optional field)
|
2017-11-29 12:45:52 +00:00
|
|
|
|
"Change cursor color if the text before point can be expanded with yasnippet.
|
|
|
|
|
|
|
|
|
|
TODO: What is FIELD for?"
|
2017-01-05 20:43:00 +00:00
|
|
|
|
(interactive)
|
|
|
|
|
(when (eq last-command 'self-insert-command)
|
|
|
|
|
(set-cursor-color (if (sachachua/can-expand)
|
|
|
|
|
yasnippet-can-fire-cursor-color
|
|
|
|
|
default-cursor-color))))
|
|
|
|
|
|
|
|
|
|
(defun sachachua/can-expand ()
|
|
|
|
|
"Return true if right after an expandable thing."
|
|
|
|
|
(or (abbrev--before-point) (yasnippet-can-fire-p)))
|
|
|
|
|
|
|
|
|
|
(add-hook 'post-command-hook 'sachachua/change-cursor-color-when-can-expand)
|
2017-08-07 06:44:49 +00:00
|
|
|
|
|
|
|
|
|
;; SysAdmin Day to the calendar
|
|
|
|
|
(add-to-list 'holiday-other-holidays '(holiday-float 7 5 -1 "SysAdmin Day") t)
|
2017-11-29 12:48:15 +00:00
|
|
|
|
(add-to-list 'holiday-other-holidays '(holiday-fixed 10 21 "Reptile Awareness Day") t)
|
|
|
|
|
|
|
|
|
|
;;; init.el ends here
|