This commit is contained in:
Valentin Gehrke 2017-10-05 09:31:11 +02:00
parent 5cc194af98
commit 4ff372160e

View file

@ -15,10 +15,10 @@
;; Default frame size ;; Default frame size
(setq initial-frame-alist (setq initial-frame-alist
'( '(
(width . 110) (width . 110)
(height . 40) (height . 40)
)) ))
;; Use cperl-mode instead of perl-mode ;; Use cperl-mode instead of perl-mode
(defalias 'perl-mode 'cperl-mode) (defalias 'perl-mode 'cperl-mode)
@ -94,10 +94,10 @@
(defun ensure-package-installed (package) (defun ensure-package-installed (package)
"Ensure packages are installed" "Ensure packages are installed"
(if (package-installed-p package) (if (package-installed-p package)
nil nil
(progn (progn
(package-refresh-contents) (package-refresh-contents)
(package-install package)))) (package-install package))))
(ensure-package-installed 'use-package) (ensure-package-installed 'use-package)
@ -118,7 +118,7 @@
;; shackle ;; shackle
;(defun my/shackle-rules () ;(defun my/shackle-rules ()
; (setq shackle-rules ; (setq shackle-rules
; '((term-mode :select t :align 'below :size 0.2)))) ; '((term-mode :select t :align 'below :size 0.2))))
; ;
;(use-package shackle ;(use-package shackle
; :ensure t ; :ensure t
@ -168,15 +168,15 @@
:ensure t :ensure t
:demand t :demand t
:config (progn :config (progn
(require 'auto-complete-config) (require 'auto-complete-config)
(setq ac-sources '(ac-source-filename (setq ac-sources '(ac-source-filename
ac-source-functions ac-source-functions
ac-source-yasnippet ac-source-yasnippet
ac-source-variables ac-source-variables
ac-source-symbols ac-source-symbols
ac-source-features ac-source-features
ac-source-words-in-all-buffer ac-source-words-in-all-buffer
ac-source-dictionary)) ac-source-dictionary))
(global-auto-complete-mode))) (global-auto-complete-mode)))
;; folding ;; folding
@ -193,10 +193,10 @@
:ensure t :ensure t
:demand t :demand t
:config (progn :config (progn
(ivy-mode 1) (ivy-mode 1)
(setq ivy-use-virtual-buffers t) (setq ivy-use-virtual-buffers t)
(setq ivy-count-format "(%d/%d) ") (setq ivy-count-format "(%d/%d) ")
(define-key ivy-minibuffer-map (kbd "<C-return>") 'ivy-immediate-done))) (define-key ivy-minibuffer-map (kbd "<C-return>") 'ivy-immediate-done)))
(use-package counsel (use-package counsel
:ensure t :ensure t
@ -211,7 +211,7 @@
:ensure t :ensure t
:demand t :demand t
:config (progn :config (progn
(global-set-key (kbd "C-x t") #'terminal-here-launch))) (global-set-key (kbd "C-x t") #'terminal-here-launch)))
;; swiper ;; swiper
(use-package swiper (use-package swiper
@ -253,7 +253,7 @@
:disabled :disabled
:bind ("C-s" . avy-goto-word-0) :bind ("C-s" . avy-goto-word-0)
:config (progn :config (progn
(setq avy-keys '(?a ?s ?d ?f ?g ?q ?w ?e ?r ?t ?y ?x ?c ?v ?z ?u ?i ?o ?p ?h ?j ?k ?l ?b ?n ?m)))) (setq avy-keys '(?a ?s ?d ?f ?g ?q ?w ?e ?r ?t ?y ?x ?c ?v ?z ?u ?i ?o ?p ?h ?j ?k ?l ?b ?n ?m))))
;; Magit ;; Magit
(use-package magit (use-package magit
@ -285,11 +285,11 @@
;(defun my/compilation-bury-buffer-without-error (buffer string) ;(defun my/compilation-bury-buffer-without-error (buffer string)
; (cond ((string-match "finished" string) ; (cond ((string-match "finished" string)
; (message "Build maybe successful: closing window.") ; (message "Build maybe successful: closing window.")
; (run-with-timer 3 nil ; (run-with-timer 3 nil
; 'delete-window ; 'delete-window
; (get-buffer-window buffer t))) ; (get-buffer-window buffer t)))
; (t (message "Compilation exited abnormaly: %s" string)))) ; (t (message "Compilation exited abnormaly: %s" string))))
; ;
;(setq compilation-finish-function 'my/compilation-bury-buffer-without-error) ;(setq compilation-finish-function 'my/compilation-bury-buffer-without-error)
@ -328,24 +328,24 @@
(global-set-key (kbd "<C-tab>") 'cycle-window) (global-set-key (kbd "<C-tab>") 'cycle-window)
;; Exit prompt ;; Exit prompt
(defun foreach (alist func) ;; (defun foreach (alist func)
(while alist ;; (while alist
(progn ;; (progn
(funcall func (car alist)) ;; (funcall func (car alist))
(setq alist (cdr alist))))) ;; (setq alist (cdr alist)))))
;(defun emacs-exit-prompt () ;(defun emacs-exit-prompt ()
; (foreach ; (foreach
; (buffer-list) ; (buffer-list)
; (lambda (buffer) ; (lambda (buffer)
; (cond ; (cond
; ((string-match "^\\*.*\\*$" (buffer-name buffer)) nil) ; ((string-match "^\\*.*\\*$" (buffer-name buffer)) nil)
; ((null (buffer-modified-p buffer)) nil) ; ((null (buffer-modified-p buffer)) nil)
; (t nil))))) ; (t nil)))))
;; Latex german ;; Latex german
(quail-define-package "latex-german" "UTF-8" "LaGe" t (quail-define-package "latex-german" "UTF-8" "LaGe" t
"Transforms umlauts to the better latex notation. "Transforms umlauts to the better latex notation.
ä -> \"a ä -> \"a
ö -> \"o ö -> \"o
ü -> \"u ü -> \"u
@ -353,7 +353,7 @@
Ö -> \"O Ö -> \"O
Ü -> \"U Ü -> \"U
ß -> \"s" ß -> \"s"
nil t nil nil nil nil nil nil nil nil t) nil t nil nil nil nil nil nil nil nil t)
(quail-define-rules (quail-define-rules
("ä" ["\"a"]) ("ä" ["\"a"])
("ö" ["\"o"]) ("ö" ["\"o"])
@ -365,8 +365,8 @@
) )
(add-hook 'latex-mode-hook (lambda () (add-hook 'latex-mode-hook (lambda ()
(set-input-method "latex-german") (set-input-method "latex-german")
(local-set-key "\"" 'self-insert-command))) (local-set-key "\"" 'self-insert-command)))
;; Treat _ as part of word in some modes ;; Treat _ as part of word in some modes
(defun treat-underscore () (defun treat-underscore ()
@ -380,11 +380,11 @@
;; Overlay windows (What does it do?) ;; Overlay windows (What does it do?)
(add-to-list 'display-buffer-alist (add-to-list 'display-buffer-alist
'("*Apropos*" display-buffer-same-window)) '("*Apropos*" display-buffer-same-window))
(add-to-list 'display-buffer-alist (add-to-list 'display-buffer-alist
'("*Help*" display-buffer-in-side-window)) '("*Help*" display-buffer-in-side-window))
(add-to-list 'display-buffer-alist (add-to-list 'display-buffer-alist
'("*compilation*" (display-buffer-reuse-window display-buffer-in-side-window) (side . bottom) (size . 0.2))) '("*compilation*" (display-buffer-reuse-window display-buffer-in-side-window) (side . bottom) (size . 0.2)))
;; Change all prompts to y or n ;; Change all prompts to y or n
(fset 'yes-or-no-p 'y-or-n-p) (fset 'yes-or-no-p 'y-or-n-p)
@ -401,22 +401,22 @@
;(defun extend-comment () ;(defun extend-comment ()
; (interactive) ; (interactive)
; (if (looking-back "//" (line-beginning-position)) ; (if (looking-back "//" (line-beginning-position))
; (progn ; (progn
; (newline-and-indent) ; (newline-and-indent)
; (insert "Hallo Welt")) ; (insert "Hallo Welt"))
; (newline-and-indent))) ; (newline-and-indent)))
;; Show in binary and decimal ;; Show in binary and decimal
;(defun hex-popup () ;(defun hex-popup ()
; (interactive) ; (interactive)
; (let (hexStr p1 p2) ; (let (hexStr p1 p2)
; (save-excursion ; (save-excursion
; (search-backward-regexp "[^0-9A-Fa-f]" nil t) ; (search-backward-regexp "[^0-9A-Fa-f]" nil t)
; (forward-char) ; (forward-char)
; (setq p1 (point)) ; (setq p1 (point))
; (search-forward-regexp "[^0-9A-Fa-f]" nil t) ; (search-forward-regexp "[^0-9A-Fa-f]" nil t)
; (backward-char) ; (backward-char)
; (setq p2 (point))) ; (setq p2 (point)))
; (setq hexStr (buffer-substring-no-properties p1 p2)) ; (setq hexStr (buffer-substring-no-properties p1 p2))
; (message "The hex number is: '%s' '%d' '%d'" hexStr p1 p2))) ; (message "The hex number is: '%s' '%d' '%d'" hexStr p1 p2)))