Mehr emacs gebastel

This commit is contained in:
madmaurice 2017-05-20 01:42:12 +02:00
parent 7f2af47756
commit 240312dd21

View file

@ -4,6 +4,9 @@
;; Quote ;; 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") (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 ;; Default frame size
(setq initial-frame-alist (setq initial-frame-alist
'( '(
@ -101,16 +104,15 @@
;; Neotree ;; Neotree
(use-package neotree (use-package neotree
:ensure t :ensure t
:demand t
:bind ("C-x n" . neotree-show) :bind ("C-x n" . neotree-show)
:config :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 "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 "RET") 'neotree-enter)
(evil-define-key 'normal neotree-mode-map (kbd "q") 'neotree-hide) (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 ;; Cursor centered
@ -130,6 +132,7 @@
(use-package avy (use-package avy
:ensure t :ensure t
:demand t :demand t
: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))))
@ -152,6 +155,10 @@
(use-package term (use-package term
:bind ("C-x t" . term-split)) :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) ;; tabbing (doesn't really work yet)
(setq-default indent-tabs-mode t) (setq-default indent-tabs-mode t)
(setq-default tab-width 4) (setq-default tab-width 4)
@ -196,11 +203,22 @@
(add-hook 'compilation-mode-hook 'my-compilation-hook) (add-hook 'compilation-mode-hook 'my-compilation-hook)
(defun nope ()
(interactive)
(message "Nope! Nope! Nope!"))
;; Window movement ;; Window movement
(global-set-key (kbd "C-x <up>") 'windmove-up) ; Old keys
(global-set-key (kbd "C-x <down>") 'windmove-down) (global-set-key (kbd "C-x <up>") 'nope)
(global-set-key (kbd "C-x <left>") 'windmove-left) (global-set-key (kbd "C-x <down>") 'nope)
(global-set-key (kbd "C-x <right>") 'windmove-right) (global-set-key (kbd "C-x <left>") 'nope)
(global-set-key (kbd "C-x <right>") 'nope)
; New keys
(global-set-key (kbd "<M-up>") 'windmove-up)
(global-set-key (kbd "<M-down>") 'windmove-down)
(global-set-key (kbd "<M-left>") 'windmove-left)
(global-set-key (kbd "<M-right>") 'windmove-right)
(defun cycle-window () (defun cycle-window ()
"cycles windows" "cycles windows"
@ -258,6 +276,13 @@
;; 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)
;; 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 ;; Comment fun
;(defun extend-comment () ;(defun extend-comment ()