You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
528 lines
17 KiB
528 lines
17 KiB
(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. |
|
'(TeX-complete-word (quote dabbrev-expand-helper)) |
|
'(TeX-fold-preserve-comments t) |
|
'(TeX-fold-type-list (quote (env))) |
|
'(TeX-newline-function (quote reindent-then-newline-and-indent)) |
|
'(auto-save-file-name-transforms (quote ((".*" "~/.emacs.d/autosaves/\\1" t)))) |
|
'(backup-directory-alist (quote ((".*" . "~/.emacs.d/backup/")))) |
|
'(bibretrieve-backends (quote (("msn" . 9) ("mrl" . 8) ("arxiv" . 5)))) |
|
'(bsn-backends (quote (msn))) |
|
'(case-fold-search t) |
|
'(compilation-auto-jump-to-first-error t) |
|
'(compilation-skip-threshold 2) |
|
'(current-language-environment "English") |
|
'(custom-safe-themes |
|
(quote |
|
("8db4b03b9ae654d4a57804286eb3e332725c84d7cdab38463cb6b97d5762ad26" default))) |
|
'(default-input-method "rfc1345") |
|
'(delete-active-region nil) |
|
'(delete-selection-mode nil) |
|
'(flyspell-duplicate-distance -1) |
|
'(flyspell-mark-duplications-flag t) |
|
'(font-latex-fontify-sectioning (quote color)) |
|
'(frame-background-mode (quote dark)) |
|
'(global-font-lock-mode t nil (font-lock)) |
|
'(helm-su-or-sudo "su") |
|
'(hl-sexp-background-colors (quote ("#395959"))) |
|
'(ibuffer-use-other-window t) |
|
'(magit-save-repository-buffers (quote dontask)) |
|
'(org-agenda-files (quote ("~/org/notes.org" "~/org/orgzly/work.org"))) |
|
'(org-agenda-show-inherited-tags (quote always)) |
|
'(org-catch-invisible-edits (quote smart)) |
|
'(org-clock-mode-line-total (quote current)) |
|
'(org-icalendar-categories (quote (all-tags category))) |
|
'(org-icalendar-include-todo t) |
|
'(org-indent-mode-turns-on-hiding-stars nil) |
|
'(org-mobile-files |
|
(quote |
|
(org-agenda-files "/home/jacopods/org/spesa.org" "/home/jacopods/org/notes.org" "/home/jacopods/dropbox.utoronto/orgzly/work.org"))) |
|
'(org-pomodoro-long-break-sound "/home/jacopods/tick.wav") |
|
'(org-pomodoro-play-sounds nil) |
|
'(org-pomodoro-play-ticking-sounds t) |
|
'(org-pomodoro-short-break-sound "/home/jacopods/tick.wav") |
|
'(org-pomodoro-ticking-sound "/home/jacopods/tick.wav") |
|
'(org-refile-targets (quote ((org-agenda-files :level . 1)))) |
|
'(parens-require-spaces nil) |
|
'(safe-local-variable-values |
|
(quote |
|
((eval add-hook |
|
(quote before-save-hook) |
|
(quote org-icalendar-export-to-ics) |
|
nil t) |
|
(eval add-hook |
|
(quote before-save-hook) |
|
(quote org-export-icalendar-this-file) |
|
nil t) |
|
(TeX-master . notes\.tex) |
|
(bookmark-default-file . "./emacs.bmk")))) |
|
'(smart-tab-completion-functions-alist |
|
(quote |
|
((emacs-lisp-mode . lisp-complete-symbol) |
|
(text-mode . dabbrev-completion) |
|
(latex-mode . TeX-complete-symbol)))) |
|
'(truncate-partial-width-windows nil) |
|
'(visible-mark-inhibit-trailing-overlay t)) |
|
|
|
(custom-set-faces |
|
;; custom-set-faces was added by Custom. |
|
;; If you edit it by hand, you could mess it up, so be careful. |
|
;; Your init file should contain only one such instance. |
|
;; If there is more than one, they won't work right. |
|
'(bold ((t (:weight normal)))) |
|
'(fixed-pitch ((t (:family "Bitstream Vera Sans Mono")))) |
|
'(font-latex-math-face ((t (:foreground "cornsilk3")))) |
|
'(helm-source-header ((t (:inherit helm-header :background "#22083397778B" :foreground "white" :weight bold)))) |
|
'(highlight ((t (:background "Darkslategray")))) |
|
'(hl-line ((t (:background "#303030")))) |
|
'(hl-sexp-face ((t (:underline t))) t) |
|
'(italic ((((supports :underline t)) nil))) |
|
'(linum-highlight-face ((t (:inherit (hl-line default))))) |
|
'(menu ((t (:inverse-video t)))) |
|
'(mode-line ((t (:background "grey25" :foreground "grey80" :weight normal)))) |
|
'(mode-line-inactive ((t (:inherit mode-line :background "grey10" :foreground "grey50" :weight normal)))) |
|
'(mouse ((t (:background "orchid")))) |
|
'(org-pomodoro-mode-line ((t (:foreground "tomato3")))) |
|
'(paren-face-match ((t (:background "turquoise" :foreground "black")))) |
|
'(region ((t (:inherit highlight)))) |
|
'(shadow ((t (:foreground "grey60")))) |
|
'(tooltip ((t (:inherit default :background "lightyellow" :foreground "black" :foundry "xos4" :family "terminus")))) |
|
'(variable-pitch ((t (:family "default")))) |
|
'(visible-mark-face ((t (:background "goldenrod" :foreground "#182828"))))) |
|
|
|
;; This kinda overrides the customize business, but it works |
|
;; * Use patched terminus :fixme: |
|
(set-face-font 'default "-xos4-hackminus-medium-r-normal--20-200-72-72-c-100-ISO10646-1") |
|
(mapc |
|
(lambda (face) |
|
(set-face-attribute face nil :weight 'normal)) |
|
(face-list)) |
|
|
|
(add-to-list 'custom-theme-load-path "/home/jacopods/clones/emacs-color-theme-solarized") |
|
(load-theme 'solarized t) |
|
|
|
(setq-default display-buffer-reuse-frames t) |
|
(add-hook 'before-save-hook 'delete-trailing-whitespace) |
|
(setq c-basic-offset 4) |
|
(setq indent-tabs-mode nil) |
|
(setq show-paren-mode t) |
|
|
|
|
|
(setq-default abbrev-mode t) |
|
(read-abbrev-file "~/.abbrev_defs") |
|
(setq save-abbrevs t) |
|
|
|
;; fix compilation window eating up my work window |
|
(setq compilation-scroll-output t |
|
compilation-window-height 12) |
|
|
|
(tool-bar-mode 0) |
|
(scroll-bar-mode -1) |
|
(setq-default show-trailing-whitespace t) |
|
(setq search-whitespace-regexp "[ \t\r\n]+") |
|
(setq flyspell-use-meta-tab nil) |
|
|
|
(setq redisplay-dont-pause t |
|
scroll-margin 3 |
|
scroll-step 1 |
|
scroll-conservatively 10000 |
|
scroll-preserve-screen-position 1) |
|
|
|
;; add .emacs.d and subdirs to load path |
|
;; (add-to-list 'load-path "~/.emacs.d") |
|
(let ((default-directory "~/.emacs.d/")) |
|
(normal-top-level-add-subdirs-to-load-path) |
|
(normal-top-level-add-to-load-path '("fringe-helper.el" "multiple-cursors.el" "dash.el"))) |
|
|
|
(require 'mic-paren) ; loading |
|
(paren-activate) ; activating |
|
|
|
(setq mouse-autoselect-window nil) |
|
(mouse-wheel-mode t) |
|
|
|
(defvar outline-minor-mode-prefix "\M-#") |
|
|
|
;; * include other files |
|
(load "init-latex.el") |
|
(load "init-org.el") |
|
(load "init-c++.el") |
|
(load "init-elisp.el") |
|
(load "init-kde-integration.el") |
|
|
|
;; KDE stuff |
|
|
|
(add-to-list 'load-path "~/kde-emacs") |
|
(load "qml-mode.el" nil t t) |
|
(add-to-list 'auto-mode-alist '("\\.qml\\'" . qml-mode)) |
|
(require 'kde-emacs) |
|
;;(setq kde-full-name "Jacopo De Simoi") |
|
;;(setq kde-email "wilderkde@gmail.com") |
|
|
|
(setq inhibit-startup-screen t) |
|
(setq inhibit-startup-message t) |
|
|
|
(setq frame-title-format |
|
'((buffer-file-name "%f" |
|
(dired-directory dired-directory "%b")) " · emacs"));; · " (:eval (kde-current-activity-name)))) ;; "%S")) |
|
|
|
;; Put autosave files (ie #foo#) and backup files (ie foo~) in ~/.emacs.d/. |
|
;; create the autosave dir if necessary, since emacs won't. |
|
(make-directory "~/.emacs.d/autosaves/" t) |
|
(make-directory "~/.emacs.d/backup/" t) |
|
|
|
(add-hook 'text-mode-hook 'flyspell-mode) |
|
|
|
(require 'linum) |
|
(global-linum-mode 1) |
|
;; check if it works to enable it globally |
|
;; (add-hook 'text-mode-hook 'linum-mode) |
|
;; (add-hook 'qml-mode-hook 'linum-mode) |
|
;; (add-hook 'lua-mode-hook 'linum-mode) |
|
|
|
;; (require 'sourcepair) |
|
;; (global-set-key (kbd "<f6>") 'sourcepair-load) |
|
|
|
;;(global-set-key (kbd "C-M-<backspace>") 'backward-kill-sexp) |
|
|
|
(global-set-key (kbd "C-x k") 'kill-this-buffer) ;;why not? |
|
|
|
(setq default-fill-column 110) |
|
(add-to-list 'load-path "~/tmp") |
|
|
|
(setq mouse-yank-at-point t) |
|
(blink-cursor-mode 0) |
|
(global-hl-line-mode t) |
|
(setq focus-follows-mouse nil) |
|
|
|
(require 'pomodoro) |
|
|
|
(defun select-frame-on-current-activity () |
|
(select-frame-on-activity (kde-current-activity)) |
|
) |
|
|
|
;; Rehab ↓ |
|
;; mark the date 30/1/2014 |
|
;; (require 'no-easy-keys) |
|
;; (no-easy-keys 1) |
|
;; conflicts a bit with org-mode |
|
|
|
;; Keyboard is faster than mouse |
|
;; Rehab ↑ |
|
|
|
;;Remove insanely irritating key-binding |
|
(global-unset-key (kbd "C-z")) |
|
(global-unset-key (kbd "C-x f")) |
|
(global-unset-key (kbd "<M-f4>")) ; rly? |
|
|
|
;; (global-unset-key (kbd "<backspace>")) ;give this a try |
|
;; (global-unset-key (kbd "DEL")) ;give this a try |
|
;; (global-unset-key (kbd "C-<backspace>")) ;give this a try |
|
|
|
;; Change some global bindings: |
|
(global-unset-key (kbd "C-M-u")) |
|
(global-unset-key (kbd "C-M-d")) |
|
(global-set-key (kbd "C-M-i") 'down-list) ;; -i stands for /in/ |
|
(global-set-key (kbd "C-M-o") 'up-list) ;; -o stands for /out/ |
|
|
|
(global-set-key (kbd "C-M-d") 'kill-sexp) |
|
|
|
;; * magit |
|
|
|
(global-set-key (kbd "C-x C-g") 'magit-status) ;; relates to C-x C-f and C-x C-s |
|
|
|
;; * iy-go-to char (broken) |
|
;; (require 'iy-go-to-char) |
|
;; (global-set-key (kbd "M-m") 'iy-go-up-to-char) |
|
;; (global-set-key (kbd "M-M") 'iy-go-up-to-char-backward) |
|
|
|
;; * smart-tab-mode |
|
(require 'smart-tab) |
|
(global-smart-tab-mode 1) |
|
(global-set-key (kbd "C-j") 'smart-tab) ;; try this; I never use C-j for goto-line |
|
|
|
;; ;; * ace jump mode |
|
;; (autoload |
|
;; 'ace-jump-mode |
|
;; "ace-jump-mode" |
|
;; "Emacs quick move minor mode" |
|
;; t) |
|
;; ;; you can select the key you prefer to |
|
|
|
;; (define-key global-map (kbd "C-c SPC") 'ace-jump-mode) |
|
|
|
;; ;; enable a more powerful jump back function from ace jump mode |
|
;; (autoload |
|
;; 'ace-jump-mode-pop-mark |
|
;; "ace-jump-mode" |
|
;; "Ace jump back:-)" |
|
;; t) |
|
;; (eval-after-load "ace-jump-mode" |
|
;; '(ace-jump-mode-enable-mark-sync)) |
|
;; (define-key global-map (kbd "C-x SPC") 'ace-jump-mode-pop-mark) |
|
|
|
(global-set-key (kbd "C-c SPC") 'avy-goto-word-or-subword-1) |
|
(global-set-key (kbd "M-s") 'avy-goto-word-or-subword-1) |
|
(global-set-key (kbd "M-g M-g") 'avy-goto-line) |
|
(global-set-key (kbd "M-g g") 'avy-goto-line) |
|
|
|
;; * redefine line-beginning to handle indentation properly |
|
(defun smart-line-beginning () |
|
"Move point to the beginning of text on the current line; if that is already |
|
the current position of point, then move it to the beginning of the line." |
|
(interactive) |
|
(let ((pt (point))) |
|
(beginning-of-line-text) |
|
(when (eq pt (point)) |
|
(beginning-of-line)))) |
|
(global-set-key (kbd "C-a") 'smart-line-beginning) |
|
|
|
;; * load expand-region |
|
(add-to-list 'load-path "~/tmp/expand-region.el") |
|
(require 'expand-region) |
|
(global-set-key (kbd "H-SPC") 'er/expand-region) |
|
|
|
;; * construct emacs-session so with session-id |
|
(defun emacs-session-filename (session-id) |
|
"Construct a filename to save the session in based on SESSION-ID. |
|
If the directory ~/.emacs.d exists, we make a filename in there, otherwise |
|
a file in the home directory." |
|
(let ((basename (concat "sessions/session." session-id)) |
|
(emacs-dir user-emacs-directory)) |
|
(expand-file-name (if (file-directory-p emacs-dir) |
|
(concat emacs-dir basename) |
|
(concat "~/.emacs-" basename))))) |
|
|
|
;; * Multiple cursors galore |
|
(require 'multiple-cursors) |
|
(define-key mc/keymap (kbd "<return>") nil) |
|
|
|
(global-set-key (kbd "C->") 'mc/mark-next-like-this) |
|
(global-set-key (kbd "C-<") 'mc/mark-previous-like-this) |
|
(global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this) |
|
|
|
(global-set-key (kbd "H-.") 'mc/mark-next-like-this) |
|
(global-set-key (kbd "H-,") 'mc/mark-previous-like-this) |
|
(global-set-key (kbd "<H-f13>") 'mc/mark-pop) |
|
(global-set-key (kbd "<H-f14>") 'mc/mark-pop) |
|
(global-set-key (kbd "H-#") 'mc/insert-numbers) |
|
|
|
(global-set-key (kbd "<f13>") 'set-mark-command) |
|
(global-set-key (kbd "<f14>") 'set-mark-command) |
|
|
|
;; Try to get rid of backspace |
|
(global-set-key (kbd "C-h") 'delete-backward-char) |
|
(global-set-key (kbd "S-SPC") 'delete-backward-char) |
|
;;(setq help-char (kbd "H-h") |
|
(global-set-key (kbd "M-h") 'backward-kill-word) |
|
(global-set-key (kbd "C-M-h") 'backward-kill-sexp) |
|
(global-set-key (kbd "H-h ") 'help-command) |
|
|
|
|
|
|
|
|
|
|
|
;; * clever mark stuff |
|
(require 'visible-mark) |
|
(visible-mark-mode t) |
|
(global-visible-mark-mode t) |
|
(transient-mark-mode 0) |
|
;; ** stuff that works |
|
(defun jump-to-mark () |
|
"Jumps to the local mark, respecting the `mark-ring' order. |
|
This is the same as using \\[set-mark-command] with the prefix argument." |
|
(interactive) |
|
(set-mark-command 1)) |
|
(global-set-key (kbd "<M-f13>") 'jump-to-mark) |
|
(global-set-key (kbd "<M-f14>") 'jump-to-mark) |
|
|
|
(defun just-activate-mark () |
|
(interactive) |
|
(activate-mark)) |
|
|
|
(global-set-key (kbd "<S-f13>") 'just-activate-mark) |
|
(global-set-key (kbd "<S-f14>") 'just-activate-mark) |
|
|
|
;; (defun exchange-point-and-mark-no-activate () |
|
;; "Identical to \\[exchange-point-and-mark] but will not activate the region." |
|
;; (interactive) |
|
;; (exchange-point-and-mark) |
|
;; (deactivate-mark nil)) |
|
;; (define-key global-map [remap exchange-point-and-mark] 'exchange-point-and-mark-no-activate) |
|
|
|
;; ** This function is not needed since we are not using transient mode anymore |
|
;; (defun push-mark-no-activate () |
|
;; "Pushes `point' to `mark-ring' and does not activate the region |
|
;; Equivalent to \\[set-mark-command] when \\[transient-mark-mode] is disabled" |
|
;; (interactive) |
|
;; (push-mark (point) t nil) |
|
;; (message "Pushed mark to ring")) |
|
;; (global-set-key (kbd "<C-f13>") 'push-mark-no-activate) |
|
|
|
;; * Wordnik :fixme: |
|
(require 'wordnik-synonym) |
|
(global-set-key (kbd "H-=") 'wn/synonym-at-point) |
|
;; * kill annoying completion buffer |
|
(add-hook 'minibuffer-exit-hook |
|
'(lambda () |
|
(let ((buffer "*Completions*")) |
|
(and (get-buffer buffer) |
|
(kill-buffer buffer))) |
|
)) |
|
|
|
;; * Open gpg encrypted files on the fly |
|
;;(require 'epa-file) |
|
;;(epa-file-enable) |
|
|
|
;; * Time stamps |
|
;; write |
|
;; Time-stamp: <> |
|
;; in your file and save it to see time stamps at work. |
|
;; Other time stamp format: "%a %b %e, %Y %l:%M %p" |
|
(add-hook 'write-file-hooks 'time-stamp) |
|
(setq time-stamp-active t) |
|
(setq time-stamp-format "%:a %02d %:b %:y, %02H:%02M:%02S, %u") |
|
(setq european-calendar-style 't) |
|
;; first day of the week is monday instead of sunday: |
|
(setq calendar--week--start--day 1) |
|
|
|
;; * toorg |
|
(require 'highlight-sexps) |
|
|
|
(setq echo-keystrokes 0.10) |
|
(set-default 'cursor-type 'box) |
|
|
|
(require 'fringe-current-line) |
|
(global-fringe-current-line-mode 1) |
|
(require 'hlinum) |
|
(hlinum-activate) |
|
|
|
|
|
;; * Try again with ido |
|
;; ** Load ido |
|
(require 'ido) |
|
(ido-mode t) |
|
;; ** Organize ibuffer according to some rules |
|
(setq ibuffer-saved-filter-groups |
|
(quote (("default" |
|
("LaTeχ" (mode . latex-mode)) |
|
("Magit" (name . "^\\*magit.*$")) |
|
("elisp" (mode . emacs-lisp-mode)) |
|
("org" (mode . org-mode)) |
|
("emacs" (or |
|
(name . "^\\*scratch\\*$") |
|
(name . "^\\*Messages\\*$") |
|
(name . "^\\*compilation\\*$"))))))) |
|
|
|
(add-hook 'ibuffer-mode-hook |
|
'(lambda () |
|
(ibuffer-switch-to-saved-filter-groups "default"))) |
|
|
|
|
|
;; * mode-line setup |
|
(setq-default mode-line-modified '(:eval (if (buffer-modified-p) "●" "·"))) ;still needs some improvements, does not report Readonly state |
|
(setq-default mode-line-remote '(:eval (let ((s (format-mode-line "%@"))) |
|
(cond |
|
((equal s "-") "·") ((equal s "@") "@") (t s))))) |
|
|
|
(defvar wilder-buffer-vc-mode-line |
|
'("%b" (vc-mode (:propertize |
|
;; Strip the backend name from the VC status information |
|
(:eval (let* ((backend (downcase (symbol-name (vc-backend (buffer-file-name))))) |
|
(branch (substring vc-mode (+ (length backend) 2))) |
|
(s (substring vc-mode (+ (length backend) 1) (+ (length backend) 2))) |
|
(status (cond ((equal s "-") "") ((equal s ":") "!") (t s)))) |
|
(concat "·" branch status))) |
|
face font-lock-comment-face)))) |
|
(put 'wilder-buffer-vc-mode-line 'risky-local-variable t) |
|
|
|
(defvar wilder-position |
|
'("[%p,%I] " )) |
|
|
|
(put 'wilder-position 'risky-local-variable t) |
|
|
|
(setq-default mode-line-format |
|
'("%e" |
|
mode-line-front-space |
|
mode-line-mule-info |
|
mode-line-client |
|
mode-line-modified |
|
mode-line-remote |
|
mode-line-frame-identification |
|
wilder-buffer-vc-mode-line " " |
|
wilder-position " " |
|
mode-line-modes |
|
mode-line-misc-info |
|
mode-line-end-spaces)) |
|
|
|
;; * toorg |
|
;; (require 'outshine) |
|
;; (add-hook 'outline-minor-mode-hook 'outshine-hook-function) |
|
;; (setq outshine-use-speed-commands t) |
|
;; (eval-after-load 'outshine '(define-key outline-minor-mode-map (kbd "C-M-i") nil)) |
|
;; (add-hook 'sh-mode-hook 'outline-minor-mode) |
|
|
|
(require 'package) |
|
(add-to-list 'package-archives |
|
'("melpa-stable" . "http://stable.melpa.org/packages/") t) |
|
|
|
;; * give it a try |
|
(require 'helm-config) |
|
(helm-mode 1) |
|
(global-set-key (kbd "M-x") 'helm-M-x) |
|
(global-set-key (kbd "C-x C-f") 'helm-find-files) |
|
(global-set-key (kbd "C-x b") 'helm-mini) |
|
(global-set-key (kbd "M-y") 'helm-show-kill-ring) |
|
(define-key helm-map (kbd "C-h") nil) |
|
(define-key helm-find-files-map (kbd "C-h") nil) |
|
|
|
;; Tried with golden-ratio, but found it irritating |
|
|
|
;; (eval-after-load 'tramp '(setenv "SHELL" "/bin/bash")) |
|
|
|
;; Use system proxy |
|
(setq url-proxy-services '(("http" . "127.0.0.1:8118"))) |
|
|
|
(define-minor-mode disable-mouse-mode |
|
"A minor-mode that disables all mouse keybinds." |
|
:global t |
|
:lighter "" |
|
:keymap (make-sparse-keymap)) |
|
|
|
(dolist (type '(mouse down-mouse drag-mouse |
|
double-mouse triple-mouse)) |
|
(dolist (prefix '("" C- M- S- M-S- C-M- C-S- C-M-S-)) |
|
;; Yes, I actually HAD to go up to 7 here. |
|
(dotimes (n 7) |
|
(let ((k (format "%s%s-%s" prefix type n))) |
|
(define-key disable-mouse-mode-map |
|
(vector (intern k)) #'ignore))))) |
|
|
|
(disable-mouse-mode 1) |
|
|
|
(defun flash-hline () |
|
(let ((fg (face-foreground 'default)) |
|
(bg (face-background 'hl-line))) |
|
(set-face-background 'hl-line fg) |
|
(run-with-timer |
|
0.1 nil (lambda () |
|
(set-face-background 'hl-line "#303030") )))) |
|
|
|
(global-set-key (kbd "<f15>") 'flash-hline) |
|
|
|
|
|
;;; Stefan Monnier <foo at acm.org>. It is the opposite of fill-paragraph |
|
(defun unfill-paragraph (&optional region) |
|
"Takes a multi-line paragraph and makes it into a single line of text." |
|
(interactive (progn (barf-if-buffer-read-only) '(t))) |
|
(let ((fill-column (point-max)) |
|
;; This would override `fill-column' if it's an integer. |
|
(emacs-lisp-docstring-fill-column t)) |
|
(fill-paragraph nil region))) |
|
|
|
;; * start server named after kde activity name |
|
(setq server-name (kde-current-activity-name)) |
|
(menu-bar-mode -99) |
|
(server-start)
|
|
|