Mehr emacs gebastel
This commit is contained in:
parent
7f2af47756
commit
240312dd21
1 changed files with 35 additions and 10 deletions
45
emacs/.emacs
45
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 <up>") 'windmove-up)
|
||||
(global-set-key (kbd "C-x <down>") 'windmove-down)
|
||||
(global-set-key (kbd "C-x <left>") 'windmove-left)
|
||||
(global-set-key (kbd "C-x <right>") 'windmove-right)
|
||||
; Old keys
|
||||
(global-set-key (kbd "C-x <up>") 'nope)
|
||||
(global-set-key (kbd "C-x <down>") 'nope)
|
||||
(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 ()
|
||||
"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 ()
|
||||
|
|
Loading…
Reference in a new issue