Mehr emacs spaß
This commit is contained in:
parent
388643d07f
commit
1fec2949ee
1 changed files with 41 additions and 1 deletions
42
emacs/.emacs
42
emacs/.emacs
|
@ -44,17 +44,26 @@
|
||||||
(or (file-exists-p package-user-dir)
|
(or (file-exists-p package-user-dir)
|
||||||
(package-refresh-contents))
|
(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)
|
(require 'evil)
|
||||||
(evil-mode t)
|
(evil-mode t)
|
||||||
|
|
||||||
|
;; auto-complete
|
||||||
|
(require 'auto-complete)
|
||||||
|
(require 'auto-complete-config)
|
||||||
|
(ac-config-default)
|
||||||
|
|
||||||
;; Window movement
|
;; Window movement
|
||||||
(global-set-key (kbd "C-x <up>") 'windmove-up)
|
(global-set-key (kbd "C-x <up>") 'windmove-up)
|
||||||
(global-set-key (kbd "C-x <down>") 'windmove-down)
|
(global-set-key (kbd "C-x <down>") 'windmove-down)
|
||||||
(global-set-key (kbd "C-x <left>") 'windmove-left)
|
(global-set-key (kbd "C-x <left>") 'windmove-left)
|
||||||
(global-set-key (kbd "C-x <right>") 'windmove-right)
|
(global-set-key (kbd "C-x <right>") 'windmove-right)
|
||||||
|
|
||||||
|
;; Magit
|
||||||
|
(global-set-key (kbd "C-x g") 'magit-status)
|
||||||
|
|
||||||
;; Window cycling
|
;; Window cycling
|
||||||
(defun cycle-window ()
|
(defun cycle-window ()
|
||||||
"cycles windows"
|
"cycles windows"
|
||||||
|
@ -63,6 +72,37 @@
|
||||||
|
|
||||||
(global-set-key (kbd "<C-tab>") 'cycle-window)
|
(global-set-key (kbd "<C-tab>") '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
|
;; Overlay windows
|
||||||
(add-to-list 'display-buffer-alist
|
(add-to-list 'display-buffer-alist
|
||||||
'("*Apropos*" display-buffer-same-window))
|
'("*Apropos*" display-buffer-same-window))
|
||||||
|
|
Loading…
Reference in a new issue