diff --git a/.mc-lists.el b/.mc-lists.el index ce48b7e..835a621 100644 --- a/.mc-lists.el +++ b/.mc-lists.el @@ -69,6 +69,7 @@ comment-dwim dabbrev-completion describe-key + end-of-buffer fill-paragraph find-file forward-sentence diff --git a/global.org b/global.org index 1ff88d7..1791d79 100644 --- a/global.org +++ b/global.org @@ -132,11 +132,11 @@ ** Modeline #+BEGIN_SRC emacs-lisp - (setq-default mode-line-modified '(:eval (if (buffer-modified-p) " " "·"))) ;still needs some improvements, + (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))))) + ((equal s "-") "·") ((equal s "@") "@") (t s))))) (defvar wilder-buffer-vc-mode-line '("%b" (vc-mode (:propertize @@ -145,7 +145,7 @@ (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))) + (concat "·" branch status))) face font-lock-comment-face)))) (put 'wilder-buffer-vc-mode-line 'risky-local-variable t) @@ -230,6 +230,18 @@ ;; (setq fcl-fringe-bitmap 'right-triangle) #+END_SRC +** Use ~helm~ + #+BEGIN_SRC emacs-lisp + (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 "C-x C-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) + #+END_SRC * Leftovers #+BEGIN_SRC emacs-lisp (setq search-whitespace-regexp "[ \t\r\n]+") @@ -249,277 +261,252 @@ (add-to-list 'auto-mode-alist '("\\.qml\\'" . qml-mode)) #+END_SRC -** TODO find out how kde-emacs makes “make” actually work +** DONE find out how kde-emacs makes “make” actually work I need to keep this up until I realize what I need to make “make” work - Please notice that kde-emacs forces the menu to show + Please notice that kde-emacs forces the menu to show; + #+BEGIN_SRC emacs-lisp - (require 'kde-emacs) - (menu-bar-mode -1) +;; (require 'kde-emacs) +;; (menu-bar-mode -1) #+END_SRC ** Leftovers #+BEGIN_SRC emacs-lisp -;;(setq kde-full-name "Jacopo De Simoi") -;;(setq kde-email "wilderkde@gmail.com") - -;; (require 'sourcepair) -;; (global-set-key (kbd "") 'sourcepair-load) - -(global-set-key (kbd "C-M-") 'backward-kill-sexp) - -(global-set-key (kbd "C-x k") 'kill-this-buffer) ;;why not? - -(setq default-fill-column 110) - -;; (require 'pomodoro) + ;;(setq kde-full-name "Jacopo De Simoi") + ;;(setq kde-email "wilderkde@gmail.com") + + ;; (require 'sourcepair) + ;; (global-set-key (kbd "") 'sourcepair-load) + + (global-set-key (kbd "C-x k") 'kill-this-buffer) ;;why not? + + (setq default-fill-column 110) + + ;; (require 'pomodoro) + + (global-unset-key (kbd "C-z")) + (global-unset-key (kbd "C-x f")) + (global-unset-key (kbd "")) ; rly? + + ;; 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) + (global-set-key (kbd "C-M-") 'backward-kill-sexp) + + + ;; * magit + + (global-set-key (kbd "C-x C-g") 'magit-status) ;;relates to C-x C-f and C-x C-s + + ;; * 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 + + + (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 + + (require 'expand-region) + (global-set-key (kbd "C-=") '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 "") 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 "") 'mc/mark-pop) + (global-set-key (kbd "") 'mc/mark-pop) + (global-set-key (kbd "H-#") 'mc/insert-numbers) + + (global-set-key (kbd "") 'set-mark-command) + (global-set-key (kbd "") 'set-mark-command) + + ;;(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) + + ;; * 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 "") 'jump-to-mark) + (global-set-key (kbd "") 'jump-to-mark) + + (defun just-activate-mark () + (interactive) + (activate-mark)) + + (global-set-key (kbd "") 'just-activate-mark) + (global-set-key (kbd "") '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 "") '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) + + ;; * 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"))) + + + + ;; * 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) + + ;; (eval-after-load 'tramp '(setenv "SHELL" "/bin/bash")) + + ;; Use system proxy + (setq url-proxy-services '(("http" . "127.0.0.1:8118"))) + + (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 "") 'flash-hline) + + + ;;; Stefan Monnier . 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))) (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 "")) ; rly? - -;; 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 - -(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 - -(require 'expand-region) -(global-set-key (kbd "C-=") '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 "") 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 "") 'mc/mark-pop) -(global-set-key (kbd "") 'mc/mark-pop) -(global-set-key (kbd "H-#") 'mc/insert-numbers) - -(global-set-key (kbd "") 'set-mark-command) -(global-set-key (kbd "") 'set-mark-command) - -;;(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) - -;; * 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 "") 'jump-to-mark) -(global-set-key (kbd "") 'jump-to-mark) - -(defun just-activate-mark () - (interactive) - (activate-mark)) - -(global-set-key (kbd "") 'just-activate-mark) -(global-set-key (kbd "") '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 "") '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) - -;; * 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"))) - - -(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 "C-x C-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"))) - - -(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 "") 'flash-hline) - - - ;;; Stefan Monnier . 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)) -;; mmh -;; (set-face-font 'default "-xos4-hackminus-medium-r-normal--20-200-72-72-c-100-ISO10646-1") ; -;; Why is the above needed down here? -;; -;; Because it sets the face for packages that have loaded in the meantime; -;; it does not wark perfectly as some packages are still to be loaded -;; (most notably magit) - - -(mapc - (lambda (face) - (set-face-attribute face nil :weight 'normal) - (set-face-attribute face nil :slant 'normal)) - (face-list)) -(server-start) + (select-frame-on-activity (kde-current-activity)) + ) + + ;; * start server named after kde activity name + (setq server-name (kde-current-activity-name)) + ;; mmh + ;; (set-face-font 'default "-xos4-hackminus-medium-r-normal--20-200-72-72-c-100-ISO10646-1") ; + ;; Why is the above needed down here? + ;; + ;; Because it sets the face for packages that have loaded in the meantime; + ;; it does not wark perfectly as some packages are still to be loaded + ;; (most notably magit) + + + (mapc + (lambda (face) + (set-face-attribute face nil :weight 'normal) + (set-face-attribute face nil :slant 'normal)) + (face-list)) + (server-start) #+END_SRC diff --git a/init/init-latex.el b/init/init-latex.el index 8126bcc..8980ac9 100644 --- a/init/init-latex.el +++ b/init/init-latex.el @@ -100,7 +100,7 @@ (define-key LaTeX-mode-map (kbd "C-M-o") 'up-list) ;; -o stands for /out/ (define-key LaTeX-mode-map (kbd "") (lambda() (interactive) (message "Use C-c C-c"))) - (define-key LaTeX-mode-map (kbd "C-c C-c") 'make) + (define-key LaTeX-mode-map (kbd "C-c C-c") (lambda() (interactive) (compile "make -k")) );;'make) (define-key LaTeX-mode-map (kbd "=") 'insert-char-with-padding) (define-key LaTeX-mode-map (kbd "≠") 'insert-char-with-padding)