emacs - cleanup

This commit is contained in:
madmaurice 2017-10-14 13:01:05 +02:00
parent d15d53117e
commit c591c68dad

View file

@ -452,15 +452,6 @@
(add-hook 'global-undo-tree-mode-hook (add-hook 'global-undo-tree-mode-hook
(lambda () (linum-mode -1)))) (lambda () (linum-mode -1))))
;; Easy terminal
(setq my/default-shell (or (executable-find "zsh") (executable-find "bash")))
;;(use-package shell-pop
;; :ensure t
;; :bind ("C-x t" . shell-pop)
;; :config
;; (setq-default shell-pop-term-shell my/default-shell))
;; tabbing ;; tabbing
(setq-default tab-width 4) (setq-default tab-width 4)
(setq-default LateX-indent-level 4) (setq-default LateX-indent-level 4)
@ -502,12 +493,6 @@
(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)
; 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)
; Whitespace mode toggle ; Whitespace mode toggle
(global-set-key (kbd "C-x C-l") 'whitespace-mode) (global-set-key (kbd "C-x C-l") 'whitespace-mode)
(defalias 'wsm 'whitespace-mode) (defalias 'wsm 'whitespace-mode)
@ -517,26 +502,17 @@
(interactive) (interactive)
(select-window (next-window))) (select-window (next-window)))
(global-set-key (kbd "<C-tab>") 'cycle-window) ;; (defun check-for-open-buffers ()
;; (interactive)
;; Exit prompt ;; (or (dolist
;; (defun foreach (alist func) ;; (buffer (buffer-list))
;; (while alist ;; (cond
;; (progn ;; ((string-match "^\\*.*\\*$" (buffer-name buffer))
;; (funcall func (car alist)) ;; nil)
;; (setq alist (cdr alist))))) ;; ((null (buffer-modified-p buffer))
;; nil)
(defun check-for-open-buffers () ;; (t
(interactive) ;; (yes-or-no-p (format "Buffer %s is open. Exit anyway?" (buffer-name buffer))))))))
(or (dolist
(buffer (buffer-list))
(cond
((string-match "^\\*.*\\*$" (buffer-name buffer))
nil)
((null (buffer-modified-p buffer))
nil)
(t
(yes-or-no-p (format "Buffer %s is open. Exit anyway?" (buffer-name buffer))))))))
;; Latex german ;; Latex german
(quail-define-package "latex-german" "UTF-8" "LaGe" t (quail-define-package "latex-german" "UTF-8" "LaGe" t
@ -588,11 +564,6 @@
;; 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 date time, german format
(defun datetime-german ()
(interactive)
(insert (format-time-string "%d.%m.%Y %H:%M")))
;; Insert time, german format ;; Insert time, german format
(defun time-german () (defun time-german ()
(interactive) (interactive)
@ -600,37 +571,7 @@
(global-set-key (kbd "C-c C-d") 'time-german) (global-set-key (kbd "C-c C-d") 'time-german)
(defun fefe ()
(interactive)
(eww "https://blog.fefe.de"))
;; 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)))
;; Load local emacs settings ;; Load local emacs settings
(let ((local-config (concat user-emacs-directory "init.local"))) (let ((local-config (concat user-emacs-directory "init.local")))
(when (file-exists-p (concat local-config ".el")) (when (file-exists-p (concat local-config ".el"))
(load local-config))) (load local-config)))