Some more cleanup

master
Jacopo De Simoi 9 years ago
parent a77c430dbe
commit 001444ea18
  1. 1
      .mc-lists.el
  2. 387
      global.org
  3. 2
      init/init-latex.el

@ -69,6 +69,7 @@
comment-dwim comment-dwim
dabbrev-completion dabbrev-completion
describe-key describe-key
end-of-buffer
fill-paragraph fill-paragraph
find-file find-file
forward-sentence forward-sentence

@ -132,11 +132,11 @@
** Modeline ** Modeline
#+BEGIN_SRC emacs-lisp #+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 ;does not report Readonly state
(setq-default mode-line-remote '(:eval (let ((s (format-mode-line "%@"))) (setq-default mode-line-remote '(:eval (let ((s (format-mode-line "%@")))
(cond (cond
((equal s "-") "·") ((equal s "@") "@") (t s))))) ((equal s "-") "·") ((equal s "@") "@") (t s)))))
(defvar wilder-buffer-vc-mode-line (defvar wilder-buffer-vc-mode-line
'("%b" (vc-mode (:propertize '("%b" (vc-mode (:propertize
@ -145,7 +145,7 @@
(branch (substring vc-mode (+ (length backend) 2))) (branch (substring vc-mode (+ (length backend) 2)))
(s (substring vc-mode (+ (length backend) 1) (+ (length backend) 2))) (s (substring vc-mode (+ (length backend) 1) (+ (length backend) 2)))
(status (cond ((equal s "-") "") ((equal s ":") "!") (t s)))) (status (cond ((equal s "-") "") ((equal s ":") "!") (t s))))
(concat "·" branch status))) (concat "·" branch status)))
face font-lock-comment-face)))) face font-lock-comment-face))))
(put 'wilder-buffer-vc-mode-line 'risky-local-variable t) (put 'wilder-buffer-vc-mode-line 'risky-local-variable t)
@ -230,6 +230,18 @@
;; (setq fcl-fringe-bitmap 'right-triangle) ;; (setq fcl-fringe-bitmap 'right-triangle)
#+END_SRC #+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 * Leftovers
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(setq search-whitespace-regexp "[ \t\r\n]+") (setq search-whitespace-regexp "[ \t\r\n]+")
@ -249,242 +261,213 @@
(add-to-list 'auto-mode-alist '("\\.qml\\'" . qml-mode)) (add-to-list 'auto-mode-alist '("\\.qml\\'" . qml-mode))
#+END_SRC #+END_SRC
** TODO find out how kde-emacs makes “makeâ€<EFBFBD> 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 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 #+BEGIN_SRC emacs-lisp
(require 'kde-emacs) ;; (require 'kde-emacs)
(menu-bar-mode -1) ;; (menu-bar-mode -1)
#+END_SRC #+END_SRC
** Leftovers ** Leftovers
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
;;(setq kde-full-name "Jacopo De Simoi") ;;(setq kde-full-name "Jacopo De Simoi")
;;(setq kde-email "wilderkde@gmail.com") ;;(setq kde-email "wilderkde@gmail.com")
;; (require 'sourcepair) ;; (require 'sourcepair)
;; (global-set-key (kbd "<f6>") 'sourcepair-load) ;; (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?
(global-set-key (kbd "C-x k") 'kill-this-buffer) ;;why not? (setq default-fill-column 110)
(setq default-fill-column 110) ;; (require 'pomodoro)
;; (require 'pomodoro)
(defun select-frame-on-current-activity ()
(select-frame-on-activity (kde-current-activity))
)
;; Rehab ↓ (global-unset-key (kbd "C-z"))
;; mark the date 30/1/2014 (global-unset-key (kbd "C-x f"))
;; (require 'no-easy-keys) (global-unset-key (kbd "<M-f4>")) ; rly?
;; (no-easy-keys 1)
;; conflicts a bit with org-mode
;; Keyboard is faster than mouse ;; Change some global bindings:
;; Rehab ↑ (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/
;;Remove insanely irritating key-binding (global-set-key (kbd "C-M-d") 'kill-sexp)
(global-unset-key (kbd "C-z")) (global-set-key (kbd "C-M-<backspace>") 'backward-kill-sexp)
(global-unset-key (kbd "C-x f"))
(global-unset-key (kbd "<M-f4>")) ; 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
;; * magit (global-set-key (kbd "C-x C-g") 'magit-status) ;;relates to C-x C-f and C-x C-s
(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
;; * 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 (global-set-key (kbd "C-c SPC") 'avy-goto-word-or-subword-1)
(require 'smart-tab) (global-set-key (kbd "M-s") 'avy-goto-word-or-subword-1)
(global-smart-tab-mode 1) (global-set-key (kbd "M-g M-g") 'avy-goto-line)
(global-set-key (kbd "C-j") 'smart-tab) ;; try this; I never use C-j for goto-line (global-set-key (kbd "M-g g") 'avy-goto-line)
(global-set-key (kbd "C-c SPC") 'avy-goto-word-or-subword-1) ;; * redefine line-beginning to handle indentation properly
(global-set-key (kbd "M-s") 'avy-goto-word-or-subword-1) (defun smart-line-beginning ()
(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 "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." the current position of point, then move it to the beginning of the line."
(interactive) (interactive)
(let ((pt (point))) (let ((pt (point)))
(beginning-of-line-text) (beginning-of-line-text)
(when (eq pt (point)) (when (eq pt (point))
(beginning-of-line)))) (beginning-of-line))))
(global-set-key (kbd "C-a") 'smart-line-beginning) (global-set-key (kbd "C-a") 'smart-line-beginning)
;; * load expand-region ;; * load expand-region
(require 'expand-region) (require 'expand-region)
(global-set-key (kbd "C-=") 'er/expand-region) (global-set-key (kbd "C-=") 'er/expand-region)
;; * construct emacs-session so with session-id ;; * construct emacs-session so with session-id
(defun emacs-session-filename (session-id) (defun emacs-session-filename (session-id)
"Construct a filename to save the session in based on 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 If the directory ~/.emacs.d exists, we make a filename in there, otherwise
a file in the home directory." a file in the home directory."
(let ((basename (concat "sessions/session." session-id)) (let ((basename (concat "sessions/session." session-id))
(emacs-dir user-emacs-directory)) (emacs-dir user-emacs-directory))
(expand-file-name (if (file-directory-p emacs-dir) (expand-file-name (if (file-directory-p emacs-dir)
(concat emacs-dir basename) (concat emacs-dir basename)
(concat "~/.emacs-" basename))))) (concat "~/.emacs-" basename)))))
;; * Multiple cursors galore ;; * Multiple cursors galore
(require 'multiple-cursors) (require 'multiple-cursors)
(define-key mc/keymap (kbd "<return>") nil) (define-key mc/keymap (kbd "<return>") nil)
(global-set-key (kbd "C->") 'mc/mark-next-like-this) (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-<") 'mc/mark-previous-like-this)
(global-set-key (kbd "C-c C-<") 'mc/mark-all-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-next-like-this)
(global-set-key (kbd "H-,") 'mc/mark-previous-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-f13>") 'mc/mark-pop)
(global-set-key (kbd "<H-f14>") 'mc/mark-pop) (global-set-key (kbd "<H-f14>") 'mc/mark-pop)
(global-set-key (kbd "H-#") 'mc/insert-numbers) (global-set-key (kbd "H-#") 'mc/insert-numbers)
(global-set-key (kbd "<f13>") 'set-mark-command) (global-set-key (kbd "<f13>") 'set-mark-command)
(global-set-key (kbd "<f14>") 'set-mark-command) (global-set-key (kbd "<f14>") 'set-mark-command)
;;(setq help-char (kbd "H-h") ;;(setq help-char (kbd "H-h")
(global-set-key (kbd "M-h") 'backward-kill-word) (global-set-key (kbd "M-h") 'backward-kill-word)
(global-set-key (kbd "C-M-h") 'backward-kill-sexp) (global-set-key (kbd "C-M-h") 'backward-kill-sexp)
;; * clever mark stuff ;; * clever mark stuff
(require 'visible-mark) (require 'visible-mark)
(visible-mark-mode t) (visible-mark-mode t)
(global-visible-mark-mode t) (global-visible-mark-mode t)
(transient-mark-mode 0) (transient-mark-mode 0)
;; ** stuff that works ;; ** stuff that works
(defun jump-to-mark () (defun jump-to-mark ()
"Jumps to the local mark, respecting the `mark-ring' order. "Jumps to the local mark, respecting the `mark-ring' order.
This is the same as using \\[set-mark-command] with the prefix argument." This is the same as using \\[set-mark-command] with the prefix argument."
(interactive) (interactive)
(set-mark-command 1)) (set-mark-command 1))
(global-set-key (kbd "<M-f13>") 'jump-to-mark) (global-set-key (kbd "<M-f13>") 'jump-to-mark)
(global-set-key (kbd "<M-f14>") 'jump-to-mark) (global-set-key (kbd "<M-f14>") 'jump-to-mark)
(defun just-activate-mark () (defun just-activate-mark ()
(interactive) (interactive)
(activate-mark)) (activate-mark))
(global-set-key (kbd "<S-f13>") 'just-activate-mark) (global-set-key (kbd "<S-f13>") 'just-activate-mark)
(global-set-key (kbd "<S-f14>") 'just-activate-mark) (global-set-key (kbd "<S-f14>") 'just-activate-mark)
;; (defun exchange-point-and-mark-no-activate () ;; (defun exchange-point-and-mark-no-activate ()
;; "Identical to \\[exchange-point-and-mark] but will not activate the region." ;; "Identical to \\[exchange-point-and-mark] but will not activate the region."
;; (interactive) ;; (interactive)
;; (exchange-point-and-mark) ;; (exchange-point-and-mark)
;; (deactivate-mark nil)) ;; (deactivate-mark nil))
;; (define-key global-map [remap exchange-point-and-mark] 'exchange-point-and-mark-no-activate) ;; (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 ;; ** This function is not needed since we are not using transient mode anymore
;; (defun push-mark-no-activate () ;; (defun push-mark-no-activate ()
;; "Pushes `point' to `mark-ring' and does not activate the region ;; "Pushes `point' to `mark-ring' and does not activate the region
;; Equivalent to \\[set-mark-command] when \\[transient-mark-mode] is disabled" ;; Equivalent to \\[set-mark-command] when \\[transient-mark-mode] is disabled"
;; (interactive) ;; (interactive)
;; (push-mark (point) t nil) ;; (push-mark (point) t nil)
;; (message "Pushed mark to ring")) ;; (message "Pushed mark to ring"))
;; (global-set-key (kbd "<C-f13>") 'push-mark-no-activate) ;; (global-set-key (kbd "<C-f13>") 'push-mark-no-activate)
;; * Wordnik :fixme: ;; * Wordnik :fixme:
(require 'wordnik-synonym) (require 'wordnik-synonym)
(global-set-key (kbd "H-=") 'wn/synonym-at-point) (global-set-key (kbd "H-=") 'wn/synonym-at-point)
;; * kill annoying completion buffer ;; * kill annoying completion buffer
(add-hook 'minibuffer-exit-hook (add-hook 'minibuffer-exit-hook
'(lambda () '(lambda ()
(let ((buffer "*Completions*")) (let ((buffer "*Completions*"))
(and (get-buffer buffer) (and (get-buffer buffer)
(kill-buffer buffer))) (kill-buffer buffer)))
)) ))
;; * Open gpg encrypted files on the fly ;; * Open gpg encrypted files on the fly
;;(require 'epa-file) ;;(require 'epa-file)
;;(epa-file-enable) ;;(epa-file-enable)
;; * Time stamps ;; * Time stamps
;; write ;; write
;; Time-stamp: <> ;; Time-stamp: <>
;; in your file and save it to see time stamps at work. ;; in your file and save it to see time stamps at work.
;; Other time stamp format: "%a %b %e, %Y %l:%M %p" ;; Other time stamp format: "%a %b %e, %Y %l:%M %p"
(add-hook 'write-file-hooks 'time-stamp) (add-hook 'write-file-hooks 'time-stamp)
(setq time-stamp-active t) (setq time-stamp-active t)
(setq time-stamp-format "%:a %02d %:b %:y, %02H:%02M:%02S, %u") (setq time-stamp-format "%:a %02d %:b %:y, %02H:%02M:%02S, %u")
(setq european-calendar-style 't) (setq european-calendar-style 't)
;; first day of the week is monday instead of sunday: ;; first day of the week is monday instead of sunday:
(setq calendar--week--start--day 1) (setq calendar--week--start--day 1)
;; * toorg ;; * toorg
(require 'highlight-sexps) (require 'highlight-sexps)
(setq echo-keystrokes 0.10) (setq echo-keystrokes 0.10)
;; * Try again with ido ;; * Try again with ido
;; ** Load ido ;; ** Load ido
;;(require 'ido) ;;(require 'ido)
;;(ido-mode t) ;;(ido-mode t)
;; ** Organize ibuffer according to some rules ;; ** Organize ibuffer according to some rules
;;(setq ibuffer-saved-filter-groups ;;(setq ibuffer-saved-filter-groups
;; (quote (("default" ;; (quote (("default"
;; ("LaTeχ" (mode . latex-mode)) ;; ("LaTeχ" (mode . latex-mode))
;; ("Magit" (name . "^\\*magit.*$")) ;; ("Magit" (name . "^\\*magit.*$"))
;; ("elisp" (mode . emacs-lisp-mode)) ;; ("elisp" (mode . emacs-lisp-mode))
;; ("org" (mode . org-mode)) ;; ("org" (mode . org-mode))
;; ("emacs" (or ;; ("emacs" (or
;; (name . "^\\*scratch\\*$") ;; (name . "^\\*scratch\\*$")
;; (name . "^\\*Messages\\*$") ;; (name . "^\\*Messages\\*$")
;; (name . "^\\*compilation\\*$"))))))) ;; (name . "^\\*compilation\\*$")))))))
;; ;;
;;(add-hook 'ibuffer-mode-hook ;;(add-hook 'ibuffer-mode-hook
;; '(lambda () ;; '(lambda ()
;; (ibuffer-switch-to-saved-filter-groups "default"))) ;; (ibuffer-switch-to-saved-filter-groups "default")))
(require 'outshine)
(add-hook 'outline-minor-mode-hook 'outshine-hook-function) ;; * toorg
(setq outshine-use-speed-commands t) (require 'outshine)
(eval-after-load 'outshine '(define-key outline-minor-mode-map (kbd "C-M-i") nil)) (add-hook 'outline-minor-mode-hook 'outshine-hook-function)
;; (add-hook 'sh-mode-hook 'outline-minor-mode) (setq outshine-use-speed-commands t)
(eval-after-load 'outshine '(define-key outline-minor-mode-map (kbd "C-M-i") nil))
(require 'package) ;; (add-hook 'sh-mode-hook 'outline-minor-mode)
(add-to-list 'package-archives
(require 'package)
(add-to-list 'package-archives
'("melpa-stable" . "http://stable.melpa.org/packages/") t) '("melpa-stable" . "http://stable.melpa.org/packages/") t)
;; * give it a try ;; (eval-after-load 'tramp '(setenv "SHELL" "/bin/bash"))
(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")))
;; Use system proxy
(setq url-proxy-services '(("http" . "127.0.0.1:8118")))
(defun flash-hline () (defun flash-hline ()
(let ((fg (face-foreground 'default)) (let ((fg (face-foreground 'default))
(bg (face-background 'hl-line))) (bg (face-background 'hl-line)))
(set-face-background 'hl-line fg) (set-face-background 'hl-line fg)
@ -492,11 +475,11 @@ This is the same as using \\[set-mark-command] with the prefix argument."
0.1 nil (lambda () 0.1 nil (lambda ()
(set-face-background 'hl-line "#303030") )))) (set-face-background 'hl-line "#303030") ))))
(global-set-key (kbd "<f15>") 'flash-hline) (global-set-key (kbd "<f15>") 'flash-hline)
;;; Stefan Monnier <foo at acm.org>. It is the opposite of fill-paragraph ;;; Stefan Monnier <foo at acm.org>. It is the opposite of fill-paragraph
(defun unfill-paragraph (&optional region) (defun unfill-paragraph (&optional region)
"Takes a multi-line paragraph and makes it into a single line of text." "Takes a multi-line paragraph and makes it into a single line of text."
(interactive (progn (barf-if-buffer-read-only) '(t))) (interactive (progn (barf-if-buffer-read-only) '(t)))
(let ((fill-column (point-max)) (let ((fill-column (point-max))
@ -504,22 +487,26 @@ This is the same as using \\[set-mark-command] with the prefix argument."
(emacs-lisp-docstring-fill-column t)) (emacs-lisp-docstring-fill-column t))
(fill-paragraph nil region))) (fill-paragraph nil region)))
;; * start server named after kde activity name (defun select-frame-on-current-activity ()
(setq server-name (kde-current-activity-name)) (select-frame-on-activity (kde-current-activity))
;; 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? ;; * start server named after kde activity name
;; (setq server-name (kde-current-activity-name))
;; Because it sets the face for packages that have loaded in the meantime; ;; mmh
;; it does not wark perfectly as some packages are still to be loaded ;; (set-face-font 'default "-xos4-hackminus-medium-r-normal--20-200-72-72-c-100-ISO10646-1") ;
;; (most notably magit) ;; 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 (mapc
(lambda (face) (lambda (face)
(set-face-attribute face nil :weight 'normal) (set-face-attribute face nil :weight 'normal)
(set-face-attribute face nil :slant 'normal)) (set-face-attribute face nil :slant 'normal))
(face-list)) (face-list))
(server-start) (server-start)
#+END_SRC #+END_SRC

@ -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 "C-M-o") 'up-list) ;; -o stands for /out/
(define-key LaTeX-mode-map (kbd "<f4>") (lambda() (interactive) (message "Use C-c C-c"))) (define-key LaTeX-mode-map (kbd "<f4>") (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)
(define-key LaTeX-mode-map (kbd "") 'insert-char-with-padding) (define-key LaTeX-mode-map (kbd "") 'insert-char-with-padding)

Loading…
Cancel
Save