2018-09-07 17:06:18 +00:00
|
|
|
;; TODO - convert to use-package
|
2018-09-11 16:28:16 +00:00
|
|
|
|
|
|
|
;; TODO - drop cp/ prefix, use contrapunctus-, set up nameless package
|
|
|
|
;; names
|
|
|
|
|
|
|
|
;; TODO - create wrapper for
|
|
|
|
;; xref-find-definitions/xref-find-definitions-other-window
|
2018-09-07 17:06:18 +00:00
|
|
|
|
2018-09-11 16:29:07 +00:00
|
|
|
;; TODO - make ag suggest my last isearch term
|
|
|
|
|
2018-09-14 07:43:07 +00:00
|
|
|
;; TODO - make a completing prompt for Info manuals instead of the
|
|
|
|
;; current approach of either opening info and searching for a manual
|
|
|
|
;; or binding calls to (info "(something)") to keys.
|
2018-09-18 11:07:52 +00:00
|
|
|
|
2018-09-15 12:37:52 +00:00
|
|
|
;; TODO - add idle timer for recentf-cleanup
|
2018-09-14 07:43:07 +00:00
|
|
|
|
2018-09-18 11:07:52 +00:00
|
|
|
;; TODO - write command to deduce actions for directory based on
|
|
|
|
;; contents. e.g. if a directory has only/mostly videos, run `vlc
|
|
|
|
;; --recursive expand <dir>', mostly images - `sxiv -for <dir>', etc.
|
|
|
|
;; With prefix arg or when confused, ask for command (with
|
|
|
|
;; completion).
|
|
|
|
|
2018-09-06 10:20:51 +00:00
|
|
|
(eval-when-compile
|
|
|
|
(add-to-list 'load-path "~/.emacs.d/elisp-git/use-package/")
|
|
|
|
(require 'use-package))
|
|
|
|
|
|
|
|
(use-package info
|
2018-09-14 07:43:07 +00:00
|
|
|
:config
|
2018-09-06 10:20:51 +00:00
|
|
|
(info-initialize)
|
|
|
|
(add-to-list 'Info-directory-list "~/.emacs.d/info/")
|
|
|
|
(add-to-list 'Info-directory-list "~/.emacs.d/elisp-git/geiser/doc/")
|
|
|
|
:bind
|
|
|
|
(("<f1> i" . nil)
|
|
|
|
("<f1> i i" . info)
|
|
|
|
("<f1> i a" . info-apropos)
|
|
|
|
("<f1> i q" . (lambda () (interactive) (info "(emacs)")))
|
|
|
|
("<f1> i w" . (lambda () (interactive) (info "(elisp)")))
|
|
|
|
("<f1> i l" . (lambda () (interactive) (info "(lilypond-notation)")))
|
|
|
|
("<f1> i r" . (lambda () (interactive) (info "(lilypond-learning)")))
|
|
|
|
("<f1> i s" . (lambda () (interactive) (info "(stumpwm)")))
|
|
|
|
("<f1> i o" . (lambda () (interactive) (info "(org)")))
|
|
|
|
("<f1> i g" . (lambda () (interactive) (info "(guile)"))))
|
|
|
|
:bind
|
|
|
|
(:map Info-mode-map
|
|
|
|
("b" . Info-history-back)
|
|
|
|
("f" . Info-history-forward)))
|
|
|
|
|
2018-09-06 10:57:04 +00:00
|
|
|
(use-package time
|
|
|
|
:config
|
|
|
|
(setq display-time-next-load-average t)
|
|
|
|
(add-to-list 'display-time-world-list '("Europe/Berlin" "Berlin")))
|
|
|
|
|
2018-09-04 06:06:48 +00:00
|
|
|
;; (toggle-debug-on-error)
|
|
|
|
|
|
|
|
(setenv "PATH" (concat "/home/anon/bin:" (getenv "PATH")))
|
|
|
|
(setenv "EDITOR" "emacsclient")
|
|
|
|
|
|
|
|
;; what on earth is this message after every init -
|
|
|
|
;; ad-handle-definition: `tramp-read-passwd' got redefined
|
|
|
|
|
2016-06-13 16:35:57 +00:00
|
|
|
;; ;; (profiler-start 'cpu)
|
|
|
|
;; (toggle-debug-on-error)
|
|
|
|
;; ;; (toggle-debug-on-quit)
|
|
|
|
|
2016-09-29 17:27:15 +00:00
|
|
|
;; from https://github.com/jorgenschaefer/Config/blob/master/emacs.el#L796-L800
|
2018-09-04 17:07:12 +00:00
|
|
|
(mapc (lambda (path)
|
|
|
|
(when (file-directory-p path)
|
|
|
|
(add-to-list 'load-path path)
|
|
|
|
(dolist (dirname (directory-files path t "^[^.]"))
|
|
|
|
(when (file-directory-p dirname)
|
|
|
|
(let ((try1 (concat dirname "/elisp"))
|
|
|
|
(try2 (concat dirname "/lisp")))
|
|
|
|
(add-to-list 'load-path
|
|
|
|
(cond ((file-exists-p try1) try1)
|
|
|
|
((file-exists-p try2) try2)
|
|
|
|
(t dirname))))))))
|
|
|
|
'("~/.emacs.d/elisp-git/"
|
|
|
|
"~/.emacs.d/contrapunctus"
|
|
|
|
"~/.emacs.d/elpa/"))
|
2016-09-29 17:27:15 +00:00
|
|
|
|
2016-06-12 07:36:15 +00:00
|
|
|
(require 'dash)
|
2018-09-04 06:06:48 +00:00
|
|
|
(require 's)
|
|
|
|
(require 'visual-fill-column)
|
2015-11-19 23:08:43 +00:00
|
|
|
;; (add-to-list 'load-path "~/.emacs.d/elisp-git/yafolding.el/")
|
2015-01-30 05:10:28 +00:00
|
|
|
|
2016-09-29 17:27:15 +00:00
|
|
|
(add-to-list 'load-path "~/.emacs.d/user/")
|
2015-11-24 17:31:04 +00:00
|
|
|
(add-to-list 'load-path "~/.emacs.d/contrapunctus/")
|
2018-09-04 06:06:48 +00:00
|
|
|
(add-to-list 'load-path "~/.emacs.d/contrapunctus/fin/")
|
2018-09-04 17:07:12 +00:00
|
|
|
(add-to-list 'load-path "~/.emacs.d/contrapunctus/ido-mini/")
|
|
|
|
(add-to-list 'load-path "~/.emacs.d/contrapunctus/timeclock-ui/")
|
2015-11-24 17:31:04 +00:00
|
|
|
|
2016-06-12 07:37:51 +00:00
|
|
|
(load "cp")
|
2015-11-26 23:31:14 +00:00
|
|
|
|
2018-09-04 06:06:48 +00:00
|
|
|
;; (if (not (server-running-p)) (server-start))
|
2016-06-12 07:36:51 +00:00
|
|
|
(server-start)
|
|
|
|
|
2017-06-08 18:54:36 +00:00
|
|
|
;; 2017-06-09T00:24:36+0530
|
|
|
|
;; my laptop's X, W, and G keys gave up the ghost
|
|
|
|
;; temporary bindings, till my laptop keyboard is fixed
|
|
|
|
(global-set-key (kbd "<f8>") 'keyboard-quit)
|
|
|
|
(global-set-key (kbd "<f9>") 'cp/eval-sexp)
|
|
|
|
(global-set-key (kbd "M-<f9>") 'dired-jump)
|
|
|
|
(global-set-key (kbd "<f10>") 'save-buffer)
|
|
|
|
(global-set-key (kbd "M-<f10>") 'find-file)
|
|
|
|
(global-set-key (kbd "<f11>") 'ido-mini)
|
|
|
|
(global-set-key (kbd "M-<f11>") 'ibuffer)
|
|
|
|
(global-set-key (kbd "<f12>") 'smex)
|
|
|
|
(global-set-key (kbd "M-<f12>") 'text-scale-adjust)
|
|
|
|
(global-set-key (kbd "C-c C-j") 'join-line)
|
|
|
|
(global-set-key (kbd "C-c C-r") (lambda () (interactive) (revert-buffer t t)))
|
|
|
|
|
2014-10-06 15:37:29 +00:00
|
|
|
;;;; UTF-8 magic
|
2016-06-12 05:31:53 +00:00
|
|
|
;; (setq locale-coding-system 'utf-8)
|
|
|
|
;; (set-terminal-coding-system 'utf-8)
|
|
|
|
;; (set-keyboard-coding-system 'utf-8)
|
|
|
|
;; (set-selection-coding-system 'utf-8)
|
|
|
|
;; (prefer-coding-system 'utf-8)
|
2014-10-06 15:37:29 +00:00
|
|
|
|
2015-06-22 09:15:28 +00:00
|
|
|
;;;; Linewrapping
|
2015-11-19 22:48:35 +00:00
|
|
|
;; (defun line-trunc-set ()
|
2016-06-12 07:37:27 +00:00
|
|
|
;; (visual-line-mode -1)
|
|
|
|
;; ;(setq-default truncate-partial-width-windows t)
|
|
|
|
;; ;(setq-default truncate-lines t))
|
|
|
|
;; (setq truncate-partial-width-windows t)
|
|
|
|
;; (setq truncate-lines t))
|
|
|
|
;; ;; (defun line-trunc-set ()
|
|
|
|
;; ;; (interactive)
|
|
|
|
;; ;; (if (or truncate-lines
|
|
|
|
;; ;; visual-line-mode)
|
|
|
|
;; ;; (progn
|
|
|
|
;; ;; (visual-line-mode -1)
|
|
|
|
;; ;; (setq truncate-lines t))
|
|
|
|
;; ;; (progn
|
|
|
|
;; ;; (visual-line-mode 1)
|
|
|
|
;; ;; (setq truncate-lines nil))))
|
|
|
|
;; ;(add-hook 'text-mode-hook 'line-trunc-set)
|
|
|
|
;; (add-hook 'emacs-lisp-mode-hook 'line-trunc-set)
|
|
|
|
;; (add-hook 'org-mode-hook 'visual-line-mode)
|
|
|
|
;; (add-hook 'erc-mode-hook 'visual-line-mode)
|
|
|
|
;; ;(global-set-key (kbd "C-x t") 'toggle-truncate-lines)
|
2016-09-29 17:13:31 +00:00
|
|
|
|
2018-09-04 06:06:48 +00:00
|
|
|
;; 2018-07-26T19:57:29+0530
|
2018-09-04 13:52:48 +00:00
|
|
|
(add-hook 'markdown-mode-hook '(lambda () (visual-fill-column-mode t)))
|
2018-09-04 06:06:48 +00:00
|
|
|
(add-hook 'text-mode-hook '(lambda () (visual-line-mode t)))
|
|
|
|
(load "cp-md")
|
|
|
|
|
|
|
|
(defun cp/turn-on-truncate-lines ()
|
|
|
|
(setq truncate-lines 1))
|
|
|
|
(defun cp/add-to-hooks (function hooks)
|
|
|
|
(-map (lambda (hook)
|
|
|
|
(add-hook hook function))
|
|
|
|
hooks))
|
|
|
|
(defun cp/remove-from-hooks (function hooks)
|
|
|
|
(-map (lambda (hook)
|
|
|
|
(remove-hook hook function))
|
|
|
|
hooks))
|
|
|
|
|
|
|
|
(cp/add-to-hooks
|
|
|
|
'cp/turn-on-truncate-lines
|
|
|
|
'(dired-mode-hook text-mode-hook prog-mode-hook diff-mode-hook message-mode-hook))
|
2016-06-12 07:37:27 +00:00
|
|
|
(global-visual-line-mode -1)
|
|
|
|
(setq truncate-partial-width-windows nil
|
|
|
|
truncate-lines t)
|
|
|
|
(add-hook 'erc-mode-hook 'visual-line-mode)
|
|
|
|
(add-hook 'comint-mode-hook 'visual-line-mode)
|
2015-01-30 21:49:15 +00:00
|
|
|
|
2018-09-04 06:06:48 +00:00
|
|
|
;; commented out on 2018-03-19T14:18:34+0530
|
|
|
|
;; (add-hook 'markdown-mode-hook 'auto-fill-mode)
|
|
|
|
;; (add-hook 'text-mode-hook 'auto-fill-mode)
|
|
|
|
|
2015-11-22 22:58:01 +00:00
|
|
|
;; (add-hook 'paredit-mode-hook 'auto-fill-mode)
|
|
|
|
|
2014-10-06 15:37:29 +00:00
|
|
|
;;;; Tab settings
|
2016-06-13 16:35:57 +00:00
|
|
|
;; (setq default-tab-width 4)
|
|
|
|
(setq tab-width 4)
|
2015-01-30 05:11:52 +00:00
|
|
|
;(define-key text-mode-map (kbd "TAB") 'self-insert-command)
|
|
|
|
(setq-default indent-tabs-mode nil)
|
2014-10-06 15:37:29 +00:00
|
|
|
;;;; Fix scrolling
|
2015-03-24 06:09:37 +00:00
|
|
|
(setq scroll-conservatively 10000
|
|
|
|
scroll-preserve-screen-position t)
|
2015-01-30 23:10:31 +00:00
|
|
|
(setq auto-window-vscroll nil)
|
2015-03-23 21:32:55 +00:00
|
|
|
;;; Recenter screen on isearch matches
|
|
|
|
(add-hook 'isearch-mode-hook 'recenter)
|
|
|
|
(add-hook 'isearch-update-post-hook 'recenter)
|
|
|
|
(defadvice isearch-repeat-forward
|
2015-11-24 21:03:33 +00:00
|
|
|
(after isearch-repeat-forward-recenter activate) (recenter))
|
2015-03-23 21:32:55 +00:00
|
|
|
(defadvice isearch-repeat-backward
|
2015-11-24 21:03:33 +00:00
|
|
|
(after isearch-repeat-backward-recenter activate) (recenter))
|
2015-03-23 21:32:55 +00:00
|
|
|
|
|
|
|
(ad-activate 'isearch-repeat-forward)
|
|
|
|
(ad-activate 'isearch-repeat-backward)
|
|
|
|
|
2015-06-22 09:27:50 +00:00
|
|
|
(global-set-key (kbd "C-s") 'isearch-forward-regexp)
|
|
|
|
(global-set-key (kbd "C-r") 'isearch-backward-regexp)
|
|
|
|
|
2015-03-23 21:32:55 +00:00
|
|
|
;;;; While we're at it, let's add that to next-error as well
|
|
|
|
;;;; (this affects jumping to match from M-x grep , too)
|
|
|
|
(add-hook 'next-error-hook 'recenter)
|
|
|
|
|
|
|
|
;;;; ...and to magit-toggle-section
|
|
|
|
;;; It'd be really cool to (recenter 3) when you /open/ a section,
|
|
|
|
;;; and (recenter) when you close a section
|
2015-10-12 10:41:21 +00:00
|
|
|
(defadvice magit-section-toggle
|
2015-11-24 21:03:33 +00:00
|
|
|
(after magit-section-toggle-recenter activate) (recenter 3))
|
2015-10-12 10:41:21 +00:00
|
|
|
(ad-activate 'magit-section-toggle)
|
2015-03-23 21:32:55 +00:00
|
|
|
(defadvice magit-unstage-item
|
2015-11-24 21:03:33 +00:00
|
|
|
(after magit-unstage-item-move) (next-line))
|
2015-03-23 21:32:55 +00:00
|
|
|
(ad-activate 'magit-unstage-item)
|
2015-06-22 09:37:06 +00:00
|
|
|
(defadvice magit-goto-next-section
|
2015-11-24 21:03:33 +00:00
|
|
|
(after magit-next-section-recenter activate) (recenter 3))
|
2015-06-22 09:37:06 +00:00
|
|
|
(ad-activate 'magit-goto-next-section)
|
|
|
|
(defadvice magit-goto-previous-section
|
2015-11-24 21:03:33 +00:00
|
|
|
(after magit-previous-section-recenter activate) (recenter 3))
|
2015-06-22 09:37:06 +00:00
|
|
|
(ad-activate 'magit-goto-previous-section)
|
2015-03-23 21:32:55 +00:00
|
|
|
|
2016-06-12 05:29:44 +00:00
|
|
|
(defun cp-insert-timestamp ()
|
|
|
|
(interactive)
|
|
|
|
(insert (format-time-string "%FT%T%z")))
|
|
|
|
|
2018-09-11 16:29:07 +00:00
|
|
|
(use-package ag
|
|
|
|
:bind ("<f2> p" . ag)
|
|
|
|
:config (setq ag-highlight-search t))
|
2018-09-04 06:06:48 +00:00
|
|
|
|
|
|
|
(require 'fin)
|
|
|
|
(defun cp/eval-sexp (arg)
|
|
|
|
"In emacs-lisp-mode, just run eval-defun.
|
|
|
|
|
|
|
|
In other modes - jump to first Lisp expression in current line
|
|
|
|
and eval it."
|
|
|
|
(interactive "P")
|
|
|
|
(save-excursion
|
|
|
|
(cond ((or
|
|
|
|
(equal major-mode 'emacs-lisp-mode)
|
|
|
|
(equal major-mode 'lisp-interaction-mode))
|
|
|
|
(eval-defun arg))
|
|
|
|
((re-search-line "(")
|
|
|
|
(progn
|
|
|
|
(forward-char -1)
|
|
|
|
(forward-sexp)
|
|
|
|
(eval-last-sexp arg)))
|
|
|
|
(t nil))))
|
2016-10-19 11:38:52 +00:00
|
|
|
|
2018-09-07 10:25:47 +00:00
|
|
|
(use-package nameless
|
|
|
|
:commands nameless-mode
|
2018-09-08 05:37:55 +00:00
|
|
|
:init
|
|
|
|
(add-hook 'emacs-lisp-mode-hook 'nameless-mode)
|
|
|
|
(add-hook 'ert-results-mode-hook 'nameless-mode)
|
2018-09-07 10:25:47 +00:00
|
|
|
:bind (:map emacs-lisp-mode-map
|
|
|
|
("C-c C-n" . nameless-mode)))
|
|
|
|
|
2015-11-26 23:31:14 +00:00
|
|
|
(cp-set-keys
|
|
|
|
:bindings
|
2018-09-18 11:07:52 +00:00
|
|
|
`((,(kbd "<f1> M") woman)
|
|
|
|
(,(kbd "M-<f2>") compile)
|
2018-09-11 16:28:16 +00:00
|
|
|
;; (,(kbd "<f2> <f2>") imenu)
|
|
|
|
(,(kbd "<f2> <f2>") xref-find-definitions)
|
|
|
|
(,(kbd "<f2> r") xref-find-references)
|
2016-10-19 11:38:52 +00:00
|
|
|
;; (,(kbd "<f2> p") grep)
|
2018-09-18 11:07:52 +00:00
|
|
|
(,(kbd "<f2> p") ag-regexp)
|
|
|
|
(,(kbd "<f2> o") find-grep)
|
|
|
|
(,(kbd "<f2> i") find-dired)
|
|
|
|
(,(kbd "<f2> h") proced)
|
|
|
|
(,(kbd "M-<f3>") run-chicken)
|
|
|
|
(,(kbd "M-<f4>") run-lisp)
|
2015-11-25 22:58:19 +00:00
|
|
|
|
2015-11-25 07:53:31 +00:00
|
|
|
(,(kbd "<f5> <f5>") eval-buffer)
|
|
|
|
(,(kbd "M-<f5>") ielm)
|
|
|
|
(,(kbd "<f5> i") cp-open-init)
|
|
|
|
(,(kbd "<f5> p") list-packages)
|
|
|
|
(,(kbd "<f5> v") visual-line-mode)
|
|
|
|
(,(kbd "<f5> f") cp-fcf-literally)
|
2018-09-04 06:06:48 +00:00
|
|
|
(,(kbd "<f5> f") fundamental-mode)
|
|
|
|
(,(kbd "<f5> t") text-mode)
|
2015-11-25 07:53:31 +00:00
|
|
|
(,(kbd "<f5> c") calendar)
|
2016-06-12 05:29:44 +00:00
|
|
|
;; (,(kbd "s-k") cp-kill-buffer)
|
|
|
|
(,(kbd "s-k") bury-buffer)
|
|
|
|
(,(kbd "C-x k") cp-kill-buffer)
|
2018-09-17 12:17:00 +00:00
|
|
|
(,(kbd "C-`") shell)
|
2018-09-10 07:34:16 +00:00
|
|
|
(,(kbd "<f5> T") cp-insert-timestamp)
|
|
|
|
(,(kbd "<f1> l") find-library)))
|
2015-11-25 22:58:19 +00:00
|
|
|
|
2016-06-12 05:13:56 +00:00
|
|
|
(load "cp-mouse")
|
|
|
|
|
2016-06-13 16:01:08 +00:00
|
|
|
(with-eval-after-load 'help-mode
|
|
|
|
(cp-set-keys
|
|
|
|
:keymap help-mode-map
|
|
|
|
:bindings
|
|
|
|
`((,(kbd "b") help-go-back)
|
|
|
|
(,(kbd "f") help-go-forward))))
|
2015-11-30 18:09:11 +00:00
|
|
|
|
2015-11-25 22:58:19 +00:00
|
|
|
(setq eshell-history-size nil)
|
2015-06-24 10:23:11 +00:00
|
|
|
|
2015-11-25 22:58:19 +00:00
|
|
|
;; More convenient Unicode keys
|
2015-06-24 10:23:11 +00:00
|
|
|
(global-unset-key (kbd "M-["))
|
2015-11-26 23:31:14 +00:00
|
|
|
(cp-set-keys
|
|
|
|
:bindings
|
2018-09-18 11:51:54 +00:00
|
|
|
`((,(kbd "C-' r") ,(kbd "₹"))
|
|
|
|
(,(kbd "C-' C-r") ,(kbd "₹"))
|
|
|
|
(,(kbd "C-' e") ,(kbd "€"))
|
|
|
|
(,(kbd "C-' b") ,(kbd "←"))
|
|
|
|
(,(kbd "C-' f") ,(kbd "→"))
|
|
|
|
(,(kbd "C-' p") ,(kbd "↑"))
|
|
|
|
(,(kbd "C-' n") ,(kbd "↓"))
|
|
|
|
(,(kbd "C-' l") ,(kbd "λ"))
|
|
|
|
(,(kbd "C-' F") ,(kbd "ƒ"))))
|
2015-06-22 09:10:02 +00:00
|
|
|
|
2018-09-04 06:06:48 +00:00
|
|
|
(setq default-input-method "devanagari-itrans")
|
2016-06-12 07:35:38 +00:00
|
|
|
|
2015-03-24 06:06:58 +00:00
|
|
|
(setq backup-by-copying t
|
2018-09-04 06:06:48 +00:00
|
|
|
backup-directory-alist '(("." . "~/.emacs.d/saves/"))
|
2016-06-13 16:35:57 +00:00
|
|
|
delete-old-versions t
|
2018-09-04 06:06:48 +00:00
|
|
|
kept-new-versions 2
|
2016-06-13 16:35:57 +00:00
|
|
|
kept-old-versions 2
|
|
|
|
version-control t)
|
2015-01-30 23:10:11 +00:00
|
|
|
|
2015-03-23 22:08:10 +00:00
|
|
|
(setq browse-url-browser-function 'browse-url-xdg-open)
|
|
|
|
|
2018-09-07 10:25:36 +00:00
|
|
|
(require 'package)
|
|
|
|
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
|
|
|
|
(not (gnutls-available-p))))
|
|
|
|
(proto (if no-ssl "http" "https")))
|
|
|
|
;; 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 '("gnu" . (concat proto "://elpa.gnu.org/packages/")))))
|
2014-09-29 18:37:30 +00:00
|
|
|
(package-initialize)
|
2014-10-06 15:37:29 +00:00
|
|
|
|
2018-09-10 10:07:43 +00:00
|
|
|
(use-package company
|
|
|
|
:diminish company-mode
|
|
|
|
:commands global-company-mode
|
|
|
|
:init (global-company-mode))
|
|
|
|
|
|
|
|
(use-package company-emoji
|
|
|
|
:if (featurep 'company)
|
|
|
|
:config (add-to-list 'company-backends 'company-emoji))
|
|
|
|
|
2018-09-14 07:43:07 +00:00
|
|
|
(use-package emr
|
|
|
|
:bind (:map prog-mode-map
|
|
|
|
("M-S-<return>" . emr-show-refactor-menu)))
|
|
|
|
|
2018-09-13 18:14:13 +00:00
|
|
|
(use-package flx-isearch
|
2018-09-16 18:15:46 +00:00
|
|
|
:disabled
|
2018-09-13 18:14:13 +00:00
|
|
|
:init (setq gc-cons-threshold 40000000)
|
|
|
|
:bind ("C-s" . #'flx-isearch-forward)
|
|
|
|
("C-r" . #'flx-isearch-backward))
|
|
|
|
|
|
|
|
(use-package flx-ido
|
2018-09-16 18:15:46 +00:00
|
|
|
:disabled
|
2018-09-13 18:14:13 +00:00
|
|
|
:init (flx-ido-mode 1)
|
|
|
|
(setq ido-enable-flex-matching t)
|
|
|
|
(setq ido-use-faces nil))
|
|
|
|
|
2018-09-14 07:43:07 +00:00
|
|
|
(use-package paradox
|
|
|
|
:config (setq paradox-execute-asynchronously t))
|
|
|
|
|
2016-06-13 16:12:48 +00:00
|
|
|
;; (load "cp-adb")
|
2015-11-25 23:33:55 +00:00
|
|
|
(load "cp-editing")
|
2015-11-24 21:05:41 +00:00
|
|
|
;; (load "cp-evil")
|
2018-09-07 05:42:08 +00:00
|
|
|
(load "cp-god")
|
2015-11-25 23:30:47 +00:00
|
|
|
(load "cp-fm")
|
|
|
|
(load "cp-lily")
|
2016-06-12 05:13:56 +00:00
|
|
|
(load "cp-sfz")
|
2015-11-25 23:30:47 +00:00
|
|
|
(load "cp-lisp")
|
|
|
|
(load "cp-nav")
|
|
|
|
(load "cp-ui")
|
2015-06-22 09:15:28 +00:00
|
|
|
|
2016-06-13 16:35:57 +00:00
|
|
|
;; (ispell-change-dictionary "en")
|
|
|
|
(setq ispell-dictionary "en")
|
2016-06-12 07:35:38 +00:00
|
|
|
|
2018-09-08 17:13:34 +00:00
|
|
|
(use-package undo-tree
|
|
|
|
:if (not (featurep 'evil))
|
|
|
|
:diminish undo-tree-mode
|
|
|
|
:init (global-undo-tree-mode))
|
2015-03-23 21:35:14 +00:00
|
|
|
|
2016-09-29 17:08:13 +00:00
|
|
|
(with-eval-after-load 'text-mode
|
|
|
|
(define-key text-mode-map (kbd "M-p") 'org-drag-line-backward)
|
|
|
|
(define-key text-mode-map (kbd "M-n") 'org-drag-line-forward))
|
|
|
|
|
2017-05-30 15:17:17 +00:00
|
|
|
(load "cp-org")
|
2017-05-30 15:26:51 +00:00
|
|
|
(autoload 'byte-recompile-file "bytecomp" "byte-recompile-file" t)
|
2017-12-29 07:51:57 +00:00
|
|
|
;; (2017-12-29T13:21:57+0530
|
|
|
|
;; TODO - watch Org and MD files and recompile it if they are newer
|
|
|
|
;; than their associated HTML files (e.g. I edited the source on a
|
|
|
|
;; phone and synced it back to the laptop)
|
|
|
|
;; see (info "(elisp) File Notifications")
|
|
|
|
;; and (describe-function 'file-newer-than-file-p)
|
|
|
|
;; )
|
2017-05-30 15:26:51 +00:00
|
|
|
(defun cp/after-save ()
|
|
|
|
(case major-mode
|
|
|
|
('org-mode (org-html-export-to-html))
|
|
|
|
('LilyPond-mode (let ((project-dir (locate-dominating-file (buffer-file-name) "main.ly")))
|
|
|
|
(when project-dir
|
|
|
|
(cd project-dir))
|
|
|
|
(compile (car compile-history))))
|
2017-10-15 11:39:03 +00:00
|
|
|
('latex-mode (if (file-exists-p "Makefile")
|
|
|
|
(compile "make -k")
|
|
|
|
(compile (concat "xelatex \"" (buffer-file-name)
|
2017-12-27 06:38:40 +00:00
|
|
|
"\""))))
|
|
|
|
('markdown-mode (markdown-export))))
|
2017-05-30 15:26:51 +00:00
|
|
|
(add-hook 'after-save-hook 'cp/after-save)
|
2016-06-12 07:38:38 +00:00
|
|
|
|
2015-03-23 21:58:12 +00:00
|
|
|
(require 'ace-jump-mode)
|
|
|
|
;(define-key global-map (kbd "C-c SPC") 'ace-jump-mode)
|
2017-12-27 06:38:40 +00:00
|
|
|
(global-set-key (kbd "S-SPC") 'ace-jump-mode)
|
2014-10-06 15:37:29 +00:00
|
|
|
|
2016-09-29 17:30:42 +00:00
|
|
|
;; (load "cp-helm")
|
2017-10-14 09:52:56 +00:00
|
|
|
(load "cp-hindi")
|
2015-11-24 21:12:10 +00:00
|
|
|
(load "cp-irc")
|
2015-11-25 23:33:55 +00:00
|
|
|
(load "cp-parens")
|
2017-10-14 09:52:56 +00:00
|
|
|
(load "cp-playlist")
|
2015-06-22 09:15:28 +00:00
|
|
|
|
2016-06-12 07:36:15 +00:00
|
|
|
(require 'keyfreq)
|
|
|
|
(keyfreq-mode 1)
|
|
|
|
(keyfreq-autosave-mode 1)
|
2017-08-18 14:09:21 +00:00
|
|
|
;; ;; disabled on 2017-08-18T19:39:21+0530, no longer interested
|
|
|
|
;; (open-dribble-file (concat "~/.emacs.d/keylogs/"
|
|
|
|
;; (format-time-string "%Y%m%d-%H%M%S")
|
|
|
|
;; ".txt"))
|
2016-06-12 07:36:15 +00:00
|
|
|
|
2017-10-14 09:52:56 +00:00
|
|
|
;; 2017-10-14T15:22:56+0530 - I suspect devanagari-itrans tires the
|
|
|
|
;; left hand faster than the right - let's find out!
|
|
|
|
(add-hook
|
|
|
|
'input-method-activate-hook
|
|
|
|
(lambda ()
|
|
|
|
(open-dribble-file
|
|
|
|
(concat
|
|
|
|
"~/.emacs.d/keylogs/"
|
|
|
|
(format-time-string "%Y%m%d-%H%M%S")
|
|
|
|
"-"
|
|
|
|
current-input-method
|
|
|
|
".txt"))))
|
|
|
|
(add-hook
|
|
|
|
'input-method-deactivate-hook
|
|
|
|
(lambda () (open-dribble-file nil)))
|
|
|
|
;; (add-hook
|
|
|
|
;; 'kill-emacs-hook
|
|
|
|
;; (lambda () (shell-command (concat "cat ~/.emacs.d/keylogs/"
|
|
|
|
;; (format-time-string "%Y%m%d*")
|
|
|
|
;; " && ls"))))
|
|
|
|
|
2016-06-13 16:20:41 +00:00
|
|
|
(autoload 'magit-status "magit" "magit" t)
|
2015-06-24 10:12:23 +00:00
|
|
|
(global-set-key (kbd "<f5> m") 'magit-status)
|
2016-06-13 16:20:41 +00:00
|
|
|
(with-eval-after-load 'magit
|
|
|
|
(define-key magit-mode-map (kbd "C-n") 'next-line)
|
2018-09-04 06:06:48 +00:00
|
|
|
(define-key magit-mode-map (kbd "C-p") 'previous-line)
|
|
|
|
;; (setq magit-git-output-coding-system 'utf-8
|
|
|
|
;; magit-git-global-arguments (append magit-git-global-arguments '("-c" "i18n.logOutputEncoding=utf-8")))
|
|
|
|
)
|
2015-03-23 22:56:08 +00:00
|
|
|
|
2016-06-13 16:28:33 +00:00
|
|
|
(setq recentf-auto-cleanup 'never)
|
2014-09-29 18:37:30 +00:00
|
|
|
(require 'recentf)
|
|
|
|
(recentf-mode 1)
|
2015-11-26 23:33:25 +00:00
|
|
|
(setq recentf-max-menu-items 500
|
2016-06-13 16:28:33 +00:00
|
|
|
recentf-max-saved-items 1000
|
2018-09-04 06:06:48 +00:00
|
|
|
recentf-save-file "/home/anon/.emacs.d/recentf"
|
|
|
|
recentf-exclude '("\.html\\(\.orig\\)?$" "\.jpe?g$" "\.png$" "\.mp4$" "\.etc" "\.umstuff"))
|
2016-06-13 16:28:33 +00:00
|
|
|
(add-hook 'kill-emacs-hook 'recentf-cleanup)
|
2015-06-22 09:29:04 +00:00
|
|
|
(global-set-key (kbd "C-x C-r C-o") 'recentf-open-files)
|
2014-10-06 15:37:29 +00:00
|
|
|
|
2018-09-04 06:06:48 +00:00
|
|
|
(load "cp-ido")
|
|
|
|
(load "cp-desktop")
|
2018-09-04 15:47:03 +00:00
|
|
|
(require 'timeclock-list)
|
|
|
|
(require 'timeclock-report)
|
2018-09-04 06:06:48 +00:00
|
|
|
(add-hook 'kill-emacs-query-functions 'timeclock-query-out)
|
2014-10-06 15:37:29 +00:00
|
|
|
|
2016-06-13 16:30:55 +00:00
|
|
|
(with-eval-after-load 'stumpwm-mode
|
|
|
|
(setq stumpwm-shell-program
|
|
|
|
"~/git/stumpwm-contrib/util/stumpish/stumpish"))
|
|
|
|
(autoload 'stumpwm-mode "stumpwm-mode" "stumpwm-mode" t)
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.stumpwmrc$" . stumpwm-mode))
|
2015-06-26 07:16:14 +00:00
|
|
|
;; I'd love to know how to automatically set some modes for some
|
|
|
|
;; specific files (i.e. by name of file). Start stumpwm-mode when I
|
|
|
|
;; open ~/.stumpwmrc, disable visual lines and enable truncate lines
|
|
|
|
;; for some files, etc...
|
2015-03-23 22:08:10 +00:00
|
|
|
|
2015-03-24 06:09:37 +00:00
|
|
|
;;;; text size change
|
2018-09-04 06:06:48 +00:00
|
|
|
;; nicked from wasamasa's init - https://github.com/wasamasa/dotemacs/blob/934d0b37692d62fe9af56b52accac5bcd4445ae3/init.org
|
|
|
|
(setq default-frame-alist '((font . "DejaVu Sans Mono-10.5")))
|
|
|
|
(defun my-fix-emojis (&optional frame)
|
|
|
|
(set-fontset-font "fontset-default" nil "Symbola" frame 'append))
|
|
|
|
(my-fix-emojis)
|
|
|
|
(add-hook 'after-make-frame-functions 'my-fix-emojis)
|
|
|
|
;; (set-face-attribute 'default nil :font "-outline-Bitstream Vera Sans Mono-normal-normal-normal-mono-12-*-*-*-c-*-iso8859-1")
|
2014-10-07 05:23:28 +00:00
|
|
|
|
2015-11-19 22:46:32 +00:00
|
|
|
(require 'wgrep)
|
|
|
|
|
2015-11-19 23:08:43 +00:00
|
|
|
;; (require 'yafolding)
|
|
|
|
;; (add-hook 'prog-mode-hook
|
|
|
|
;; (lambda () (yafolding-mode)))
|
2015-01-30 23:01:07 +00:00
|
|
|
|
2018-09-06 07:34:07 +00:00
|
|
|
(setq custom-file "~/.emacs.d/custom.el")
|
|
|
|
(load custom-file)
|
2015-03-23 23:02:16 +00:00
|
|
|
|
|
|
|
(put 'downcase-region 'disabled nil)
|
2015-06-22 09:57:30 +00:00
|
|
|
(put 'upcase-region 'disabled nil)
|
|
|
|
(put 'set-goal-column 'disabled nil)
|
2016-06-13 16:35:57 +00:00
|
|
|
|
|
|
|
;; (toggle-debug-on-quit)
|
|
|
|
;; (profiler-stop)
|
|
|
|
;; (emacs-init-time)
|
|
|
|
;; (profiler-report)
|
2018-09-04 06:06:48 +00:00
|
|
|
(put 'scroll-left 'disabled nil)
|
2018-08-31 21:07:50 +00:00
|
|
|
(put 'erc-remove-text-properties-region 'disabled nil)
|