From 240312dd2159021e23d21aa8d57cffc871c98889 Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Sat, 20 May 2017 01:42:12 +0200 Subject: [PATCH] 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 ()