Hinzu kommt auch mein problem, dass scheinbar immer wieder "externe Module" in die Datei schreiben und mir die Übersicht nehmen.
Von der Funktionalität her, kommt es mir auf elpy (Python), evil-mode (vim Tastenkürzel) und zetteldeft (Zettelkasten) an.
Der Inhalt ist aus Blogs und Wikis zusammengestöpselt, ohne sicher zu sein, ob das so OK ist.
Code: Alles auswählen
;; =================
;; Package setup
;; =================
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
;; Initializes the package infrastructure
(package-initialize)
;; If there are no archived package contents, refresh them
(when (not package-archive-contents)
(package-refresh-contents))
;; Install packages
;; (notice: Pythons-stuff as elpy or flycheck are installed via apt-get install elpa-elpy)
(defvar myPackages
'(better-defaults
recentf
init-open-recentf
evil
material-theme
smooth-scrolling
deft
zetteldeft
)
)
;; Scans the list in myPackages
;; Install the package if not already installed
(mapc #'(lambda (package)
(unless (package-installed-p package)
(package-install package)))
myPackages)
;; =====================
;; Emacs basic setup
;; ====================
(setq inhibit-startup-message t) ;; Hide the startup message
(load-theme 'material t) ;; Load material theme
(global-linum-mode t) ;; Enable line numbers globally
(setq linum-format "%d ")
(setq line-number-mode t) ;; Line number in status bar
(setq column-number-mode t) ;; Column number in status bar
(setq make-backup-files nil) ;; No backup files
(scroll-bar-mode nil) ;; No scroll bar
(tool-bar-mode nil) ;; no toolbar
(transient-mark-mode t) ;; Textmarkierung sichtbar
(setq x-stretch-cursor t) ;; stretch cursor on tabs
;; automatic line wrap
(setq-default auto-fill-function 'do-auto-fill) ;; automatic line wrap
(setq-default fill-column 78) ;; wrap at max 78th char
;;(global-set-key (kbd "C-c q") 'auto-fill-mode) ;; toggle auto fill mode
(global-hl-line-mode 1)
;;
(require 'smooth-scrolling)
(smooth-scrolling-mode 1)
;;(setq smooth-scroll-margin 3)
;; ==========
;; Evil mode
;; ==========
(evil-mode 1) ;; vi keys on emacs
;; =============
;; Recent files
;; =============
(recentf-mode 1)
(setq recentf-max-menu-items 25)
(setq recentf-max-saved-items 25)
(global-set-key "\C-x\ \C-r" 'recentf-open-files) ;; C-x C-r to open recent files
(run-at-time nil (* 5 60) 'recentf-save-list) ;; auto-save recent fileslist every 5 minutes
(init-open-recentf)
;; ===============
;; Python setup
;; ===============
;; Enable elpy
(elpy-enable)
;; deactivate virtuelenv
(setq elpy-rpc-virtualenv-path 'current)
;; folding
(add-hook 'python-mode-hook 'hs-minor-mode)
;; eldoc (comes with elpy)
(setq eldoc-echo-area-use-multiline-p nil) ;; mini-buffer doc nur 1-zeilig
;; on-the-fly syntax check not so fast
(setq flymake-no-changes-timeout 35)
;; "error in process filter" problem when writing doc-strings
;; see for details: https://emacs.stackexchange.com/a/63852/12999
(setq elpy-eldoc-show-current-function nil)
;; ===============
;; Zetteldeft
;; ===============
;; basic deft
(use-package deft
:ensure t
:custom
(deft-extensions '("org" "md" "txt"))
(deft-directory "~/tab-cloud/zettel")
(deft-use-filename-as-title t)
(deft-file-nameing-rules
’((nospace . "_"))
)
)
(use-package zetteldeft
:ensure t
:after deft
:config (zetteldeft-set-classic-keybindings))
;; ================
;; Custom
;; ================
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(column-number-mode t)
'(elpy-autodoc-delay 0.5)
'(elpy-rpc-python-command "python3")
'(package-selected-packages
'(zetteldeft jedi flymake ## smooth-scrolling material-theme evil better-defaults yasnippet-snippets elpy))
'(python-shell-interpreter "python3"))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:family "Fira Code" :foundry "CTDB" :slant normal :weight normal :height 113 :width normal)))))