(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-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/")))) '(bsn-backends (quote (msn))) '(case-fold-search t) '(compilation-auto-jump-to-first-error t) '(compilation-skip-threshold 2) '(current-language-environment "English") '(default-input-method "rfc1345") '(delete-active-region nil) '(flyspell-duplicate-distance 0) '(flyspell-mark-duplications-flag t) '(font-latex-fontify-sectioning (quote color)) '(global-font-lock-mode t nil (font-lock)) '(inhibit-startup-screen t) '(parens-require-spaces nil) '(safe-local-variable-values (quote ((TeX-master . notes\.tex) (bookmark-default-file . "./emacs.bmk")))) '(show-paren-mode t) '(smart-tab-completion-functions-alist (quote ((emacs-lisp-mode . lisp-complete-symbol) (text-mode . dabbrev-completion) (latex-mode . TeX-complete-symbol)))) '(transient-mark-mode t) '(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. '(default ((t (:inherit nil :stipple nil :background "#182828" :foreground "Wheat" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 90 :width normal :foundry "xos4" :family "terminus")))) '(bold ((t (:weight semi-bold)))) '(cursor ((t (:background "orchid")))) '(fixed-pitch ((t (:family "Bitstream Vera Sans Mono")))) '(font-latex-italic-face ((t (:inherit italic :foreground "SpringGreen")))) '(font-lock-comment-delimiter-face ((t (:foreground "lightslategray")))) '(font-lock-comment-face ((t (:foreground "SlateGray")))) '(highlight ((t (:background "DarkSlateGray")))) '(italic ((((supports :underline t)) nil))) '(menu ((t (:inverse-video t)))) '(mouse ((t (:background "orchid")))) '(tooltip ((t (:inherit default :background "lightyellow" :foreground "black" :foundry "xos4" :family "terminus")))) '(variable-pitch ((t (:family "default")))) '(visible-mark-face ((t (:background "goldenrod" :foreground "darkslategrey"))))) (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-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 1 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 (global-set-key (kbd "C-M-") 'backward-kill-sexp) (setq mouse-autoselect-window nil) (mouse-wheel-mode t) (load "init-latex.el") ;; KDE stuff ;; (add-to-list 'load-path "~/kde-emacs") (load "qml-mode.el" nil t t); (require 'kde-emacs) ;;(setq kde-full-name "Jacopo De Simoi") ;;(setq kde-email "wilderkde@gmail.com") (setq frame-title-format '((buffer-file-name "%f" (dired-directory dired-directory "%b")) " · emacs %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) (require 'linum) (add-hook 'text-mode-hook 'flyspell-mode) (add-hook 'text-mode-hook 'linum-mode) (require 'sourcepair) (global-set-key (kbd "") 'sourcepair-load) (setq default-fill-column 120) (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) (require 'key-chord) (key-chord-mode 1) (setq key-chord-two-keys-delay 0.05) ;;(key-chord-define-global "{}" 'add-curlybrackets-delimiter) ;;(key-chord-define-global "4r" "$") ;;(key-chord-define-global "';" "\\") ;;(key-chord-define-global "$%" 'add-dollar-delimiter) ;;(key-chord-define-global ",." (lambda () (interactive) (TeX-insert-macro "ref"))) (global-set-key (kbd "M-[") 'previous-buffer) (global-set-key (kbd "M-]") 'next-buffer) ;; kde activity stuff -- move to other file when stabilized (defun kde-current-activity () "Returns the current KDE activity" (substring (shell-command-to-string "qdbus org.kde.ActivityManager /ActivityManager/Activities org.kde.ActivityManager.Activities.CurrentActivity") 0 -1) ) (defun X-window-id-belongs-to-activity (window-id activity) (= (shell-command (concat "xprop -id " window-id " | grep _KDE_NET_WM_ACTIVITIES | grep " activity ">/dev/null")) 0) ) (defun select-frame-on-activity (activity) (setq framelist (frame-list)) (setq done nil) (while (and framelist (not done)) (setq cur (car framelist)) (setq cur-id (cdr (assq 'window-id (frame-parameters cur)))) (if cur-id (if (X-window-id-belongs-to-activity cur-id activity) (progn; (setq done 't) (select-frame cur)) )) (setq framelist (cdr framelist))) done ) (defun select-X-frame () (setq framelist (frame-list)) (setq done nil) (while (and framelist (not done)) (setq cur (car framelist)) (setq cur-id (cdr (assq 'window-id (frame-parameters cur)))) (if cur-id (progn; (setq done 't) (raise-frame cur))) (setq framelist (cdr framelist))) done ) (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) ;;Keyboard is faster than mouse (global-unset-key (kbd "")) (global-unset-key (kbd "")) (global-unset-key (kbd "")) ;; Rehab ↑ ;;Remove insanely irritating key-binding (global-unset-key (kbd "C-z")) (global-unset-key (kbd "C-x f")) (require 'visible-mark) (visible-mark-mode t) (global-visible-mark-mode t) (delete 'Git vc-handled-backends) (require 'magit) (global-set-key (kbd "H-g") 'magit-status) (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) (require 'smart-tab) (global-smart-tab-mode 1) ;; ;; ace jump mode major function ;; (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) (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) (defun smart-delete-backward-char () "try to be smart to delete indentation" (interactive) (let ((pt (point))) (beginning-of-line-text) (if (eq pt (point)) (delete-indentation) (progn (goto-char pt) (call-interactively 'delete-backward-char))))) (global-set-key "\d" 'smart-delete-backward-char) (add-to-list 'load-path "~/tmp/expand-region.el") (require 'expand-region) (global-set-key (kbd "H-SPC") 'er/expand-region) (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))))) (require 'multiple-cursors) (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 "C-S-") 'mc/add-cursor-on-click) (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-") 'mc/add-cursor-on-click) (global-set-key (kbd "H-`") 'mc/mark-pop) ;; clever mark stuff (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-`") 'push-mark-no-activate) (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-`") 'jump-to-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) (byte-recompile-directory "~/.emacs.d/bibretrieve" 0) (load "bibretrieve") (require 'wordnik-synonym) (global-set-key (kbd "H-=") 'wn/synonym-at-point) ;(require 'highlight-sexps) ;; (require 'smartparens) ;; (require 'smartparens-config) ;; (require 'smartparens-latex) (defun flymake-get-tex-args (file-name) (list "chktex" (list "-q" "-v0" file-name))) (setq server-name (kde-current-activity)) (server-start) (menu-bar-mode -99)