From bd4026de0f1a4067ba0cc0ef05be26d384f92fe1 Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Tue, 16 May 2017 00:48:57 +0200 Subject: [PATCH] Mehr emacs gebastel --- emacs/.emacs | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/emacs/.emacs b/emacs/.emacs index 8364ef1..802d597 100644 --- a/emacs/.emacs +++ b/emacs/.emacs @@ -76,28 +76,38 @@ (defun term-split () "creates terminal window below" (interactive) - (select-window (split-window-below -7)) - (term "/bin/zsh")) + (let (window (split-window-below -7)) + (select-window window) + (term "/bin/zsh") + (set-window-dedicated-p window t))) (global-set-key (kbd "C-x t") 'term-split) ;; Kill term buffer on exit -;; (defun term-handle-exit--close-buffer (&rest args) -;; (when (null (get-buffer-process (current-buffer))) -;; (kill-buffer (current-buffer)))) -;; -;; (advice-add 'term-handle-exit :after #'term-handle-exit--close-buffer) +;(defun term-handle-exit--close-buffer (&rest args) +; (when (null (get-buffer-process (current-buffer))) +; (progn +; (let (window (get-buffer-window (current-buffer)) +; (when (window-dedicated-p )) +; (kill-buffer (current-buffer)) +; Fix... -;; Latex german -;; (defun latex-german-umlauts () -;; "Sets keys like ä to write \"a" -;; (message "Latex German Umlauts loaded.") -;; (defun local-map (key ins) -;; (local-set-key (kbd key) (lambda () (interactive) `(insert v)))) -;; (local-map "ä" "\"a")) -;; ;;(local-set-key (kbd "ä") (lambda () (interactive) (insert "\"a"))) -;; -;; (add-hook 'latex-mode-hook 'latex-german-umlauts) +; (advice-add 'term-handle-exit :after #'term-handle-exit--close-buffer) + +; Latex german +(defun evil-is-insert () (string= evil-state "insert")) +(defun latex-german-umlauts () + "Sets keys like ä to write \"a" + (message "Latex German Umlauts loaded.") + (local-set-key (kbd "ä") (lambda () (interactive) (when (evil-is-insert) (insert "\"a")))) + (local-set-key (kbd "ö") (lambda () (interactive) (when (evil-is-insert) (insert "\"o")))) + (local-set-key (kbd "ü") (lambda () (interactive) (when (evil-is-insert) (insert "\"u")))) + (local-set-key (kbd "Ä") (lambda () (interactive) (when (evil-is-insert) (insert "\"A")))) + (local-set-key (kbd "Ö") (lambda () (interactive) (when (evil-is-insert) (insert "\"O")))) + (local-set-key (kbd "Ü") (lambda () (interactive) (when (evil-is-insert) (insert "\"U")))) + (local-set-key (kbd "ß") (lambda () (interactive) (when (evil-is-insert) (insert "\"s"))))) + +(add-hook 'latex-mode-hook 'latex-german-umlauts) ;; Split windows horizontally preferred (setq split-height-threshold 6)