From 1b6ed7988b6f6789c0c2e4248ea94a51a35a6a11 Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Mon, 15 May 2017 01:35:31 +0200 Subject: [PATCH 01/29] Emacs configuration --- emacs/.emacs | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 emacs/.emacs diff --git a/emacs/.emacs b/emacs/.emacs new file mode 100644 index 0000000..d606d1e --- /dev/null +++ b/emacs/.emacs @@ -0,0 +1,34 @@ +(package-initialize) + +(require 'package) + +(push '("marmalade" . "http://marmalade-repo.org/packages/") package-archives) +(push '("melpa" . "http://melpa.milkbox.net/packages/") package-archives) + +(package-initialize) +(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. + '(ansi-color-faces-vector + [default default default italic underline success warning error]) + '(blink-cursor-mode nil) + '(custom-enabled-themes (quote (wombat))) + '(global-evil-surround-mode t) + '(inhibit-startup-screen t) + '(menu-bar-mode nil) + '(package-selected-packages + (quote + (evil-surround org evil-magit magit makefile-runner evil))) + '(scroll-bar-mode nil) + '(tool-bar-mode nil)) +(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 :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 113 :width normal :foundry "PfEd" :family "Inconsolata"))))) + +(require 'evil) +(evil-mode t) From 3914272d3d000ed3399454409ea49d5e553f065c Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Mon, 15 May 2017 01:52:29 +0200 Subject: [PATCH 02/29] Fixed emacs --- emacs/.emacs | 1 - 1 file changed, 1 deletion(-) diff --git a/emacs/.emacs b/emacs/.emacs index d606d1e..e191b7a 100644 --- a/emacs/.emacs +++ b/emacs/.emacs @@ -5,7 +5,6 @@ (push '("marmalade" . "http://marmalade-repo.org/packages/") package-archives) (push '("melpa" . "http://melpa.milkbox.net/packages/") package-archives) -(package-initialize) (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. From 388643d07f7678c2c3e3ae9520473d98438d56ed Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Mon, 15 May 2017 14:25:35 +0200 Subject: [PATCH 03/29] Automatic package installation :) --- emacs/.emacs | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/emacs/.emacs b/emacs/.emacs index d606d1e..02a8ce6 100644 --- a/emacs/.emacs +++ b/emacs/.emacs @@ -1,11 +1,21 @@ (package-initialize) +(defun ensure-packages-installed (packages) + "Ensure packages are installed" + (mapcar + (lambda (package) + (if (package-installed-p package) + nil + (if (y-or-n-p (format "Package %s is missing. Install it? " package)) + (package-install package) + package))) + packages)) + (require 'package) (push '("marmalade" . "http://marmalade-repo.org/packages/") package-archives) (push '("melpa" . "http://melpa.milkbox.net/packages/") package-archives) -(package-initialize) (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. @@ -30,5 +40,31 @@ ;; If there is more than one, they won't work right. '(default ((t (:inherit nil :stipple nil :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 113 :width normal :foundry "PfEd" :family "Inconsolata"))))) +;; ensure repo cache is up1date +(or (file-exists-p package-user-dir) + (package-refresh-contents)) + +(ensure-packages-installed '(org evil evil-surround magit evil-magit)) + (require 'evil) (evil-mode t) + +;; Window movement +(global-set-key (kbd "C-x ") 'windmove-up) +(global-set-key (kbd "C-x ") 'windmove-down) +(global-set-key (kbd "C-x ") 'windmove-left) +(global-set-key (kbd "C-x ") 'windmove-right) + +;; Window cycling +(defun cycle-window () + "cycles windows" + (interactive) + (select-window (next-window))) + +(global-set-key (kbd "") 'cycle-window) + +;; Overlay windows +(add-to-list 'display-buffer-alist + '("*Apropos*" display-buffer-same-window)) +(add-to-list 'display-buffer-alist + '("*Help*" display-buffer-same-window)) From 1fec2949eebab412230312adc725f5e0d98e77e8 Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Mon, 15 May 2017 18:22:09 +0200 Subject: [PATCH 04/29] =?UTF-8?q?Mehr=20emacs=20spa=C3=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- emacs/.emacs | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/emacs/.emacs b/emacs/.emacs index 02a8ce6..8364ef1 100644 --- a/emacs/.emacs +++ b/emacs/.emacs @@ -44,17 +44,26 @@ (or (file-exists-p package-user-dir) (package-refresh-contents)) -(ensure-packages-installed '(org evil evil-surround magit evil-magit)) +(ensure-packages-installed '(org evil evil-surround magit evil-magit auto-complete)) +;; Evil mode <3 (require 'evil) (evil-mode t) +;; auto-complete +(require 'auto-complete) +(require 'auto-complete-config) +(ac-config-default) + ;; Window movement (global-set-key (kbd "C-x ") 'windmove-up) (global-set-key (kbd "C-x ") 'windmove-down) (global-set-key (kbd "C-x ") 'windmove-left) (global-set-key (kbd "C-x ") 'windmove-right) +;; Magit +(global-set-key (kbd "C-x g") 'magit-status) + ;; Window cycling (defun cycle-window () "cycles windows" @@ -63,6 +72,37 @@ (global-set-key (kbd "") 'cycle-window) +;; Easy terminal +(defun term-split () + "creates terminal window below" + (interactive) + (select-window (split-window-below -7)) + (term "/bin/zsh")) + +(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) + +;; 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) + +;; Split windows horizontally preferred +(setq split-height-threshold 6) +(setq split-width-threshold 20) + ;; Overlay windows (add-to-list 'display-buffer-alist '("*Apropos*" display-buffer-same-window)) From bd4026de0f1a4067ba0cc0ef05be26d384f92fe1 Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Tue, 16 May 2017 00:48:57 +0200 Subject: [PATCH 05/29] 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) From ca7dd305a342e31d33d58038305bfec19be86055 Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Tue, 16 May 2017 00:50:46 +0200 Subject: [PATCH 06/29] Removed emacs alias --- zsh/.zsh/03-aliases.zsh | 1 - 1 file changed, 1 deletion(-) diff --git a/zsh/.zsh/03-aliases.zsh b/zsh/.zsh/03-aliases.zsh index 4dad63c..9bd5055 100644 --- a/zsh/.zsh/03-aliases.zsh +++ b/zsh/.zsh/03-aliases.zsh @@ -1,6 +1,5 @@ alias ls="ls --color=auto --quoting-style=literal" alias ll="ls -l" alias la="ls -la" -alias emacs="vim" alias lf="ls -l" alias laf="ls -al" From 8fc72b14d10185fa43f6cd5a68a700db9748b7a4 Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Tue, 16 May 2017 08:12:04 +0200 Subject: [PATCH 07/29] yasnippet added to emacs --- emacs/.emacs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/emacs/.emacs b/emacs/.emacs index 802d597..4592918 100644 --- a/emacs/.emacs +++ b/emacs/.emacs @@ -30,7 +30,7 @@ '(menu-bar-mode nil) '(package-selected-packages (quote - (evil-surround org evil-magit magit makefile-runner evil))) + (yasnippet evil-surround org evil-magit magit makefile-runner evil))) '(scroll-bar-mode nil) '(tool-bar-mode nil)) (custom-set-faces @@ -55,6 +55,10 @@ (require 'auto-complete-config) (ac-config-default) +;; Yasnippet +(require 'yasnippet) +(yas-global-mode 1) + ;; Window movement (global-set-key (kbd "C-x ") 'windmove-up) (global-set-key (kbd "C-x ") 'windmove-down) @@ -76,10 +80,10 @@ (defun term-split () "creates terminal window below" (interactive) - (let (window (split-window-below -7)) + (let ((window (split-window-below -7))) (select-window window) - (term "/bin/zsh") - (set-window-dedicated-p window t))) + (term "/bin/zsh"))) + ;(set-window-dedicated-p window t))) (global-set-key (kbd "C-x t") 'term-split) From 078dc3b90bf0da4899f096ae14fae178443d2bf8 Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Tue, 16 May 2017 19:24:48 +0200 Subject: [PATCH 08/29] =?UTF-8?q?Mehr=20emacs=20spa=C3=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- emacs/.emacs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/emacs/.emacs b/emacs/.emacs index 4592918..a485176 100644 --- a/emacs/.emacs +++ b/emacs/.emacs @@ -23,8 +23,13 @@ ;; If there is more than one, they won't work right. '(ansi-color-faces-vector [default default default italic underline success warning error]) + '(ansi-color-names-vector + ["#242424" "#e5786d" "#95e454" "#cae682" "#8ac6f2" "#333366" "#ccaa8f" "#f6f3e8"]) '(blink-cursor-mode nil) - '(custom-enabled-themes (quote (wombat))) + '(custom-enabled-themes (quote (heroku))) + '(custom-safe-themes + (quote + ("4f2ede02b3324c2f788f4e0bad77f7ebc1874eff7971d2a2c9b9724a50fb3f65" default))) '(global-evil-surround-mode t) '(inhibit-startup-screen t) '(menu-bar-mode nil) @@ -44,7 +49,12 @@ (or (file-exists-p package-user-dir) (package-refresh-contents)) -(ensure-packages-installed '(org evil evil-surround magit evil-magit auto-complete)) +;; Install packages +(ensure-packages-installed '(org evil evil-surround magit evil-magit auto-complete yasnippet)) + +;; tabbing +(setq-default indent-tabs-mode t) +(setq-default tab-width 4) ;; Evil mode <3 (require 'evil) From 40e95992de986bbfaaa2d7a898999b7097739772 Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Wed, 17 May 2017 20:43:49 +0200 Subject: [PATCH 09/29] Refactored emacs config to use "use-package" --- emacs/.emacs | 132 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 77 insertions(+), 55 deletions(-) diff --git a/emacs/.emacs b/emacs/.emacs index a485176..46d6d64 100644 --- a/emacs/.emacs +++ b/emacs/.emacs @@ -1,16 +1,4 @@ (package-initialize) -(defun ensure-packages-installed (packages) - "Ensure packages are installed" - (mapcar - (lambda (package) - (if (package-installed-p package) - nil - (if (y-or-n-p (format "Package %s is missing. Install it? " package)) - (package-install package) - package))) - packages)) - - (require 'package) (push '("marmalade" . "http://marmalade-repo.org/packages/") package-archives) @@ -49,25 +37,61 @@ (or (file-exists-p package-user-dir) (package-refresh-contents)) -;; Install packages -(ensure-packages-installed '(org evil evil-surround magit evil-magit auto-complete yasnippet)) +;; Install use-package +(defun ensure-package-installed (package) + "Ensure packages are installed" + (if (package-installed-p package) + nil + (progn + (package-refresh-contents) + (package-install package)))) -;; tabbing -(setq-default indent-tabs-mode t) -(setq-default tab-width 4) +(ensure-package-installed 'use-package) -;; Evil mode <3 -(require 'evil) -(evil-mode t) +;; Org-mode +(use-package org + :ensure t) -;; auto-complete -(require 'auto-complete) -(require 'auto-complete-config) -(ac-config-default) +;; Evil-mode +(use-package evil + :ensure t + :demand t + :config (evil-mode 1)) + +;; Auto-Complete +(use-package auto-complete + :ensure t + :demand t + :config (progn + (require 'auto-complete-config) + (ac-config-default))) ;; Yasnippet -(require 'yasnippet) -(yas-global-mode 1) +(use-package yasnippet + :demand t + :config (yas-global-mode 1)) + +;; Magit +(use-package magit + :bind ("C-x g" . magit-status)) + +;; Easy terminal +(setq my/default-shell (or (executable-find "zsh") (executable-find "bash"))) + +(defun term-split () + "creates terminal window below" + (interactive) + (let ((window (split-window-below -7))) + (select-window window) + (term my/default-shell))) + +(use-package term + :bind ("C-x t" . term-split)) + +;; tabbing (doesn't really work yet) +(setq-default indent-tabs-mode t) +(setq-default tab-width 4) +(setq-default LateX-indent-level 4) ;; Window movement (global-set-key (kbd "C-x ") 'windmove-up) @@ -75,10 +99,6 @@ (global-set-key (kbd "C-x ") 'windmove-left) (global-set-key (kbd "C-x ") 'windmove-right) -;; Magit -(global-set-key (kbd "C-x g") 'magit-status) - -;; Window cycling (defun cycle-window () "cycles windows" (interactive) @@ -86,17 +106,6 @@ (global-set-key (kbd "") 'cycle-window) -;; Easy terminal -(defun term-split () - "creates terminal window below" - (interactive) - (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))) @@ -108,27 +117,40 @@ ; (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"))))) +;; Latex german +(quail-define-package "latex-german" "UTF-8" "LaGe" t + "Transforms umlauts to the better latex notation. +ä -> \"a +ö -> \"o +ü -> \"u +Ä -> \"A +Ö -> \"O +Ü -> \"U +ß -> \"s" + nil t nil nil nil nil nil nil nil nil t) +(quail-define-rules + ("ä" ["\"a"]) + ("ö" ["\"o"]) + ("ü" ["\"u"]) + ("Ä" ["\"A"]) + ("Ö" ["\"O"]) + ("Ü" ["\"U"]) + ("ß" ["\"s"]) +) -(add-hook 'latex-mode-hook 'latex-german-umlauts) +(add-hook 'latex-mode-hook (lambda () + (set-input-method "latex-german") + (local-set-key "\"" 'self-insert-command))) ;; Split windows horizontally preferred (setq split-height-threshold 6) (setq split-width-threshold 20) -;; Overlay windows +;; Overlay windows (What does it do?) (add-to-list 'display-buffer-alist '("*Apropos*" display-buffer-same-window)) (add-to-list 'display-buffer-alist '("*Help*" display-buffer-same-window)) + +;; Change all prompts to y or n +(fset 'yes-or-no-p 'y-or-n-p) From b5c423e426235989ae75b05130b6d37f612c226c Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Wed, 17 May 2017 20:44:30 +0200 Subject: [PATCH 10/29] vim snippet for tex: frame --- vim/.vim/snippets/tex.snippets | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vim/.vim/snippets/tex.snippets b/vim/.vim/snippets/tex.snippets index 7397ca6..b2d4709 100644 --- a/vim/.vim/snippets/tex.snippets +++ b/vim/.vim/snippets/tex.snippets @@ -115,7 +115,11 @@ snippet section ${1:Section}~\ref{${2:sec:}}${3} snippet page ${1:page}~\pageref{${2}}${3} - +snippet frame + \begin{frame} + \frametitle{${1:Title}} + ${2} + \end{frame} snippet title \title{${1}} \author{${2}} From a931425b048325cd8358d41e5e7713701dc33125 Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Thu, 18 May 2017 00:49:00 +0200 Subject: [PATCH 11/29] Mehr emacs gebastel. ivy und avy. --- emacs/.emacs | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/emacs/.emacs b/emacs/.emacs index 46d6d64..2e7abec 100644 --- a/emacs/.emacs +++ b/emacs/.emacs @@ -1,7 +1,10 @@ (package-initialize) (require 'package) -(push '("marmalade" . "http://marmalade-repo.org/packages/") package-archives) +;; Quote +(setq initial-scratch-message ";; Simplicity and elegance are unpopular because\n;; they require hard work and discipline to achieve\n;; and education to be appreciated.\n;;\n;; - Dijkstra") + +;(push '("marmalade" . "http://marmalade-repo.org/packages/") package-archives) (push '("melpa" . "http://melpa.milkbox.net/packages/") package-archives) (custom-set-variables @@ -17,13 +20,13 @@ '(custom-enabled-themes (quote (heroku))) '(custom-safe-themes (quote - ("4f2ede02b3324c2f788f4e0bad77f7ebc1874eff7971d2a2c9b9724a50fb3f65" default))) + ("4f2ede02b3324c2f788f4e0bad77f7ebc1874eff7971d2a2c9b9724a50fb3f65" default))) '(global-evil-surround-mode t) '(inhibit-startup-screen t) '(menu-bar-mode nil) '(package-selected-packages (quote - (yasnippet evil-surround org evil-magit magit makefile-runner evil))) + (ivy avy heroku-theme auto-complete use-package yasnippet evil-surround org evil-magit magit makefile-runner evil))) '(scroll-bar-mode nil) '(tool-bar-mode nil)) (custom-set-faces @@ -31,7 +34,7 @@ ;; 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 :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 113 :width normal :foundry "PfEd" :family "Inconsolata"))))) + ) ;; ensure repo cache is up1date (or (file-exists-p package-user-dir) @@ -48,6 +51,11 @@ (ensure-package-installed 'use-package) + +;; theme +(use-package heroku-theme + :ensure t) + ;; Org-mode (use-package org :ensure t) @@ -66,13 +74,30 @@ (require 'auto-complete-config) (ac-config-default))) +(use-package ivy + :ensure t + :demand t + :config (progn + (ivy-mode 1) + (setq ivy-use-virtual-buffers t) + (setq ivy-count-format "(%d/%d) "))) + ;; Yasnippet (use-package yasnippet :demand t :config (yas-global-mode 1)) +;; avy +(use-package avy + :ensure t + :demand t + :bind ("C-s" . avy-goto-word-0) + :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)))) + ;; Magit (use-package magit + :ensure t :bind ("C-x g" . magit-status)) ;; Easy terminal From c85d971ca5e2a41e2a89de71eb4054ef2197a57f Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Thu, 18 May 2017 00:56:47 +0200 Subject: [PATCH 12/29] Added more line break because why not. --- emacs/.emacs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs/.emacs b/emacs/.emacs index 2e7abec..3f052f1 100644 --- a/emacs/.emacs +++ b/emacs/.emacs @@ -2,7 +2,7 @@ (require 'package) ;; Quote -(setq initial-scratch-message ";; Simplicity and elegance are unpopular because\n;; they require hard work and discipline to achieve\n;; and education to be appreciated.\n;;\n;; - Dijkstra") +(setq initial-scratch-message ";; Simplicity and elegance are unpopular because\n;; they require hard work and discipline to achieve\n;; and education to be appreciated.\n;;\n;; - Dijkstra\n\n") ;(push '("marmalade" . "http://marmalade-repo.org/packages/") package-archives) (push '("melpa" . "http://melpa.milkbox.net/packages/") package-archives) From b5c25d963787da655e8231cadf4192bfbbf49b8a Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Thu, 18 May 2017 01:47:57 +0200 Subject: [PATCH 13/29] Added snippets to git --- emacs/.emacs.d/snippets/latex-mode/item | 6 ++++++ emacs/.emacs.d/snippets/latex-mode/itemize | 10 ++++++++++ 2 files changed, 16 insertions(+) create mode 100644 emacs/.emacs.d/snippets/latex-mode/item create mode 100644 emacs/.emacs.d/snippets/latex-mode/itemize diff --git a/emacs/.emacs.d/snippets/latex-mode/item b/emacs/.emacs.d/snippets/latex-mode/item new file mode 100644 index 0000000..cedcd92 --- /dev/null +++ b/emacs/.emacs.d/snippets/latex-mode/item @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: item +# key: it +# -- +\item $1 +$0 \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/latex-mode/itemize b/emacs/.emacs.d/snippets/latex-mode/itemize new file mode 100644 index 0000000..befcb96 --- /dev/null +++ b/emacs/.emacs.d/snippets/latex-mode/itemize @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: itemize +# key: item +# -- +\begin{itemize} + +\item $1 +$0 + +\end{itemize} \ No newline at end of file From 42ba9e1f0816552243c60fd9fb6d8470ca78665f Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Thu, 18 May 2017 01:48:46 +0200 Subject: [PATCH 14/29] ivy key und dired options --- emacs/.emacs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/emacs/.emacs b/emacs/.emacs index 3f052f1..c2abc11 100644 --- a/emacs/.emacs +++ b/emacs/.emacs @@ -4,6 +4,13 @@ ;; Quote (setq initial-scratch-message ";; Simplicity and elegance are unpopular because\n;; they require hard work and discipline to achieve\n;; and education to be appreciated.\n;;\n;; - Dijkstra\n\n") +;; Default frame size +(setq initial-frame-alist + '( + (width . 110) + (height . 40) + )) + ;(push '("marmalade" . "http://marmalade-repo.org/packages/") package-archives) (push '("melpa" . "http://melpa.milkbox.net/packages/") package-archives) @@ -80,10 +87,12 @@ :config (progn (ivy-mode 1) (setq ivy-use-virtual-buffers t) - (setq ivy-count-format "(%d/%d) "))) + (setq ivy-count-format "(%d/%d) ") + (define-key ivy-minibuffer-map (kbd "") 'ivy-immediate-done))) ;; Yasnippet (use-package yasnippet + :ensure t :demand t :config (yas-global-mode 1)) From f84cf623d31707750c225037fe79520b2c84a366 Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Thu, 18 May 2017 20:07:04 +0200 Subject: [PATCH 15/29] =?UTF-8?q?Mehr=20snippets=20und=20zeuch=20f=C3=BCr?= =?UTF-8?q?=20emacs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- emacs/.emacs | 44 ++++++++++++++++++++- emacs/.emacs.d/snippets/latex-mode/lstinput | 6 +++ emacs/.emacs.d/snippets/latex-mode/verb | 5 +++ 3 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 emacs/.emacs.d/snippets/latex-mode/lstinput create mode 100644 emacs/.emacs.d/snippets/latex-mode/verb diff --git a/emacs/.emacs b/emacs/.emacs index c2abc11..10cebd9 100644 --- a/emacs/.emacs +++ b/emacs/.emacs @@ -58,7 +58,6 @@ (ensure-package-installed 'use-package) - ;; theme (use-package heroku-theme :ensure t) @@ -71,7 +70,9 @@ (use-package evil :ensure t :demand t - :config (evil-mode 1)) + :config + (evil-mode 1) + (setq evil-ex-substitute-global t)) ;; Auto-Complete (use-package auto-complete @@ -127,6 +128,45 @@ (setq-default tab-width 4) (setq-default LateX-indent-level 4) +;; Activate line numbers +(global-linum-mode t) + +;; compilation buffer +; Set buffer scrolling +(setq compilation-scroll-output 'first-error) + +; kill window if successfull +;(defun bury-compile-buffer-if-successful (buffer string) +; "Bury a compilation buffer if succeeded without warnings " +; (when (and +; (buffer-live-p buffer) +; (string-match "compilation" (buffer-name buffer)) +; (string-match "finished" string) +; (not +; (with-current-buffer buffer +; (goto-char (point-min)) +; (search-forward "warning" nil t)))) +; (run-with-timer 1 nil +; (lambda (buf) +; (bury-buffer buf) +; (switch-to-prev-buffer (get-buffer-window buf) 'kill)) +; buffer))) +;(add-hook 'compilation-finish-functions 'bury-compile-buffer-if-successful) +; set window height +(setq compilation-window-height 10) + +(defun my-compilation-hook () + (when (not (get-buffer-window "*compilation*")) + (save-selected-window + (save-excursion + (let* ((w (split-window-vertically)) + (h (window-height w))) + (select-window w) + (switch-to-buffer "*compilation*") + (shrink-window (- h compilation-window-height))))))) +(add-hook 'compilation-mode-hook 'my-compilation-hook) + + ;; Window movement (global-set-key (kbd "C-x ") 'windmove-up) (global-set-key (kbd "C-x ") 'windmove-down) diff --git a/emacs/.emacs.d/snippets/latex-mode/lstinput b/emacs/.emacs.d/snippets/latex-mode/lstinput new file mode 100644 index 0000000..50e9071 --- /dev/null +++ b/emacs/.emacs.d/snippets/latex-mode/lstinput @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: lstinput +# key: lstinput +# -- +\lstinputlisting[$2,label=file:$1]{$1} +$0 diff --git a/emacs/.emacs.d/snippets/latex-mode/verb b/emacs/.emacs.d/snippets/latex-mode/verb new file mode 100644 index 0000000..789d3a7 --- /dev/null +++ b/emacs/.emacs.d/snippets/latex-mode/verb @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: verb +# key: verb +# -- +\verb+$1+ $0 \ No newline at end of file From f0585dbdbff4cbf3e20c8e16f13b7fdace483fef Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Fri, 19 May 2017 00:16:17 +0200 Subject: [PATCH 16/29] Added centered-cursor-mode --- emacs/.emacs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/emacs/.emacs b/emacs/.emacs index 10cebd9..75a7f83 100644 --- a/emacs/.emacs +++ b/emacs/.emacs @@ -33,7 +33,7 @@ '(menu-bar-mode nil) '(package-selected-packages (quote - (ivy avy heroku-theme auto-complete use-package yasnippet evil-surround org evil-magit magit makefile-runner evil))) + (centered-cursor-mode ivy avy heroku-theme auto-complete use-package yasnippet evil-surround org evil-magit magit makefile-runner evil))) '(scroll-bar-mode nil) '(tool-bar-mode nil)) (custom-set-faces @@ -82,6 +82,7 @@ (require 'auto-complete-config) (ac-config-default))) +;; ivy (use-package ivy :ensure t :demand t @@ -91,6 +92,12 @@ (setq ivy-count-format "(%d/%d) ") (define-key ivy-minibuffer-map (kbd "") 'ivy-immediate-done))) +;; Cursor centered +(use-package centered-cursor-mode + :ensure t + :demand t + :config (global-centered-cursor-mode)) + ;; Yasnippet (use-package yasnippet :ensure t From 6ee435a6627c582657a24aae1613f05b8fd3cda2 Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Fri, 19 May 2017 20:42:54 +0200 Subject: [PATCH 17/29] =?UTF-8?q?Mehr=20foo=20f=C3=BCr=20emacs.=20latex-mo?= =?UTF-8?q?de=20will=20noch=20nicht=20so=20ganz.....?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- emacs/.emacs | 19 +++++++++++++++++++ .../snippets/latex-mode/description-env | 11 +++++++++++ emacs/.emacs.d/snippets/latex-mode/emph | 5 +++++ emacs/.emacs.d/snippets/latex-mode/item-desc | 6 ++++++ 4 files changed, 41 insertions(+) create mode 100644 emacs/.emacs.d/snippets/latex-mode/description-env create mode 100644 emacs/.emacs.d/snippets/latex-mode/emph create mode 100644 emacs/.emacs.d/snippets/latex-mode/item-desc diff --git a/emacs/.emacs b/emacs/.emacs index 75a7f83..41299ce 100644 --- a/emacs/.emacs +++ b/emacs/.emacs @@ -58,6 +58,9 @@ (ensure-package-installed 'use-package) +;; *.tex files are Latex-Files +(add-to-list 'auto-mode-alist '("\\.py\\'" . LaTeX-mode)) + ;; theme (use-package heroku-theme :ensure t) @@ -92,10 +95,26 @@ (setq ivy-count-format "(%d/%d) ") (define-key ivy-minibuffer-map (kbd "") 'ivy-immediate-done))) +;; Neotree +(use-package neotree + :ensure t + :demand t + :bind ("C-x n" . neotree-show) + :config + (evil-define-key 'normal neotree-mode-map (kbd "TAB") 'neotree-enter) + (evil-define-key 'normal neotree-mode-map (kbd "SPC") 'neotree-enter) + (evil-define-key 'normal neotree-mode-map (kbd "RET") 'neotree-enter) + (evil-define-key 'normal neotree-mode-map (kbd "q") 'neotree-hide) + (add-hook 'neo-enter-hook + (lambda (type path arg) (if (equal type 'file) + (neotree-hide))))) + + ;; Cursor centered (use-package centered-cursor-mode :ensure t :demand t + :disabled :config (global-centered-cursor-mode)) ;; Yasnippet diff --git a/emacs/.emacs.d/snippets/latex-mode/description-env b/emacs/.emacs.d/snippets/latex-mode/description-env new file mode 100644 index 0000000..e42b9ed --- /dev/null +++ b/emacs/.emacs.d/snippets/latex-mode/description-env @@ -0,0 +1,11 @@ +# -*- mode: snippet -*- +# name: description-env +# key: desc +# -- +\begin{description} + +\item[$1] $2 + +$0 + +\end{description} \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/latex-mode/emph b/emacs/.emacs.d/snippets/latex-mode/emph new file mode 100644 index 0000000..6f6762f --- /dev/null +++ b/emacs/.emacs.d/snippets/latex-mode/emph @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: emph +# key: emph +# -- +\emph{$1} $0 \ No newline at end of file diff --git a/emacs/.emacs.d/snippets/latex-mode/item-desc b/emacs/.emacs.d/snippets/latex-mode/item-desc new file mode 100644 index 0000000..43555c4 --- /dev/null +++ b/emacs/.emacs.d/snippets/latex-mode/item-desc @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: item-desc +# key: itd +# -- +\item[$1] $2 +$0 \ No newline at end of file From 7f2af47756fb8998d5f7d411a8b47f918e1c80b2 Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Fri, 19 May 2017 23:55:58 +0200 Subject: [PATCH 18/29] Elisp gebastel --- emacs/.emacs | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/emacs/.emacs b/emacs/.emacs index 41299ce..be19edc 100644 --- a/emacs/.emacs +++ b/emacs/.emacs @@ -33,7 +33,7 @@ '(menu-bar-mode nil) '(package-selected-packages (quote - (centered-cursor-mode ivy avy heroku-theme auto-complete use-package yasnippet evil-surround org evil-magit magit makefile-runner evil))) + (neotree centered-cursor-mode ivy avy heroku-theme auto-complete use-package yasnippet evil-surround org evil-magit magit makefile-runner evil))) '(scroll-bar-mode nil) '(tool-bar-mode nil)) (custom-set-faces @@ -61,6 +61,9 @@ ;; *.tex files are Latex-Files (add-to-list 'auto-mode-alist '("\\.py\\'" . LaTeX-mode)) +;; show parens +(show-paren-mode t) + ;; theme (use-package heroku-theme :ensure t) @@ -254,3 +257,28 @@ ;; Change all prompts to y or n (fset 'yes-or-no-p 'y-or-n-p) + +;; Comment fun + +;(defun extend-comment () +; (interactive) +; (if (looking-back "//" (line-beginning-position)) +; (progn +; (newline-and-indent) +; (insert "Hallo Welt")) +; (newline-and-indent))) + +;; Show in binary and decimal + +;(defun hex-popup () +; (interactive) +; (let (hexStr p1 p2) +; (save-excursion +; (search-backward-regexp "[^0-9A-Fa-f]" nil t) +; (forward-char) +; (setq p1 (point)) +; (search-forward-regexp "[^0-9A-Fa-f]" nil t) +; (backward-char) +; (setq p2 (point))) +; (setq hexStr (buffer-substring-no-properties p1 p2)) +; (message "The hex number is: '%s' '%d' '%d'" hexStr p1 p2))) From 240312dd2159021e23d21aa8d57cffc871c98889 Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Sat, 20 May 2017 01:42:12 +0200 Subject: [PATCH 19/29] Mehr emacs gebastel --- emacs/.emacs | 45 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 10 deletions(-) diff --git a/emacs/.emacs b/emacs/.emacs index be19edc..1459f38 100644 --- a/emacs/.emacs +++ b/emacs/.emacs @@ -4,6 +4,9 @@ ;; Quote (setq initial-scratch-message ";; Simplicity and elegance are unpopular because\n;; they require hard work and discipline to achieve\n;; and education to be appreciated.\n;;\n;; - Dijkstra\n\n") +;; Set frame title +(setq frame-title-format "[%m] %f") + ;; Default frame size (setq initial-frame-alist '( @@ -101,16 +104,15 @@ ;; Neotree (use-package neotree :ensure t - :demand t :bind ("C-x n" . neotree-show) :config + (setq neo-theme 'ascii) + (evil-define-key 'normal neotree-mode-map (kbd "+") 'neotree-create-node) + (evil-define-key 'normal neotree-mode-map (kbd "d") 'neotree-delete-node) + (evil-define-key 'normal neotree-mode-map (kbd "c") 'neotree-rename-node) (evil-define-key 'normal neotree-mode-map (kbd "TAB") 'neotree-enter) - (evil-define-key 'normal neotree-mode-map (kbd "SPC") 'neotree-enter) (evil-define-key 'normal neotree-mode-map (kbd "RET") 'neotree-enter) - (evil-define-key 'normal neotree-mode-map (kbd "q") 'neotree-hide) - (add-hook 'neo-enter-hook - (lambda (type path arg) (if (equal type 'file) - (neotree-hide))))) + (evil-define-key 'normal neotree-mode-map (kbd "q") 'neotree-hide)) ;; Cursor centered @@ -130,6 +132,7 @@ (use-package avy :ensure t :demand t + :disabled :bind ("C-s" . avy-goto-word-0) :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)))) @@ -152,6 +155,10 @@ (use-package term :bind ("C-x t" . term-split)) +(defadvice term-handle-exit + (after term-kill-buffer-on-exit activate) + (quit-window)) + ;; tabbing (doesn't really work yet) (setq-default indent-tabs-mode t) (setq-default tab-width 4) @@ -196,11 +203,22 @@ (add-hook 'compilation-mode-hook 'my-compilation-hook) +(defun nope () + (interactive) + (message "Nope! Nope! Nope!")) + ;; Window movement -(global-set-key (kbd "C-x ") 'windmove-up) -(global-set-key (kbd "C-x ") 'windmove-down) -(global-set-key (kbd "C-x ") 'windmove-left) -(global-set-key (kbd "C-x ") 'windmove-right) +; Old keys +(global-set-key (kbd "C-x ") 'nope) +(global-set-key (kbd "C-x ") 'nope) +(global-set-key (kbd "C-x ") 'nope) +(global-set-key (kbd "C-x ") 'nope) + +; New keys +(global-set-key (kbd "") 'windmove-up) +(global-set-key (kbd "") 'windmove-down) +(global-set-key (kbd "") 'windmove-left) +(global-set-key (kbd "") 'windmove-right) (defun cycle-window () "cycles windows" @@ -258,6 +276,13 @@ ;; Change all prompts to y or n (fset 'yes-or-no-p 'y-or-n-p) +;; Insert time, german format +(defun datetime-german () + (interactive) + (insert (format-time-string "%d.%m.%Y %H:%M"))) + +(global-set-key (kbd "C-c C-d") 'datetime-german) + ;; Comment fun ;(defun extend-comment () From 1334c9e7977d3e5f4b627578edd825dcdb0b5150 Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Sat, 20 May 2017 02:07:33 +0200 Subject: [PATCH 20/29] Mehr --- emacs/.emacs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/emacs/.emacs b/emacs/.emacs index 1459f38..9d21103 100644 --- a/emacs/.emacs +++ b/emacs/.emacs @@ -14,7 +14,6 @@ (height . 40) )) -;(push '("marmalade" . "http://marmalade-repo.org/packages/") package-archives) (push '("melpa" . "http://melpa.milkbox.net/packages/") package-archives) (custom-set-variables @@ -62,11 +61,14 @@ (ensure-package-installed 'use-package) ;; *.tex files are Latex-Files -(add-to-list 'auto-mode-alist '("\\.py\\'" . LaTeX-mode)) +(add-to-list 'auto-mode-alist '("\\.tex\\'" . latex-mode)) ;; show parens (show-paren-mode t) +;; highlight line +(global-hl-line-mode) + ;; theme (use-package heroku-theme :ensure t) From cf23241f81e9a03387b9ff6592f56959378459f0 Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Sat, 20 May 2017 13:55:46 +0200 Subject: [PATCH 21/29] Emacs: Added key for refreshing neotree --- emacs/.emacs | 1 + 1 file changed, 1 insertion(+) diff --git a/emacs/.emacs b/emacs/.emacs index 9d21103..567d7e5 100644 --- a/emacs/.emacs +++ b/emacs/.emacs @@ -110,6 +110,7 @@ :config (setq neo-theme 'ascii) (evil-define-key 'normal neotree-mode-map (kbd "+") 'neotree-create-node) + (evil-define-key 'normal neotree-mode-map (kbd "g") 'neotree-refresh) (evil-define-key 'normal neotree-mode-map (kbd "d") 'neotree-delete-node) (evil-define-key 'normal neotree-mode-map (kbd "c") 'neotree-rename-node) (evil-define-key 'normal neotree-mode-map (kbd "TAB") 'neotree-enter) From 9b4d1b4ab49180039863676b2f3a03cc01cee6cd Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Sat, 20 May 2017 14:49:34 +0200 Subject: [PATCH 22/29] Test --- emacs/.emacs | 1 + 1 file changed, 1 insertion(+) diff --git a/emacs/.emacs b/emacs/.emacs index 567d7e5..7ff1cdb 100644 --- a/emacs/.emacs +++ b/emacs/.emacs @@ -167,6 +167,7 @@ (setq-default tab-width 4) (setq-default LateX-indent-level 4) + ;; Activate line numbers (global-linum-mode t) From c0204a32a5f4d72c5c6d9e794b4e3aad233223d2 Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Sat, 20 May 2017 18:03:06 +0200 Subject: [PATCH 23/29] Farben und easy term --- emacs/.emacs | 47 +++++++++++++++++++++-------------------------- 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/emacs/.emacs b/emacs/.emacs index 7ff1cdb..c536b5f 100644 --- a/emacs/.emacs +++ b/emacs/.emacs @@ -43,7 +43,9 @@ ;; 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. - ) + '(neo-dir-link-face ((t (:foreground "#fce94f")))) + '(neo-expand-btn-face ((t (:foreground "#ffe070")))) + '(neo-root-dir-face ((t (:foreground "#fff3c6" :weight bold))))) ;; ensure repo cache is up1date (or (file-exists-p package-user-dir) @@ -103,6 +105,11 @@ (setq ivy-count-format "(%d/%d) ") (define-key ivy-minibuffer-map (kbd "") 'ivy-immediate-done))) +;; swiper +(use-package swiper + :ensure t + :bind ("C-s" . swiper)) + ;; Neotree (use-package neotree :ensure t @@ -153,21 +160,25 @@ (interactive) (let ((window (split-window-below -7))) (select-window window) - (term my/default-shell))) + (term my/default-shell) + (set-window-dedicated-p window t))) (use-package term :bind ("C-x t" . term-split)) -(defadvice term-handle-exit - (after term-kill-buffer-on-exit activate) - (quit-window)) +(defun term-handle-exit--close-buffer (&rest args) + (let ((term-window (get-buffer-window "*terminal*"))) + (when (and term-window (window-dedicated-p term-window)) + (delete-window term-window)))) + +(advice-add 'term-handle-exit :after #'term-handle-exit--close-buffer) + ;; tabbing (doesn't really work yet) (setq-default indent-tabs-mode t) (setq-default tab-width 4) (setq-default LateX-indent-level 4) - ;; Activate line numbers (global-linum-mode t) @@ -206,17 +217,12 @@ (shrink-window (- h compilation-window-height))))))) (add-hook 'compilation-mode-hook 'my-compilation-hook) - -(defun nope () - (interactive) - (message "Nope! Nope! Nope!")) - ;; Window movement ; Old keys -(global-set-key (kbd "C-x ") 'nope) -(global-set-key (kbd "C-x ") 'nope) -(global-set-key (kbd "C-x ") 'nope) -(global-set-key (kbd "C-x ") 'nope) +(global-set-key (kbd "C-x ") 'windmove-up) +(global-set-key (kbd "C-x ") 'windmove-down) +(global-set-key (kbd "C-x ") 'windmove-left) +(global-set-key (kbd "C-x ") 'windmove-right) ; New keys (global-set-key (kbd "") 'windmove-up) @@ -231,17 +237,6 @@ (global-set-key (kbd "") 'cycle-window) -;; Kill term buffer on exit -;(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... - -; (advice-add 'term-handle-exit :after #'term-handle-exit--close-buffer) - ;; Latex german (quail-define-package "latex-german" "UTF-8" "LaGe" t "Transforms umlauts to the better latex notation. From f7c34059e431e60a64da4ea6ec4ea3346e6a70ff Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Sat, 20 May 2017 18:04:56 +0200 Subject: [PATCH 24/29] Vim zeuch von Zeit an der Studienarbeit --- vim/.vimrc | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/vim/.vimrc b/vim/.vimrc index 051c086..50e4ad3 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -61,7 +61,7 @@ set tm=500 set encoding=utf8 "Always use utf8 set ffs=unix,dos,mac " Auto use EOL according to file set noswapfile -set expandtab "Tabbing +set noexpandtab " No spaces just Tabs set smarttab " Deleting and creating spaces representing tabs set ai "auto indent set si "smart indent @@ -95,6 +95,16 @@ set listchars=eol:↲,tab:▶▹,nbsp:␣,extends:…,trail:• " --- Latex {{{ au BufRead,BufNewFile *.tex set ft=tex +au FileType tex inoremap " " +au FileType tex inoremap ä "a +au FileType tex inoremap ö "o +au FileType tex inoremap ü "u +au FileType tex inoremap Ä "A +au FileType tex inoremap Ö "O +au FileType tex inoremap Ü "U +au FileType tex inoremap ß "s +au FileType tex inoremap "" \quot{}i + " }}} " --- Abbreviations {{{ @@ -191,7 +201,6 @@ nnoremap i :set list! " Vimux nnoremap rr :call RunCmdVimux() nnoremap rq :call VimuxCloseRunner() -nnoremap ; :call AddSemicolon() nnoremap t :g/TODO/ nnoremap :TigStatus " 0 should find first non blank @@ -215,7 +224,7 @@ nnoremap Q @@ inoremap nnoremap vnoremap -" -- Make Y behave correct +" -- Make Y behave correctly map Y y$ " -- Quick adding of spaces nnoremap il @@ -297,6 +306,7 @@ map F (easymotion-Fl) " --- Auto pairs config {{{ let g:lexima_enable_basic_rules = 1 " }}} -" --- Codestyle {{{ -au BufRead,BufNewFile *.{cpp,hpp,h} match ErrorMsg '\%>80v.\+' -" }}} + +set ts=4 +set noet + From f9ed99da4240e2808a8b39bfa241cde1d7d98151 Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Sat, 20 May 2017 20:39:29 +0200 Subject: [PATCH 25/29] Latex keybindings --- emacs/.emacs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/emacs/.emacs b/emacs/.emacs index c536b5f..df29c57 100644 --- a/emacs/.emacs +++ b/emacs/.emacs @@ -65,6 +65,11 @@ ;; *.tex files are Latex-Files (add-to-list 'auto-mode-alist '("\\.tex\\'" . latex-mode)) +;; Extra Latex keybindings +(defun my/latex-keybindings () + (define-key latex-mode-map (kbd "") 'recompile)) +(add-hook 'latex-mode-hook 'my/latex-keybindings) + ;; show parens (show-paren-mode t) From 049bbb9cb6bb572c85067e0ba81ad03139914408 Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Sun, 21 May 2017 20:51:52 +0200 Subject: [PATCH 26/29] swiper mapping in evil --- emacs/.emacs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/emacs/.emacs b/emacs/.emacs index df29c57..03a3779 100644 --- a/emacs/.emacs +++ b/emacs/.emacs @@ -90,7 +90,8 @@ :demand t :config (evil-mode 1) - (setq evil-ex-substitute-global t)) + (setq evil-ex-substitute-global t) + (define-key evil-normal-state-map "/" 'swiper)) ;; Auto-Complete (use-package auto-complete From 719edc48d8debbc4a1e5fc55b0784aec4738c70d Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Sun, 21 May 2017 21:17:42 +0200 Subject: [PATCH 27/29] Zeuch --- emacs/.emacs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs/.emacs b/emacs/.emacs index df29c57..a55dab6 100644 --- a/emacs/.emacs +++ b/emacs/.emacs @@ -35,7 +35,7 @@ '(menu-bar-mode nil) '(package-selected-packages (quote - (neotree centered-cursor-mode ivy avy heroku-theme auto-complete use-package yasnippet evil-surround org evil-magit magit makefile-runner evil))) + (swiper neotree centered-cursor-mode ivy avy heroku-theme auto-complete use-package yasnippet evil-surround org evil-magit magit makefile-runner evil))) '(scroll-bar-mode nil) '(tool-bar-mode nil)) (custom-set-faces From 1cbc91baba76b5d569da930464614c230b93cba9 Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Mon, 22 May 2017 11:22:46 +0200 Subject: [PATCH 28/29] powerline --- emacs/.emacs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/emacs/.emacs b/emacs/.emacs index 5bf6c07..aa14199 100644 --- a/emacs/.emacs +++ b/emacs/.emacs @@ -45,7 +45,14 @@ ;; If there is more than one, they won't work right. '(neo-dir-link-face ((t (:foreground "#fce94f")))) '(neo-expand-btn-face ((t (:foreground "#ffe070")))) - '(neo-root-dir-face ((t (:foreground "#fff3c6" :weight bold))))) + '(neo-root-dir-face ((t (:foreground "#fff3c6" :weight bold)))) + '(powerline-active1 ((t (:inherit mode-line)))) + '(powerline-active2 ((t (:inherit mode-line)))) + '(powerline-evil-emacs-face ((t (:inherit powerline-evil-base-face :background "gray30" :foreground "white")))) + '(powerline-evil-insert-face ((t (:inherit powerline-evil-base-face :background "forest green")))) + '(powerline-evil-motion-face ((t (:inherit powerline-evil-base-face :background "white" :foreground "black")))) + '(powerline-evil-normal-face ((t (:inherit powerline-evil-base-face :background "white" :foreground "grey22")))) + '(powerline-evil-replace-face ((t (:inherit powerline-evil-base-face :background "dark red"))))) ;; ensure repo cache is up1date (or (file-exists-p package-user-dir) @@ -76,6 +83,17 @@ ;; highlight line (global-hl-line-mode) +;; powerline +(use-package powerline + :ensure t + :demand t) + +(use-package powerline-evil + :ensure t + :demand t + :config + (powerline-evil-vim-color-theme)) + ;; theme (use-package heroku-theme :ensure t) From d14f72a18855bbd2fe848cab7a6fe73b594a030d Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Mon, 22 May 2017 17:49:28 +0200 Subject: [PATCH 29/29] Zeug --- emacs/.emacs | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/emacs/.emacs b/emacs/.emacs index aa14199..7b72730 100644 --- a/emacs/.emacs +++ b/emacs/.emacs @@ -83,6 +83,16 @@ ;; highlight line (global-hl-line-mode) +;; shackle +;(defun my/shackle-rules () +; (setq shackle-rules +; '((term-mode :select t :align 'below :size 0.2)))) +; +;(use-package shackle +; :ensure t +; :demand t +; :config '(my/shackle-rules)) + ;; powerline (use-package powerline :ensure t @@ -109,7 +119,8 @@ :config (evil-mode 1) (setq evil-ex-substitute-global t) - (define-key evil-normal-state-map "/" 'swiper)) + (define-key evil-normal-state-map "/" 'swiper) + (setq-default evil-cross-lines t)) ;; Auto-Complete (use-package auto-complete @@ -186,17 +197,26 @@ (select-window window) (term my/default-shell) (set-window-dedicated-p window t))) +; +;(use-package term +; :bind ("C-x t" . term-split)) +; +;(defun term-handle-exit--close-buffer (&rest args) +; (let ((term-window (get-buffer-window "*terminal*"))) +; (when (and term-window (window-dedicated-p term-window)) +; (delete-window term-window)))) + +;(advice-add 'term-handle-exit :after #'term-handle-exit--close-buffer) + +;(add-to-list 'display-buffer-alist +; '("\\*terminal\\*" display-buffer-pop-up-window)) + +(defun my/term () + (interactive) + (term my/default-shell)) (use-package term - :bind ("C-x t" . term-split)) - -(defun term-handle-exit--close-buffer (&rest args) - (let ((term-window (get-buffer-window "*terminal*"))) - (when (and term-window (window-dedicated-p term-window)) - (delete-window term-window)))) - -(advice-add 'term-handle-exit :after #'term-handle-exit--close-buffer) - + :bind ("C-x t" . my/term)) ;; tabbing (doesn't really work yet) (setq-default indent-tabs-mode t)