From 4398c381e6637d71da5938833ccc2c592c6fb2cf Mon Sep 17 00:00:00 2001 From: Marc Date: Sat, 14 Dec 2019 18:44:04 +0000 Subject: [PATCH 01/36] * init.el: fixed org-journal error for work config --- init.org | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/init.org b/init.org index 6c2cb54..007a0fe 100644 --- a/init.org +++ b/init.org @@ -115,7 +115,6 @@ ("work_remote" (progn (defvar MY--PATH_ORG_FILES "p:/Eigene Dateien/Notizen/") - (defvar MY--PATH-ORG-JOURNAL "p:/Eigene Dateien/Notizen/Journal/") (defvar MY--PATH_START "p:/Eigene Dateien/Notizen/")))) (setq bookmark-default-file (concat MY--PATH_USER_LOCAL "bookmarks")) @@ -465,12 +464,13 @@ Vorerst deaktiviert, Nutzen evtl. nicht vorhanden [[https://github.com/bastibe/org-journal][Source]] #+BEGIN_SRC emacs-lisp +(unless (string-equal me/whoami "work-remote") (use-package org-journal :ensure t :defer t - :custom - (org-journal-dir MY--PATH_ORG_JOURNAl) - (org-journal-enable-agenda-integration t)) + :config + (setq org-journal-dir MY--PATH_ORG_JOURNAL + org-journal-enable-agenda-integration t))) #+END_SRC * ivy / counsel / swiper :PROPERTIES: From 811020609043f4ceb18932a68ece8ead81cb30e8 Mon Sep 17 00:00:00 2001 From: Marc Date: Sat, 14 Dec 2019 18:51:13 +0000 Subject: [PATCH 02/36] fixed compiler error for windows specific settings --- init.org | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/init.org b/init.org index 007a0fe..35d0265 100644 --- a/init.org +++ b/init.org @@ -162,10 +162,12 @@ Some windows specific stuff (progn (setq gc-cons-threshold (* 511 1024 1024) gc-cons-percentage 0.5 - garbage-collection-messages t - w32-pipe-read-delay 0 - w32-get-true-file-attributes nil) - (run-with-idle-timer 5 t #'garbage-collect))) + garbage-collection-messages t) + (run-with-idle-timer 5 t #'garbage-collect)) + (when (boundp 'w32-pipe-read-delay) + (setq w32-pipe-read-delay 0)) + (when (boundp 'w32-get-true-file-attributes) + (setq )w32-get-true-file-attributes nil)) #+END_SRC * visuals ** Font From 7e1a94f7b2044d1b9e65d662d64ce28ca7e7d964 Mon Sep 17 00:00:00 2001 From: Marc Date: Sat, 14 Dec 2019 18:59:21 +0000 Subject: [PATCH 03/36] fixed compiler error for custom function --- init.org | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/init.org b/init.org index 35d0265..2662525 100644 --- a/init.org +++ b/init.org @@ -771,24 +771,25 @@ Manage projects and jump quickly between its files https://github.com/emacs-lsp/lsp-mode#install-language-server #+BEGIN_SRC emacs-lisp - (if (string-equal system-type "gnu/linux") - (use-package pyvenv - :ensure t - :config - (setenv "WORKON_HOME" (expand-file-name "~/Archiv/Programmierprojekte/Python/virtualenv/")) - (add-hook 'pyvenv-post-activate-hooks #'my/postactivatehook)) - (defun my/postactivatehook () - (setq lsp-python-ms-extra-paths pyvenv-virtual-env)) - - (use-package virtualenvwrapper - :ensure t - :hook (venv-postmkvirtualenv . (lambda() (shell-command "pip3 install importmagic epc"))) - :config - (setq venv-location (expand-file-name "~/Archiv/Programmierprojekte/Python/virtualenv/"))) - - (use-package lsp-python-ms - :ensure t - :after lsp-mode python)) +(if (string-equal system-type "gnu/linux") + (defun my/postactivatehook () + (setq lsp-python-ms-extra-paths pyvenv-virtual-env)) + + (use-package pyvenv + :ensure t + :config + (setenv "WORKON_HOME" (expand-file-name "~/Archiv/Programmierprojekte/Python/virtualenv/")) + (add-hook 'pyvenv-post-activate-hooks 'my/postactivatehook)) + + (use-package virtualenvwrapper + :ensure t + :hook (venv-postmkvirtualenv . (lambda() (shell-command "pip3 install importmagic epc"))) + :config + (setq venv-location (expand-file-name "~/Archiv/Programmierprojekte/Python/virtualenv/"))) + + (use-package lsp-python-ms + :ensure t + :after lsp-mode python)) ; :custom (lsp-python-executable-cmd "python3")) From b9aca1a9961819e64080c5e0e9a1566d90955c93 Mon Sep 17 00:00:00 2001 From: Marc Pohling Date: Thu, 19 Dec 2019 08:08:19 +0100 Subject: [PATCH 04/36] removed init.el --- init.el | 539 -------------------------------------------------------- 1 file changed, 539 deletions(-) delete mode 100644 init.el diff --git a/init.el b/init.el deleted file mode 100644 index c0872f1..0000000 --- a/init.el +++ /dev/null @@ -1,539 +0,0 @@ - (defun me/tangle-init () - "If the current buffer is 'init.org', - the code blocks are tangled, and the tangled file is compiled." - (when (equal (buffer-file-name) - (expand-file-name (concat user-emacs-directory "init.org"))) - ;; avoid running hooks - (let ((prog-mode-hook nil)) - (org-babel-tangle) - (byte-compile-file (concat user-emacs-directory "init.el")) - (load-file user-init-file)))) - (add-hook 'after-save-hook 'me/tangle-init) - - (require 'package) - - ;; bug before emacs 26.3 - (when (version< emacs-version "26.3") - (setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")) - (add-to-list 'package-archives '("elpa" . "https://elpa.gnu.org/packages/") t) - (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) - (add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/") t) - (add-to-list 'package-archives '("org" . "https://orgmode.org/elpa/") t) - - (package-initialize) - - (unless (package-installed-p 'use-package) - (package-refresh-contents) - (package-install 'use-package)) - - (setq use-package-verbose nil) - - (eval-when-compile - (require 'use-package)) - (require 'bind-key) - (use-package diminish - :ensure t) - - (defvar me/whoami - (if (string-equal (system-name) "PMTS01") - "work_remote" - (if (string-equal (system-name) "laptop") - "home_laptop" - (if (string-equal (system-name) "PMPCNEU08") - "work_local" - "home_desktop")))) - - (defvar MY--PATH_USER_LOCAL (expand-file-name "~/.emacs.d/user-local/")) - (defvar MY--PATH_USER_GLOBAL (expand-file-name "~/.emacs.d/user-global/")) - (pcase me/whoami - ("home" - (progn - (defvar MY--PATH_ORG_FILES (expand-file-name "~/Archiv/Organisieren/")) - (defvar MY--PATH_ORG_FILES_MOBILE (expand-file-name "~/Archiv/Organisieren/mobile/")) - (defvar MY--PATH_ORG_JOURNAl (expand-file-name "~/Archiv/Organisieren/Journal/")))) - ("home_laptop" - (progn - (defvar MY--PATH_ORG_FILES (expand-file-name "~/Archiv/Organisieren/")) - (defvar MY--PATH_ORG_FILES_MOBILE (expand-file-name "~/Archiv/Organisieren/mobile/")) - (defvar MY--PATH_ORG_JOURNAL (expand-file-name "~/Archiv/Organisieren/Journal/")))) - ("work_remote" - (progn - (defvar MY--PATH_ORG_FILES "p:/Eigene Dateien/Notizen/") - (defvar MY--PATH-ORG-JOURNAL "p:/Eigene Dateien/Notizen/Journal/") - (defvar MY--PATH_START "p:/Eigene Dateien/Notizen/")))) - - (setq bookmark-default-file (concat MY--PATH_USER_LOCAL "bookmarks")) - (setq recentf-save-file (concat MY--PATH_USER_LOCAL "recentf")) - (setq custom-file (concat MY--PATH_USER_LOCAL "custom.el")) ;; don't spam init.e with saved customization settings - (setq abbrev-file-name (concat MY--PATH_USER_GLOBAL "abbrev_defs")) - (setq backup-directory-alist `((".*" . ,temporary-file-directory))) - (setq auto-save-file-name-transforms `((".*" ,temporary-file-directory))) - (setq save-abbrevs 'silently) ;; don't bother me with asking for abbrev saving - (setq-default create-lockfiles nil) ;; disable lock files, can cause trouble in e.g. lsp-mode - (defalias 'yes-or-no-p 'y-or-n-p) ;; answer with y and n - (setq custom-safe-themes t) ;; don't ask me if I want to load a theme - (setq sentence-end-double-space nil) ;; don't coun two spaces after a period as the end of a sentence. - (delete-selection-mode t) ;; delete selected region when typing - (save-place-mode 1) ;; saves position in file when it's closed - (setq save-place-forget-unreadable-files nil) ;; checks if file is readable before saving position - - (setq locale-coding-system 'utf-8) - (set-terminal-coding-system 'utf-8) - (set-keyboard-coding-system 'utf-8) - (set-selection-coding-system 'utf-8) - (if (eq system-type 'windows-nt) - (prefer-coding-system 'utf-8-dos) - (prefer-coding-system 'utf-8)) - (blink-cursor-mode -1) ;; turn off blinking cursor - (show-paren-mode t) ;; show other part of brackets - (column-number-mode t) - (setq uniquify-buffer-name-style 'forward) - (setq-default indent-tabs-mode nil) ;; avoid tabs in place of multiple spaces (they look bad in tex) - (setq-default indicate-empty-lines t) ;; show empty lines - (setq scroll-margin 5 ;; smooth scrolling - scroll-conservatively 10000 - scroll-preserve-screen-position 1 - scroll-step 1) - (global-hl-line-mode t) ;; highlight current line - (menu-bar-mode 0) ;; disable menu bar - (tool-bar-mode 0) ;; disable tool bar - (scroll-bar-mode 0) ;; disable scroll bar - - (when (eq system-type 'windows-nt) - (remove-hook 'find-file-hooks 'vc-refresh-state) - (progn - (setq gc-cons-threshold (* 511 1024 1024) - gc-cons-percentage 0.5 - garbage-collection-messages t - w32-pipe-read-delay 0 - w32-get-true-file-attributes nil) - (run-with-idle-timer 5 t #'garbage-collect))) - - (if (string-equal system-type "gnu/linux") - (set-face-font 'default "Hack-10")) - - (global-visual-line-mode) - (diminish 'visual-line-mode) - (use-package adaptive-wrap - :ensure t - :config - (add-hook 'visual-line-mode-hook #'adaptive-wrap-prefix-mode)) - ; :init - ; (when (fboundp 'adaptive-wrap-prefix-mode) - ; (defun my/activate-adaptive-wrap-prefix-mode () - ; "Toggle `visual-line-mode' and `adaptive-wrap-prefix-mode' simultaneously." - ; (adaptive-wrap-prefix-mode (if visual-line-mode 1 -1))) - ; (add-hook 'visual-line-mode-hook 'my/activate-adaptive-wrap-prefix-mode))) - - (use-package display-line-numbers - :init - (add-hook 'prog-mode-hook 'display-line-numbers-mode) - (add-hook 'org-src-mode-hook 'display-line-numbers-mode) - :config - (setq-default display-line-numbers-type 'visual - display-line-numbers-current-absolute t - display-line-numbers-with 4 - display-line-numbers-widen t)) - ; (add-hook 'emacs-lisp-mode-hook 'display-line-numbers-mode) - - (use-package rainbow-mode - :ensure t - :diminish - :hook ((org-mode - emacs-lisp-mode) . rainbow-mode)) - -(use-package undo-tree -:ensure t -:diminish undo-tree-mode -:init -(global-undo-tree-mode 1)) - -(use-package imenu-list - :ensure t - :config - (setq imenu-list-focus-after-activation t - imenu-list-auto-resize t - imenu-list-position 'right) - :bind - (:map global-map - ([f9] . imenu-list-smart-toggle)) - ) - - (use-package which-key - :ensure t - :diminish which-key-mode - :config - (which-key-mode) - (which-key-setup-side-window-right-bottom) - (which-key-setup-minibuffer) - (setq which-key-idle-delay 0.5)) - - (use-package evil - :ensure t - :defer .1 ;; don't block emacs when starting, load evil immediately after startup - :config - (evil-mode 1)) - - (use-package general - :ensure t) - - (general-define-key - :states 'normal - :keymaps 'imenu-list-major-mode-map - (kbd "RET") '(imenu-list-goto-entry :which-key "goto") - (kbd "TAB") '(hs-toggle-hiding :which-key "collapse") - "d" '(imenu-list-display-entry :which-key "show") - "q" '(imenu-list-quit-window :which-key "quit")) - -(use-package org - :ensure org-plus-contrib - :mode (("\.org$" . org-mode)) - :init - (add-hook 'org-mode-hook 'company/org-mode-hook) - (add-hook 'org-src-mode-hook 'smartparens-mode) - :config - (setq org-modules (quote (org-id - org-habit - ))) - (setq org-default-notes-file (concat MY--PATH_ORG_FILES "notes.org") - org-agenda-files (list MY--PATH_ORG_FILES - MY--PATH_ORG_FILES_MOBILE) - org-id-locations-file (concat MY--PATH_USER_LOCAL ".org-id-locations") - org-log-into-drawer "LOGBOOK") - - ;; some display customizations - (setq org-pretty-entities t - org-startup-truncated t - org-startup-align-all-tables t) - - ;; some source code blocks customizations - (setq org-src-window-setup 'current-window ;; C-c ' opens in current window - org-src-fontify-natively t ;; use syntax highlighting in code blocks - org-src-preserve-indentation t ;; no extra indentation - org-src-tab-acts-natively t)) - - (org-babel-do-load-languages - 'org-babel-load-languages - '((emacs-lisp . t) - (gnuplot . t) - (js . t) - (latex . t) - (lisp . t) - (python . t) - (shell . t) - (sqlite . t) - (org . t) - (R . t) - (scheme . t) - )) - - (defun me--org-confirm-babel-evaluate (lang body) - "Do not confirm evaluation for these languages." - (not (or (string= lang "python") - (string= lang "ipython") - (string= lang "emacs-lisp") - (string= lang "R") - (string= lang "latex") - (string= lang "sqlite")))) - (setq org-confirm-babel-evaluate 'me--org-confirm-babel-evaluate) - - (require 'org-habit) ;;TODO Lösung ohne require finden, scheint mir nicht ideal zu sein, nur um ein org-modul zu aktivieren -;; (add-to-list 'org-modules "org-habit") - (setq org-habit-graph-column 80 - org-habit-preceding-days 30 - org-habit-following-days 7 - org-habit-show-habits-only-for-today nil) - - (use-package org-id - :config - (setq org-id-link-to-org-use-id t) - (org-id-update-id-locations)) ;; update id file .org-id-locations on startup - -(pcase me/whoami - ("work_remote") - (setq org-todo-keywords - '((sequence "OPEN" "TODO" "UNCLEAR" "|" "DONE" "IMPOSSIBLE")))) - -(bind-key "C-c l" 'org-store-link) -(bind-key "C-c c" 'org-capture) -(bind-key "C-c a" 'org-agenda) - -(setq org-agenda-sorting-strategy - (quote - ((agenda deadline-up priority-down) - (todo priority-down category-keep) - (tags priority-down category-keep) - (search category-keep)))) - -(defun me--org-skip-subtree-if-priority (priority) - "Skip an agenda subtree if it has a priority of PRIORITY. - - PRIORITY may be one of the characters ?A, ?B, or ?C." - (let ((subtree-end (save-excursion (org-end-of-subtree t))) - (pri-value (* 1000 (- org-lowest-priority priority))) - (pri-current (org-get-priority (thing-at-point 'line t)))) - (if (= pri-value pri-current) - subtree-end - nil))) - -(setq org-agenda-custom-commands - '(("c" "Simple agenda view" - ((tags "PRIORITY=\"A\"" - ((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done)) - (org-agenda-overriding-header "Hohe Priorität:"))) - (agenda "" - ((org-agenda-span 7) - (org-agenda-start-on-weekday nil) - (org-agenda-overriding-header "Nächste 7 Tage:"))) - (alltodo "" - ((org-agenda-skip-function '(or (me--org-skip-subtree-if-priority ?A) - (org-agenda-skip-if nil '(scheduled deadline)))) - (org-agenda-overriding-header "Sonstige Aufgaben:"))))))) - -;;(use-package org-caldav -;; :ensure t -;; :config -;; (setq org-caldav-url "https://nextcloud.cloudsphere.duckdns.org/remote.php/dav/calendars/marc" -;; org-caldav-calendar-id "orgmode" -;; org-caldav-inbox (expand-file-name "~/Archiv/Organisieren/caldav-inbox") -;; org-caldav-files (concat MY--PATH_ORG_FILES "tasks"))) - - (use-package org-journal - :ensure t - :defer t - :custom - (org-journal-dir MY--PATH_ORG_JOURNAl) - (org-journal-enable-agenda-integration t)) - -; (require 'ivy) - (use-package ivy - :ensure t - :diminish - (ivy-mode . "") - :init - (ivy-mode 1) - :bind - ("C-r" . ivy-resume) ;; overrides isearch-backwards binding - :config - (setq ivy-use-virtual-buffers t ;; recent files and bookmarks in ivy-switch-buffer - ivy-height 20 ;; height of ivy window - ivy-count-format "%d/%d" ;; current and total number - ivy-re-builders-alist ;; regex replaces spaces with * - '((t . ivy--regex-plus)))) - - (use-package counsel - :ensure t - :bind* - (("M-x" . counsel-M-x) - ("C-x C-f" . counsel-find-file) - ("C-x C-r" . counsel-recentf) - ("C-c C-f" . counsel-git) - ("C-c h f" . counsel-describe-function) - ("C-c h v" . counsel-describe-variable) - ("M-i" . counsel-imenu))) - - (use-package swiper - :ensure t - :bind - ("C-s" . swiper)) - -(use-package ivy-hydra -:ensure t) - -; (require 'company) - (use-package company - :defer 1 - :bind - (:map company-active-map - ("RET" . nil) - ([return] . nil) - ("TAB" . company-complete-selection) - ([tab] . company-complete-selection) - ("" . company-complete-common)) - :config - (global-company-mode 1) - (setq-default - company-idle-delay .2 - company-minimum-prefix-length 1 - company-require-match nil - company-show-numbers t - company-tooltip-align-annotations t)) - -; (require 'company-statistics) - (use-package company-statistics - :ensure t - :after company - :init - (setq company-statistics-file (concat MY--PATH_USER_LOCAL "company-statistics-cache.el"));~/.emacs.d/user-dir/company-statistics-cache.el") - :config - (company-statistics-mode 1)) - - (use-package company-dabbrev - :ensure nil - :after company - :config - (setq-default company-dabbrev-downcase nil)) - - (use-package company-box - :ensure t - :init - (add-hook 'company-mode-hook 'company-box-mode)) - - (defun company/org-mode-hook() - (set (make-local-variable 'company-backends) - '(company-capf company-files)) - (add-hook 'completion-at-point-functions 'pcomplete-completions-at-point nil t) - (message "company/org-mode-hook")) - - (defun company/elisp-mode-hook() - (set (make-local-variable 'company-backends) - '((company-elisp company-dabbrev) company-capf company-files)) - (message "company/elisp-mode-hook")) - - (defun company/beancount-mode-hook() - (set (make-local-variable 'company-backends) - '(company-beancount))) - - (use-package magit - :ensure t - :defer t - :init - ; set git-path in work environment - (if (string-equal user-login-name "POH") - (setq magit-git-executable "P:/Eigene Dateien/Tools/Git/bin/git.exe") - ) - :bind (("C-x g" . magit-status)) - ) - - (use-package lsp-mode - :defer t - :commands lsp - :custom - (lsp-auto-guess-root nil) - (lsp-prefer-flymake nil) ; use flycheck instead - (lsp-file-watch-threshold 2000) - :bind (:map lsp-mode-map ("C-c C-f" . lsp-format-buffer)) - :hook ((python-mode - js-mode - js2-mode - typescript-mode - web-mode) . lsp)) - - (use-package lsp-ui - :after lsp-mode - :ensure t - :diminish - :commands lsp-ui-mode - :config - (setq lsp-ui-doc-enable t - lsp-ui-doc-header t - lsp-ui-doc-include-signature t - lsp-ui-doc-position 'top - lsp-ui-doc-border (face-foreground 'default) - lsp-ui-sideline-enable nil - lsp-ui-sideline-ignore-duplicate t - lsp-ui-sideline-show-code-actions nil) - (when (display-graphic-p) - (setq lsp-ui-doc-use-webkit t)) - ;; workaround hide mode-line of lsp-ui-imenu buffer - (defadvice lsp-ui-imenu (after hide-lsp-ui-imenu-mode-line activate) - (setq mode-line-format nil))) - - (use-package company-lsp - :requires company - :defer t - :ensure t - :config - ;;disable client-side cache because lsp server does a better job - (setq company-transformers nil - company-lsp-async t - company-lsp-cache-candidates nil)) - - (use-package flycheck - :ensure t - :hook - ((css-mode . flycheck-mode) - (emacs-lisp-mode . flycheck-mode) - (python-mode . flycheck-mode)) - :init - (setq flycheck-emacs-lisp-load-path 'inherit) - :config - (setq-default - flycheck-check-synta-automatically '(save mode-enabled) - flycheck-disable-checkers '(emacs-lisp-checkdoc) - eldoc-idle-delay .1 ;; let eldoc echo faster than flycheck - flycheck-display-errors-delay .3)) ;; this way any errors will override eldoc messages - - (use-package projectile - :ensure t - :defer t - :bind - (("C-c p p" . projectile-switch-project) - ("C-c p c" . projectile-command-map) - ("C-c p s s" . projectile-ag)) - :init - (setq-default projectile-cache-file (concat MY--PATH_USER_LOCAL ".projectile-cache") - projectile-known-projects-file (concat MY--PATH_USER_LOCAL ".projectile-bookmarks")) - :config - (projectile-mode t) - (setq-default projectile-completion-system 'ivy - projectile-enable-caching t - projectile-mode-line '(:eval (projectile-project-name)))) - -(use-package smartparens - :ensure t - :diminish smartparens-mode - :config - (setq sp-show-pair-from-inside nil) - (require 'smartparens-config)) - - (add-hook 'emacs-lisp-mode-hook 'company/elisp-mode-hook) - - (use-package web-mode - :ensure t - :defer t - :mode - ("\\.phtml\\'" - "\\.tpl\\.php\\'" - "\\.djhtml\\'" - "\\.[t]?html?\\'") - :config - (setq web-mode-enable-auto-closing t - web-mode-enable-auto-pairing t) - (add-hook 'web-mode-hook 'smartparens-mode)) - - (if (string-equal system-type "gnu/linux") - (use-package pyvenv - :ensure t - :config - (setenv "WORKON_HOME" (expand-file-name "~/Archiv/Programmierprojekte/Python/virtualenv/")) - (add-hook 'pyvenv-post-activate-hooks #'my/postactivatehook)) - (defun my/postactivatehook () - (setq lsp-python-ms-extra-paths pyvenv-virtual-env)) - - (use-package virtualenvwrapper - :ensure t - :hook (venv-postmkvirtualenv . (lambda() (shell-command "pip3 install importmagic epc"))) - :config - (setq venv-location (expand-file-name "~/Archiv/Programmierprojekte/Python/virtualenv/"))) - - (use-package lsp-python-ms - :ensure t - :after lsp-mode python)) - ; :custom (lsp-python-executable-cmd "python3")) - - (if (string-equal system-type "gnu/linux") - (use-package beancount - :load-path "user-local/elisp" -; :ensure t - :defer t - :mode - ("\\.beancount$" . beancount-mode) - :init - (add-hook 'beancount-mode-hook 'company/beancount-mode-hook) - ; (add-hook 'beancount-mode-hook (pyvenv-activate "/opt/beancount")) - ; (setenv "PATH" - ; (concat "/opt/beancount/bin:" - ; (getenv "PATH"))) - :config - (setq beancount-filename-main "/home/marc/Archiv/Finanzen/Transaktionen/transactions.beancount"))) From 77b9a90704f25f229f3f9411fd4c308d5520680c Mon Sep 17 00:00:00 2001 From: Marc Pohling Date: Thu, 19 Dec 2019 08:10:47 +0100 Subject: [PATCH 05/36] moved beancount.el to user-global --- {user-local => user-global}/elisp/beancount.el | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {user-local => user-global}/elisp/beancount.el (100%) diff --git a/user-local/elisp/beancount.el b/user-global/elisp/beancount.el similarity index 100% rename from user-local/elisp/beancount.el rename to user-global/elisp/beancount.el From 4fa321479e32f8c27a320edc1e0001bd2680c496 Mon Sep 17 00:00:00 2001 From: Marc Pohling Date: Thu, 19 Dec 2019 11:34:15 +0100 Subject: [PATCH 06/36] temporary added file paths for org stuff --- init.org | 230 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 116 insertions(+), 114 deletions(-) diff --git a/init.org b/init.org index 2662525..65b39b8 100644 --- a/init.org +++ b/init.org @@ -1,4 +1,4 @@ -#+TITLE: Emacs configuration file +#+TITLE: Emacs configuration file #+AUTHOR: Marc #+BABEL: :cache yes #+PROPERTY: header-args :tangle yes @@ -115,6 +115,8 @@ ("work_remote" (progn (defvar MY--PATH_ORG_FILES "p:/Eigene Dateien/Notizen/") + (defvar MY--PATH_ORG_FILES_MOBILE "p:/Eigene Dateien/Notizen/") + (defvar MY--PATH_ORG_JOURNAL "p:/Eigene Dateien/Notizen/") (defvar MY--PATH_START "p:/Eigene Dateien/Notizen/")))) (setq bookmark-default-file (concat MY--PATH_USER_LOCAL "bookmarks")) @@ -298,6 +300,115 @@ Some windows specific stuff "d" '(imenu-list-display-entry :which-key "show") "q" '(imenu-list-quit-window :which-key "quit")) #+END_SRC +* ivy / counsel / swiper + :PROPERTIES: + :ID: c2146a70-03f4-4f60-9bce-094eec28cefe + :END: + +#+BEGIN_SRC emacs-lisp +; (require 'ivy) + (use-package ivy + :ensure t + :diminish + (ivy-mode . "") + :init + (ivy-mode 1) + :bind + ("C-r" . ivy-resume) ;; overrides isearch-backwards binding + :config + (setq ivy-use-virtual-buffers t ;; recent files and bookmarks in ivy-switch-buffer + ivy-height 20 ;; height of ivy window + ivy-count-format "%d/%d" ;; current and total number + ivy-re-builders-alist ;; regex replaces spaces with * + '((t . ivy--regex-plus)))) + + (use-package counsel + :ensure t + :bind* + (("M-x" . counsel-M-x) + ("C-x C-f" . counsel-find-file) + ("C-x C-r" . counsel-recentf) + ("C-c C-f" . counsel-git) + ("C-c h f" . counsel-describe-function) + ("C-c h v" . counsel-describe-variable) + ("M-i" . counsel-imenu))) + + (use-package swiper + :ensure t + :bind + ("C-s" . swiper)) + +(use-package ivy-hydra +:ensure t) +#+END_SRC + +* company + :PROPERTIES: + :ID: 1630ac5e-7467-458c-940c-4f724e283813 + :END: + +#+BEGIN_SRC emacs-lisp +; (require 'company) + (use-package company + :defer 1 + :bind + (:map company-active-map + ("RET" . nil) + ([return] . nil) + ("TAB" . company-complete-selection) + ([tab] . company-complete-selection) + ("" . company-complete-common)) + :config + (global-company-mode 1) + (setq-default + company-idle-delay .2 + company-minimum-prefix-length 1 + company-require-match nil + company-show-numbers t + company-tooltip-align-annotations t)) + +; (require 'company-statistics) + (use-package company-statistics + :ensure t + :after company + :init + (setq company-statistics-file (concat MY--PATH_USER_LOCAL "company-statistics-cache.el"));~/.emacs.d/user-dir/company-statistics-cache.el") + :config + (company-statistics-mode 1)) + + (use-package company-dabbrev + :ensure nil + :after company + :config + (setq-default company-dabbrev-downcase nil)) + + (use-package company-box + :ensure t + :init + (add-hook 'company-mode-hook 'company-box-mode)) +#+END_SRC + +** company backends + :PROPERTIES: + :ID: 6ac59f9d-54e3-422d-883f-128fb172468d + :END: + +#+BEGIN_SRC emacs-lisp + (defun company/org-mode-hook() + (set (make-local-variable 'company-backends) + '(company-capf company-files)) + (add-hook 'completion-at-point-functions 'pcomplete-completions-at-point nil t) + (message "company/org-mode-hook")) + + (defun company/elisp-mode-hook() + (set (make-local-variable 'company-backends) + '((company-elisp company-dabbrev) company-capf company-files)) + (message "company/elisp-mode-hook")) + + (defun company/beancount-mode-hook() + (set (make-local-variable 'company-backends) + '(company-beancount))) +#+END_SRC * orgmode ** org :PROPERTIES: @@ -379,10 +490,10 @@ Some windows specific stuff :ID: 017ef411-8239-4bfe-bbef-66b98a2971a9 :END: #+BEGIN_SRC emacs-lisp - (use-package org-id - :config - (setq org-id-link-to-org-use-id t) - (org-id-update-id-locations)) ;; update id file .org-id-locations on startup +;; (use-package org-id +;; :config +;; (setq org-id-link-to-org-use-id t) +;; (org-id-update-id-locations)) ;; update id file .org-id-locations on startup #+END_SRC ** org-agenda @@ -474,115 +585,6 @@ Vorerst deaktiviert, Nutzen evtl. nicht vorhanden (setq org-journal-dir MY--PATH_ORG_JOURNAL org-journal-enable-agenda-integration t))) #+END_SRC -* ivy / counsel / swiper - :PROPERTIES: - :ID: c2146a70-03f4-4f60-9bce-094eec28cefe - :END: - -#+BEGIN_SRC emacs-lisp -; (require 'ivy) - (use-package ivy - :ensure t - :diminish - (ivy-mode . "") - :init - (ivy-mode 1) - :bind - ("C-r" . ivy-resume) ;; overrides isearch-backwards binding - :config - (setq ivy-use-virtual-buffers t ;; recent files and bookmarks in ivy-switch-buffer - ivy-height 20 ;; height of ivy window - ivy-count-format "%d/%d" ;; current and total number - ivy-re-builders-alist ;; regex replaces spaces with * - '((t . ivy--regex-plus)))) - - (use-package counsel - :ensure t - :bind* - (("M-x" . counsel-M-x) - ("C-x C-f" . counsel-find-file) - ("C-x C-r" . counsel-recentf) - ("C-c C-f" . counsel-git) - ("C-c h f" . counsel-describe-function) - ("C-c h v" . counsel-describe-variable) - ("M-i" . counsel-imenu))) - - (use-package swiper - :ensure t - :bind - ("C-s" . swiper)) - -(use-package ivy-hydra -:ensure t) -#+END_SRC - -* company - :PROPERTIES: - :ID: 1630ac5e-7467-458c-940c-4f724e283813 - :END: - -#+BEGIN_SRC emacs-lisp -; (require 'company) - (use-package company - :defer 1 - :bind - (:map company-active-map - ("RET" . nil) - ([return] . nil) - ("TAB" . company-complete-selection) - ([tab] . company-complete-selection) - ("" . company-complete-common)) - :config - (global-company-mode 1) - (setq-default - company-idle-delay .2 - company-minimum-prefix-length 1 - company-require-match nil - company-show-numbers t - company-tooltip-align-annotations t)) - -; (require 'company-statistics) - (use-package company-statistics - :ensure t - :after company - :init - (setq company-statistics-file (concat MY--PATH_USER_LOCAL "company-statistics-cache.el"));~/.emacs.d/user-dir/company-statistics-cache.el") - :config - (company-statistics-mode 1)) - - (use-package company-dabbrev - :ensure nil - :after company - :config - (setq-default company-dabbrev-downcase nil)) - - (use-package company-box - :ensure t - :init - (add-hook 'company-mode-hook 'company-box-mode)) -#+END_SRC - -** company backends - :PROPERTIES: - :ID: 6ac59f9d-54e3-422d-883f-128fb172468d - :END: - -#+BEGIN_SRC emacs-lisp - (defun company/org-mode-hook() - (set (make-local-variable 'company-backends) - '(company-capf company-files)) - (add-hook 'completion-at-point-functions 'pcomplete-completions-at-point nil t) - (message "company/org-mode-hook")) - - (defun company/elisp-mode-hook() - (set (make-local-variable 'company-backends) - '((company-elisp company-dabbrev) company-capf company-files)) - (message "company/elisp-mode-hook")) - - (defun company/beancount-mode-hook() - (set (make-local-variable 'company-backends) - '(company-beancount))) -#+END_SRC * Programming ** Magit / Git From b64f0ea3e04c115823672268e2023aa572a4f89c Mon Sep 17 00:00:00 2001 From: Marc Pohling Date: Thu, 19 Dec 2019 11:35:51 +0100 Subject: [PATCH 07/36] fixed load-path for beancount.el --- init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.org b/init.org index 65b39b8..5a2e581 100644 --- a/init.org +++ b/init.org @@ -816,7 +816,7 @@ deactivate #+BEGIN_SRC emacs-lisp (if (string-equal system-type "gnu/linux") (use-package beancount - :load-path "user-local/elisp" + :load-path "user-global/elisp" ; :ensure t :defer t :mode From 011c9d4a3d96da3f7d3f15138d667d6c6de88c3c Mon Sep 17 00:00:00 2001 From: Marc Pohling Date: Thu, 19 Dec 2019 11:55:15 +0100 Subject: [PATCH 08/36] added explaination, why org-id is disabled --- init.org | 1 + 1 file changed, 1 insertion(+) diff --git a/init.org b/init.org index 5a2e581..addb6ef 100644 --- a/init.org +++ b/init.org @@ -489,6 +489,7 @@ Some windows specific stuff :PROPERTIES: :ID: 017ef411-8239-4bfe-bbef-66b98a2971a9 :END: +Currently it causes some debugger errors "not a standard org time string", so it's disabled #+BEGIN_SRC emacs-lisp ;; (use-package org-id ;; :config From eb8c0fb43255fd4ca2de8712c4932b059b8b9c94 Mon Sep 17 00:00:00 2001 From: Marc Pohling Date: Thu, 19 Dec 2019 12:06:24 +0100 Subject: [PATCH 09/36] added bools for system identifications (will replace me/whoami) --- init.org | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/init.org b/init.org index addb6ef..02f933a 100644 --- a/init.org +++ b/init.org @@ -88,7 +88,13 @@ :ID: 00b48602-2a95-492e-a90b-c1e3a94c1ecb :END: #+BEGIN_SRC emacs-lisp - (defvar me/whoami +(setq *home_desktop* (string-equal (system-name) "marc") + ,*home_laptop* (string-equal (system-name) "laptop") + ,*work_local* (string-equal (system-name) "PMPCNEU08") + ,*work_remote* (string-equal (system-name) "PMTS01")) + + +(defvar me/whoami (if (string-equal (system-name) "PMTS01") "work_remote" (if (string-equal (system-name) "laptop") From b9618fb0afc13408b38ab97feb163e437d47d161 Mon Sep 17 00:00:00 2001 From: Marc Pohling Date: Thu, 19 Dec 2019 12:41:08 +0100 Subject: [PATCH 10/36] replaced all me/whoami references with bool variable checks --- init.org | 132 +++++++++++++++++++++++++------------------------------ 1 file changed, 59 insertions(+), 73 deletions(-) diff --git a/init.org b/init.org index 02f933a..7f2df0f 100644 --- a/init.org +++ b/init.org @@ -91,76 +91,63 @@ (setq *home_desktop* (string-equal (system-name) "marc") ,*home_laptop* (string-equal (system-name) "laptop") ,*work_local* (string-equal (system-name) "PMPCNEU08") - ,*work_remote* (string-equal (system-name) "PMTS01")) - - -(defvar me/whoami - (if (string-equal (system-name) "PMTS01") - "work_remote" - (if (string-equal (system-name) "laptop") - "home_laptop" - (if (string-equal (system-name) "PMPCNEU08") - "work_local" - "home_desktop")))) -#+END_SRC - -#+BEGIN_SRC emacs-lisp - (defvar MY--PATH_USER_LOCAL (expand-file-name "~/.emacs.d/user-local/")) - (defvar MY--PATH_USER_GLOBAL (expand-file-name "~/.emacs.d/user-global/")) - (pcase me/whoami - ("home" - (progn - (defvar MY--PATH_ORG_FILES (expand-file-name "~/Archiv/Organisieren/")) - (defvar MY--PATH_ORG_FILES_MOBILE (expand-file-name "~/Archiv/Organisieren/mobile/")) - (defvar MY--PATH_ORG_JOURNAl (expand-file-name "~/Archiv/Organisieren/Journal/")))) - ("home_laptop" - (progn - (defvar MY--PATH_ORG_FILES (expand-file-name "~/Archiv/Organisieren/")) - (defvar MY--PATH_ORG_FILES_MOBILE (expand-file-name "~/Archiv/Organisieren/mobile/")) - (defvar MY--PATH_ORG_JOURNAL (expand-file-name "~/Archiv/Organisieren/Journal/")))) - ("work_remote" - (progn - (defvar MY--PATH_ORG_FILES "p:/Eigene Dateien/Notizen/") - (defvar MY--PATH_ORG_FILES_MOBILE "p:/Eigene Dateien/Notizen/") - (defvar MY--PATH_ORG_JOURNAL "p:/Eigene Dateien/Notizen/") - (defvar MY--PATH_START "p:/Eigene Dateien/Notizen/")))) - - (setq bookmark-default-file (concat MY--PATH_USER_LOCAL "bookmarks")) - (setq recentf-save-file (concat MY--PATH_USER_LOCAL "recentf")) - (setq custom-file (concat MY--PATH_USER_LOCAL "custom.el")) ;; don't spam init.e with saved customization settings - (setq abbrev-file-name (concat MY--PATH_USER_GLOBAL "abbrev_defs")) - (setq backup-directory-alist `((".*" . ,temporary-file-directory))) - (setq auto-save-file-name-transforms `((".*" ,temporary-file-directory))) - (setq save-abbrevs 'silently) ;; don't bother me with asking for abbrev saving - (setq-default create-lockfiles nil) ;; disable lock files, can cause trouble in e.g. lsp-mode - (defalias 'yes-or-no-p 'y-or-n-p) ;; answer with y and n - (setq custom-safe-themes t) ;; don't ask me if I want to load a theme - (setq sentence-end-double-space nil) ;; don't coun two spaces after a period as the end of a sentence. - (delete-selection-mode t) ;; delete selected region when typing - (save-place-mode 1) ;; saves position in file when it's closed - (setq save-place-forget-unreadable-files nil) ;; checks if file is readable before saving position - - (setq locale-coding-system 'utf-8) - (set-terminal-coding-system 'utf-8) - (set-keyboard-coding-system 'utf-8) - (set-selection-coding-system 'utf-8) - (if (eq system-type 'windows-nt) - (prefer-coding-system 'utf-8-dos) - (prefer-coding-system 'utf-8)) - (blink-cursor-mode -1) ;; turn off blinking cursor - (show-paren-mode t) ;; show other part of brackets - (column-number-mode t) - (setq uniquify-buffer-name-style 'forward) - (setq-default indent-tabs-mode nil) ;; avoid tabs in place of multiple spaces (they look bad in tex) - (setq-default indicate-empty-lines t) ;; show empty lines - (setq scroll-margin 5 ;; smooth scrolling - scroll-conservatively 10000 - scroll-preserve-screen-position 1 - scroll-step 1) - (global-hl-line-mode t) ;; highlight current line - (menu-bar-mode 0) ;; disable menu bar - (tool-bar-mode 0) ;; disable tool bar - (scroll-bar-mode 0) ;; disable scroll bar + ,*work_remote* (string-equal (system-name) "PMTS01") + ,*linux* (string-equal system-type 'gnu/linux) + ,*windows* (string-equal system-type 'windows-nt)) +#+END_SRC + +#+BEGIN_SRC emacs-lisp +(defvar MY--PATH_USER_LOCAL (expand-file-name "~/.emacs.d/user-local/")) +(defvar MY--PATH_USER_GLOBAL (expand-file-name "~/.emacs.d/user-global/")) + +(when *linux* + (defvar MY--PATH_ORG_FILES (expand-file-name "~/Archiv/Organisieren/")) + (defvar MY--PATH_ORG_FILES_MOBILE (expand-file-name "~/Archiv/Organisieren/mobile/")) + (defvar MY--PATH_ORG_JOURNAl (expand-file-name "~/Archiv/Organisieren/Journal/"))) +(when *work_remote* +;; (progn + (defvar MY--PATH_ORG_FILES "p:/Eigene Dateien/Notizen/") + (defvar MY--PATH_ORG_FILES_MOBILE "p:/Eigene Dateien/Notizen/") + (defvar MY--PATH_ORG_JOURNAL "p:/Eigene Dateien/Notizen/") + (defvar MY--PATH_START "p:/Eigene Dateien/Notizen/")) + +(setq bookmark-default-file (concat MY--PATH_USER_LOCAL "bookmarks")) +(setq recentf-save-file (concat MY--PATH_USER_LOCAL "recentf")) +(setq custom-file (concat MY--PATH_USER_LOCAL "custom.el")) ;; don't spam init.e with saved customization settings +(setq abbrev-file-name (concat MY--PATH_USER_GLOBAL "abbrev_defs")) +(setq backup-directory-alist `((".*" . ,temporary-file-directory))) +(setq auto-save-file-name-transforms `((".*" ,temporary-file-directory))) +(setq save-abbrevs 'silently) ;; don't bother me with asking for abbrev saving +(setq-default create-lockfiles nil) ;; disable lock files, can cause trouble in e.g. lsp-mode +(defalias 'yes-or-no-p 'y-or-n-p) ;; answer with y and n +(setq custom-safe-themes t) ;; don't ask me if I want to load a theme +(setq sentence-end-double-space nil) ;; don't coun two spaces after a period as the end of a sentence. +(delete-selection-mode t) ;; delete selected region when typing +(save-place-mode 1) ;; saves position in file when it's closed +(setq save-place-forget-unreadable-files nil) ;; checks if file is readable before saving position + +(setq locale-coding-system 'utf-8) +(set-terminal-coding-system 'utf-8) +(set-keyboard-coding-system 'utf-8) +(set-selection-coding-system 'utf-8) +(if *windows* + (prefer-coding-system 'utf-8-dos) + (prefer-coding-system 'utf-8)) + +(blink-cursor-mode -1) ;; turn off blinking cursor +(show-paren-mode t) ;; show other part of brackets +(column-number-mode t) +(setq uniquify-buffer-name-style 'forward) +(setq-default indent-tabs-mode nil) ;; avoid tabs in place of multiple spaces (they look bad in tex) +(setq-default indicate-empty-lines t) ;; show empty lines +(setq scroll-margin 5 ;; smooth scrolling + scroll-conservatively 10000 + scroll-preserve-screen-position 1 + scroll-step 1) +(global-hl-line-mode t) ;; highlight current line +(menu-bar-mode 0) ;; disable menu bar +(tool-bar-mode 0) ;; disable tool bar +(scroll-bar-mode 0) ;; disable scroll bar #+END_SRC Some windows specific stuff @@ -509,8 +496,7 @@ Currently it causes some debugger errors "not a standard org time string", so it :END: Custom keywords, depending on environment #+BEGIN_SRC emacs-lisp -(pcase me/whoami - ("work_remote") +(when *work_remote* (setq org-todo-keywords '((sequence "OPEN" "TODO" "UNCLEAR" "|" "DONE" "IMPOSSIBLE")))) #+END_SRC @@ -584,7 +570,7 @@ Vorerst deaktiviert, Nutzen evtl. nicht vorhanden [[https://github.com/bastibe/org-journal][Source]] #+BEGIN_SRC emacs-lisp -(unless (string-equal me/whoami "work-remote") +(when *linux* (use-package org-journal :ensure t :defer t From 69a4f847e3a3c37f097715ea0fd128e1fdd17f62 Mon Sep 17 00:00:00 2001 From: Marc Pohling Date: Thu, 19 Dec 2019 12:57:40 +0100 Subject: [PATCH 11/36] changed some path variables for work_remote to nil --- init.org | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/init.org b/init.org index 7f2df0f..0aed90e 100644 --- a/init.org +++ b/init.org @@ -101,15 +101,14 @@ (defvar MY--PATH_USER_GLOBAL (expand-file-name "~/.emacs.d/user-global/")) (when *linux* - (defvar MY--PATH_ORG_FILES (expand-file-name "~/Archiv/Organisieren/")) + (defvar MY--PATH_ORG_FILES (expand-file-name "~/Archiv/Organisieren/")) (defvar MY--PATH_ORG_FILES_MOBILE (expand-file-name "~/Archiv/Organisieren/mobile/")) - (defvar MY--PATH_ORG_JOURNAl (expand-file-name "~/Archiv/Organisieren/Journal/"))) + (defvar MY--PATH_ORG_JOURNAl (expand-file-name "~/Archiv/Organisieren/Journal/"))) (when *work_remote* -;; (progn - (defvar MY--PATH_ORG_FILES "p:/Eigene Dateien/Notizen/") - (defvar MY--PATH_ORG_FILES_MOBILE "p:/Eigene Dateien/Notizen/") - (defvar MY--PATH_ORG_JOURNAL "p:/Eigene Dateien/Notizen/") - (defvar MY--PATH_START "p:/Eigene Dateien/Notizen/")) + (defvar MY--PATH_ORG_FILES "p:/Eigene Dateien/Notizen/") + (defvar MY--PATH_ORG_FILES_MOBILE nil) ;; hacky way to prevent "free variable" compiler error + (defvar MY--PATH_ORG_JOURNAL nil) + (defvar MY--PATH_START "p:/Eigene Dateien/Notizen/")) (setq bookmark-default-file (concat MY--PATH_USER_LOCAL "bookmarks")) (setq recentf-save-file (concat MY--PATH_USER_LOCAL "recentf")) From 55ae32ca5816f184803f15d90f3a96a380b89784 Mon Sep 17 00:00:00 2001 From: Marc Pohling Date: Thu, 19 Dec 2019 13:48:09 +0100 Subject: [PATCH 12/36] added theme and toggle-theme functioin for windows (i.e. work_remote) --- init.org | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/init.org b/init.org index 0aed90e..90dd9f0 100644 --- a/init.org +++ b/init.org @@ -173,6 +173,28 @@ Some windows specific stuff (set-face-font 'default "Hack-10")) #+END_SRC +** Themes + +#+BEGIN_SRC emacs-lisp +(defun my/toggle-theme () + (interactive) + (when *windows* + (if (eq (car custom-enabled-themes) 'ample-flat) + (disable-theme 'ample-flat) + (enable-theme 'ample-flat)))) +#+END_SRC + +Windows Theme: +#+BEGIN_SRC emacs-lisp +(when *windows* + (use-package ample-theme + :if (window-system) + :defer t + :ensure t + :bind ("C-c t" . my/toggle-theme) + :init + (load-theme 'ample-flat t))) ;; alternative ample, ample-light +#+END_SRC ** line wrappings :PROPERTIES: :ID: 60b1f231-ab1e-4c47-ac6d-262dc208a520 From 034dc6d5d93e38ae74be299ebba7131596ff4af7 Mon Sep 17 00:00:00 2001 From: Marc Pohling Date: Thu, 19 Dec 2019 13:55:00 +0100 Subject: [PATCH 13/36] deleted all org-id properties --- init.org | 90 -------------------------------------------------------- 1 file changed, 90 deletions(-) diff --git a/init.org b/init.org index 90dd9f0..015858d 100644 --- a/init.org +++ b/init.org @@ -26,9 +26,6 @@ - CONTINUE TODO from config.org at Programming * First start - :PROPERTIES: - :ID: ec248005-527f-4fa1-bdef-9343f2fa28b0 - :END: When pulling the repository the first time, an initial init.el needs to be setup. After start it will replace itself with the configuration from init.org #+BEGIN_SRC emacs-lisp :tangle no @@ -84,9 +81,6 @@ #+END_SRC * Default settings - :PROPERTIES: - :ID: 00b48602-2a95-492e-a90b-c1e3a94c1ecb - :END: #+BEGIN_SRC emacs-lisp (setq *home_desktop* (string-equal (system-name) "marc") ,*home_laptop* (string-equal (system-name) "laptop") @@ -165,9 +159,6 @@ Some windows specific stuff #+END_SRC * visuals ** Font - :PROPERTIES: - :ID: cdfaaf73-b027-4b86-8d27-ebdce4b85009 - :END: #+BEGIN_SRC emacs-lisp (if (string-equal system-type "gnu/linux") (set-face-font 'default "Hack-10")) @@ -196,9 +187,6 @@ Windows Theme: (load-theme 'ample-flat t))) ;; alternative ample, ample-light #+END_SRC ** line wrappings - :PROPERTIES: - :ID: 60b1f231-ab1e-4c47-ac6d-262dc208a520 - :END: #+BEGIN_SRC emacs-lisp (global-visual-line-mode) (diminish 'visual-line-mode) @@ -214,9 +202,6 @@ Windows Theme: ; (add-hook 'visual-line-mode-hook 'my/activate-adaptive-wrap-prefix-mode))) #+END_SRC ** line numbers - :PROPERTIES: - :ID: d3dfb79a-103a-4318-a5af-5a55e12674ce - :END: #+BEGIN_SRC emacs-lisp (use-package display-line-numbers :init @@ -230,9 +215,6 @@ Windows Theme: ; (add-hook 'emacs-lisp-mode-hook 'display-line-numbers-mode) #+END_SRC ** misc - :PROPERTIES: - :ID: f0f774d6-db13-4871-9192-d36e78120dde - :END: #+BEGIN_SRC emacs-lisp (use-package rainbow-mode :ensure t @@ -241,9 +223,6 @@ Windows Theme: emacs-lisp-mode) . rainbow-mode)) #+END_SRC * undo - :PROPERTIES: - :ID: fde526fa-b053-48dd-9ac1-c443d987f4d2 - :END: #+BEGIN_SRC emacs-lisp (use-package undo-tree :ensure t @@ -252,9 +231,6 @@ Windows Theme: (global-undo-tree-mode 1)) #+END_SRC * imenu-list - :PROPERTIES: - :ID: 796d00db-aadb-412b-a291-619b029977f3 - :END: A minor mode to show imenu in a sidebar. Call imenu-list-smart-toggle. [[https://github.com/bmag/imenu-list][Source]] @@ -272,9 +248,6 @@ Windows Theme: ) #+END_SRC * which-key - :PROPERTIES: - :ID: 0a67aeb4-4060-4f4d-a7ff-61c70fe7ec7b - :END: #+BEGIN_SRC emacs-lisp (use-package which-key :ensure t @@ -287,9 +260,6 @@ Windows Theme: #+END_SRC * Evil - :PROPERTIES: - :ID: a3389b7d-3833-42b7-97e1-413b8c4d9833 - :END: #+BEGIN_SRC emacs-lisp (use-package evil @@ -299,9 +269,6 @@ Windows Theme: (evil-mode 1)) #+END_SRC * General (key mapper) - :PROPERTIES: - :ID: 027bdcf8-95c9-4e9b-88ba-6e9d3e5116c0 - :END: #+BEGIN_SRC emacs-lisp (use-package general :ensure t) @@ -315,9 +282,6 @@ Windows Theme: "q" '(imenu-list-quit-window :which-key "quit")) #+END_SRC * ivy / counsel / swiper - :PROPERTIES: - :ID: c2146a70-03f4-4f60-9bce-094eec28cefe - :END: #+BEGIN_SRC emacs-lisp ; (require 'ivy) @@ -357,9 +321,6 @@ Windows Theme: #+END_SRC * company - :PROPERTIES: - :ID: 1630ac5e-7467-458c-940c-4f724e283813 - :END: #+BEGIN_SRC emacs-lisp ; (require 'company) @@ -403,9 +364,6 @@ Windows Theme: #+END_SRC ** company backends - :PROPERTIES: - :ID: 6ac59f9d-54e3-422d-883f-128fb172468d - :END: #+BEGIN_SRC emacs-lisp (defun company/org-mode-hook() @@ -425,9 +383,6 @@ Windows Theme: #+END_SRC * orgmode ** org - :PROPERTIES: - :ID: 3877251e-5ece-4006-baa6-1f1b4846a8f3 - :END: #+BEGIN_SRC emacs-lisp (use-package org :ensure org-plus-contrib @@ -458,9 +413,6 @@ Windows Theme: org-src-tab-acts-natively t)) #+END_SRC ** languages - :PROPERTIES: - :ID: 467efd58-e928-4ccf-9ac4-d144eaede8ed - :END: #+BEGIN_SRC emacs-lisp (org-babel-do-load-languages 'org-babel-load-languages @@ -488,9 +440,6 @@ Windows Theme: (setq org-confirm-babel-evaluate 'me--org-confirm-babel-evaluate) #+END_SRC ** habits - :PROPERTIES: - :ID: 61735b0c-5016-4697-80c6-beb7b3f27a1b - :END: #+BEGIN_SRC emacs-lisp (require 'org-habit) ;;TODO Lösung ohne require finden, scheint mir nicht ideal zu sein, nur um ein org-modul zu aktivieren ;; (add-to-list 'org-modules "org-habit") @@ -500,9 +449,6 @@ Windows Theme: org-habit-show-habits-only-for-today nil) #+END_SRC ** org-id - :PROPERTIES: - :ID: 017ef411-8239-4bfe-bbef-66b98a2971a9 - :END: Currently it causes some debugger errors "not a standard org time string", so it's disabled #+BEGIN_SRC emacs-lisp ;; (use-package org-id @@ -512,9 +458,6 @@ Currently it causes some debugger errors "not a standard org time string", so it #+END_SRC ** org-agenda - :PROPERTIES: - :ID: 10e65f59-ba2c-47e4-a40c-3097c15544aa - :END: Custom keywords, depending on environment #+BEGIN_SRC emacs-lisp (when *work_remote* @@ -571,9 +514,6 @@ Customize the org agenda org-super-agenda ** org-caldav - :PROPERTIES: - :ID: 58aa11ef-80f7-4629-a957-a9e00e070136 - :END: Vorerst deaktiviert, Nutzen evtl. nicht vorhanden #+BEGIN_SRC emacs-lisp ;;(use-package org-caldav @@ -585,9 +525,6 @@ Vorerst deaktiviert, Nutzen evtl. nicht vorhanden ;; org-caldav-files (concat MY--PATH_ORG_FILES "tasks"))) #+END_SRC ** journal - :PROPERTIES: - :ID: 0b7243ac-049f-4b9c-a062-7a349c515133 - :END: [[https://github.com/bastibe/org-journal][Source]] #+BEGIN_SRC emacs-lisp @@ -602,9 +539,6 @@ Vorerst deaktiviert, Nutzen evtl. nicht vorhanden * Programming ** Magit / Git - :PROPERTIES: - :ID: a947f806-181d-4d33-9734-435849385b0b - :END: Little crash course in magit: - magit-init to init a git project - magit-status (C-x g) to call the status window @@ -633,9 +567,6 @@ In status buffer: #+END_SRC ** LSP - :PROPERTIES: - :ID: d529d096-ec38-42e6-91c9-099c1d8bdd06 - :END: Configuration for the language server protocol *ACHTUNG* Dateipfad muss absolut sein, symlink im Pfad führt zumindest beim ersten Start zu Fehlern beim lsp Sobald der lsp einmal lief, kann zukünftig der symlink-Pfad genommen werden. @@ -689,9 +620,6 @@ TODO Unterverzeichnisse wurden noch nicht getestet #+END_SRC ** flycheck - :PROPERTIES: - :ID: c8090ddb-4f22-49ba-8ab1-1de132e1d772 - :END: #+BEGIN_SRC emacs-lisp (use-package flycheck :ensure t @@ -710,9 +638,6 @@ TODO Unterverzeichnisse wurden noch nicht getestet #+END_SRC ** Projectile - :PROPERTIES: - :ID: 3cc5c1d2-1a5d-4d1a-bfeb-48de8172dd63 - :END: Manage projects and jump quickly between its files #+BEGIN_SRC emacs-lisp (use-package projectile @@ -733,9 +658,6 @@ Manage projects and jump quickly between its files #+END_SRC ** smartparens - :PROPERTIES: - :ID: 04be375f-d100-47e7-99f1-af47a3139a54 - :END: #+BEGIN_SRC emacs-lisp (use-package smartparens :ensure t @@ -746,16 +668,10 @@ Manage projects and jump quickly between its files #+END_SRC ** lisp - :PROPERTIES: - :ID: e5ce0263-3b21-460e-a037-3fe27d6e836a - :END: #+BEGIN_SRC emacs-lisp (add-hook 'emacs-lisp-mode-hook 'company/elisp-mode-hook) #+END_SRC ** web - :PROPERTIES: - :ID: 5649b885-839f-48db-8b4f-8d594df7ebd8 - :END: apt install npm sudo npm install -g vscode-html-languageserver-bin @@ -777,9 +693,6 @@ Manage projects and jump quickly between its files #+END_SRC ** Python - :PROPERTIES: - :ID: cd4bbd1f-9980-42c9-a5af-aa808779d524 - :END: Systemseitig muss python-language-server installiert sein: pip3 install 'python-language-server[all]' @@ -812,9 +725,6 @@ Manage projects and jump quickly between its files #+END_SRC * beancount ** Installation - :PROPERTIES: - :ID: 0c5f3396-4b08-4549-ac68-0c516cfd4435 - :END: #+BEGIN_SRC shell sudo su cd /opt From 29bf17dd054b91f4cb15deb4a2e99fd1cc14c9ea Mon Sep 17 00:00:00 2001 From: Marc Pohling Date: Thu, 19 Dec 2019 14:30:28 +0100 Subject: [PATCH 14/36] fixed toggle function for light/dark theme --- init.org | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/init.org b/init.org index 015858d..6471a78 100644 --- a/init.org +++ b/init.org @@ -171,8 +171,11 @@ Some windows specific stuff (interactive) (when *windows* (if (eq (car custom-enabled-themes) 'ample-flat) - (disable-theme 'ample-flat) - (enable-theme 'ample-flat)))) + (progn (disable-theme 'ample-flat) + (enable-theme 'adwaita)) + (progn + (disable-theme 'adwaita) + (enable-theme 'ample-flat))))) #+END_SRC Windows Theme: From 7e496d5248b0dd35c5c2073f5d1e68e59e249708 Mon Sep 17 00:00:00 2001 From: Marc Pohling Date: Thu, 19 Dec 2019 14:32:34 +0100 Subject: [PATCH 15/36] changed check for linux in a function --- init.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.org b/init.org index 6471a78..05ac5f1 100644 --- a/init.org +++ b/init.org @@ -160,8 +160,8 @@ Some windows specific stuff * visuals ** Font #+BEGIN_SRC emacs-lisp - (if (string-equal system-type "gnu/linux") - (set-face-font 'default "Hack-10")) +(when *linux* + (set-face-font 'default "Hack-10")) #+END_SRC ** Themes From fd81dfe9d6e59e56e1c3a057a3cc14cb6db23b96 Mon Sep 17 00:00:00 2001 From: Marc Pohling Date: Thu, 19 Dec 2019 14:46:15 +0100 Subject: [PATCH 16/36] fixed buggy file paths for org --- init.org | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/init.org b/init.org index 05ac5f1..e32b1d8 100644 --- a/init.org +++ b/init.org @@ -399,9 +399,13 @@ Windows Theme: org-tempo ;; easy templates ))) (setq org-default-notes-file (concat MY--PATH_ORG_FILES "notes.org") - org-agenda-files (list MY--PATH_ORG_FILES - MY--PATH_ORG_FILES_MOBILE) - org-id-locations-file (concat MY--PATH_USER_LOCAL ".org-id-locations") + org-agenda-files (list (concat MY--PATH_ORG_FILES "notes.org") + (concat MY--PATH_ORG_FILES "projects.org") + (concat MY--PATH_ORG_FILES "todo.org"))) + (when *linux* + (setq org-agenda-files (list org-agenda-files + MY--PATH_ORG_FILES_MOBILE))) + (setq org-id-locations-file (concat MY--PATH_USER_LOCAL ".org-id-locations") org-log-into-drawer "LOGBOOK") ;; some display customizations From 46f34edf05e716bd305fe828b141e9c384506fc1 Mon Sep 17 00:00:00 2001 From: Marc Pohling Date: Thu, 19 Dec 2019 16:21:35 +0100 Subject: [PATCH 17/36] changed windows-theme from ample to tango --- init.org | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/init.org b/init.org index e32b1d8..cc4f2c1 100644 --- a/init.org +++ b/init.org @@ -162,6 +162,8 @@ Some windows specific stuff #+BEGIN_SRC emacs-lisp (when *linux* (set-face-font 'default "Hack-10")) +(when *work_remote* + (set-face-font 'default "Lucida Sans Typewriter-11")) #+END_SRC ** Themes @@ -170,24 +172,18 @@ Some windows specific stuff (defun my/toggle-theme () (interactive) (when *windows* - (if (eq (car custom-enabled-themes) 'ample-flat) - (progn (disable-theme 'ample-flat) - (enable-theme 'adwaita)) + (if (eq (car custom-enabled-themes) 'tango-dark) + (progn (disable-theme 'tango-dark) + (enable-theme 'tango)) (progn - (disable-theme 'adwaita) - (enable-theme 'ample-flat))))) + (disable-theme 'tango) + (enable-theme 'tango-dark))))) #+END_SRC Windows Theme: #+BEGIN_SRC emacs-lisp (when *windows* - (use-package ample-theme - :if (window-system) - :defer t - :ensure t - :bind ("C-c t" . my/toggle-theme) - :init - (load-theme 'ample-flat t))) ;; alternative ample, ample-light + (load-theme 'tango)) #+END_SRC ** line wrappings #+BEGIN_SRC emacs-lisp From c2cd9ed2fc8d2f0f239ac43c5c08daa59991eed8 Mon Sep 17 00:00:00 2001 From: Marc Pohling Date: Thu, 19 Dec 2019 16:30:42 +0100 Subject: [PATCH 18/36] added comment to a hacky solution --- init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.org b/init.org index cc4f2c1..368a6e9 100644 --- a/init.org +++ b/init.org @@ -101,7 +101,7 @@ (when *work_remote* (defvar MY--PATH_ORG_FILES "p:/Eigene Dateien/Notizen/") (defvar MY--PATH_ORG_FILES_MOBILE nil) ;; hacky way to prevent "free variable" compiler error - (defvar MY--PATH_ORG_JOURNAL nil) + (defvar MY--PATH_ORG_JOURNAL nil) ;; hacky way to prevent "free variable" compiler error (defvar MY--PATH_START "p:/Eigene Dateien/Notizen/")) (setq bookmark-default-file (concat MY--PATH_USER_LOCAL "bookmarks")) From 4deb7bd541a6959697d72b81a52f04ecacd259b2 Mon Sep 17 00:00:00 2001 From: Marc Date: Sat, 21 Dec 2019 14:12:38 +0000 Subject: [PATCH 19/36] added linux to tango theme switcher for now --- init.org | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/init.org b/init.org index 368a6e9..46d4a69 100644 --- a/init.org +++ b/init.org @@ -171,13 +171,15 @@ Some windows specific stuff #+BEGIN_SRC emacs-lisp (defun my/toggle-theme () (interactive) - (when *windows* + (when (or *windows* *linux*) (if (eq (car custom-enabled-themes) 'tango-dark) (progn (disable-theme 'tango-dark) - (enable-theme 'tango)) + (load-theme 'tango)) (progn (disable-theme 'tango) - (enable-theme 'tango-dark))))) + (load-theme 'tango-dark))))) + +(bind-key "C-c t" 'my/toggle-theme) #+END_SRC Windows Theme: From 888b081ed4cfb89409c2915b24d0bea77d6a5a07 Mon Sep 17 00:00:00 2001 From: Marc Date: Wed, 25 Dec 2019 13:00:20 +0000 Subject: [PATCH 20/36] fixed path setting bug in org-journal --- init.org | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/init.org b/init.org index 46d4a69..b7c4d57 100644 --- a/init.org +++ b/init.org @@ -96,14 +96,13 @@ (when *linux* (defvar MY--PATH_ORG_FILES (expand-file-name "~/Archiv/Organisieren/")) - (defvar MY--PATH_ORG_FILES_MOBILE (expand-file-name "~/Archiv/Organisieren/mobile/")) - (defvar MY--PATH_ORG_JOURNAl (expand-file-name "~/Archiv/Organisieren/Journal/"))) + (defvar MY--PATH_ORG_FILES_MOBILE (expand-file-name "~/Archiv/Organisieren/mobile/"))) + (defvar MY--PATH_ORG_JOURNAl (expand-file-name "~/Archiv/Organisieren/Journal/")) (when *work_remote* (defvar MY--PATH_ORG_FILES "p:/Eigene Dateien/Notizen/") (defvar MY--PATH_ORG_FILES_MOBILE nil) ;; hacky way to prevent "free variable" compiler error (defvar MY--PATH_ORG_JOURNAL nil) ;; hacky way to prevent "free variable" compiler error (defvar MY--PATH_START "p:/Eigene Dateien/Notizen/")) - (setq bookmark-default-file (concat MY--PATH_USER_LOCAL "bookmarks")) (setq recentf-save-file (concat MY--PATH_USER_LOCAL "recentf")) (setq custom-file (concat MY--PATH_USER_LOCAL "custom.el")) ;; don't spam init.e with saved customization settings @@ -533,13 +532,13 @@ Vorerst deaktiviert, Nutzen evtl. nicht vorhanden [[https://github.com/bastibe/org-journal][Source]] #+BEGIN_SRC emacs-lisp -(when *linux* - (use-package org-journal - :ensure t - :defer t - :config - (setq org-journal-dir MY--PATH_ORG_JOURNAL - org-journal-enable-agenda-integration t))) +(use-package org-journal + :if *linux* + :ensure t + :defer t + :config + (setq org-journal-dir MY--PATH_ORG_JOURNAl + org-journal-enable-agenda-integration t)) #+END_SRC * Programming From ad9068d21b9b0729320f82c3d04fbd68d9a0f09a Mon Sep 17 00:00:00 2001 From: Marc Date: Wed, 25 Dec 2019 18:44:29 +0000 Subject: [PATCH 21/36] added yasnippet --- init.org | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/init.org b/init.org index b7c4d57..21e5882 100644 --- a/init.org +++ b/init.org @@ -623,6 +623,18 @@ TODO Unterverzeichnisse wurden noch nicht getestet company-lsp-cache-candidates nil)) #+END_SRC +** yasnippet + +#+begin_src emacs-lisp +(use-package yasnippet + :ensure t + :diminish yas-minor-mode + :config + (setq yas-snippet-dirs (list (concat MY--PATH_USER_GLOBAL "snippets"))) + (yas-global-mode t) + (yas-reload-all)) +#+end_src + ** flycheck #+BEGIN_SRC emacs-lisp (use-package flycheck From 35ad4894d91747f1cc90f19038ddb284b71dad44 Mon Sep 17 00:00:00 2001 From: Marc Date: Thu, 26 Dec 2019 09:29:51 +0000 Subject: [PATCH 22/36] added lexical binding, some cleanup --- init.org | 74 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 38 insertions(+), 36 deletions(-) diff --git a/init.org b/init.org index 21e5882..9f97a7f 100644 --- a/init.org +++ b/init.org @@ -25,6 +25,11 @@ - beancount configuration from config.org - CONTINUE TODO from config.org at Programming +* Header +Emacs variables are dynamically scoped. That's unusual for most languages, so disable it here, too +#+begin_src emacs-lisp +;;; init.el --- -*- lexical-binding: t -*- +#+end_src * First start When pulling the repository the first time, an initial init.el needs to be setup. After start it will replace itself with the configuration from init.org @@ -323,44 +328,41 @@ Windows Theme: * company #+BEGIN_SRC emacs-lisp -; (require 'company) - (use-package company - :defer 1 - :bind - (:map company-active-map - ("RET" . nil) - ([return] . nil) - ("TAB" . company-complete-selection) - ([tab] . company-complete-selection) - ("" . company-complete-common)) - :config - (global-company-mode 1) - (setq-default - company-idle-delay .2 - company-minimum-prefix-length 1 - company-require-match nil - company-show-numbers t - company-tooltip-align-annotations t)) - -; (require 'company-statistics) - (use-package company-statistics - :ensure t - :after company - :init - (setq company-statistics-file (concat MY--PATH_USER_LOCAL "company-statistics-cache.el"));~/.emacs.d/user-dir/company-statistics-cache.el") - :config - (company-statistics-mode 1)) +(use-package company + :defer 1 + :bind + (:map company-active-map + ("RET" . nil) + ([return] . nil) + ("TAB" . company-complete-selection) + ([tab] . company-complete-selection) + ("" . company-complete-common)) + :config + (setq company-idle-delay .2 + company-minimum-prefix-length 1 + company-require-match nil + company-show-numbers t + company-tooltip-align-annotations t) + (global-company-mode 1)) + +(use-package company-statistics + :ensure t + :after company + :init + (setq company-statistics-file (concat MY--PATH_USER_LOCAL "company-statistics-cache.el"));~/.emacs.d/user-dir/company-statistics-cache.el") + :config + (company-statistics-mode 1)) - (use-package company-dabbrev - :ensure nil - :after company - :config - (setq-default company-dabbrev-downcase nil)) +(use-package company-dabbrev + :ensure nil + :after company + :config + (setq-default company-dabbrev-downcase nil)) - (use-package company-box - :ensure t - :init - (add-hook 'company-mode-hook 'company-box-mode)) +(use-package company-box + :ensure t + :init + (add-hook 'company-mode-hook 'company-box-mode)) #+END_SRC ** company backends From dbcf000f64517dfdd35f162490223a080c29d691 Mon Sep 17 00:00:00 2001 From: Marc Date: Thu, 26 Dec 2019 09:44:14 +0000 Subject: [PATCH 23/36] now all org code blocks are evaluated without confirmation --- init.org | 42 +++++++++++++++++------------------------- 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/init.org b/init.org index 9f97a7f..d9f7f29 100644 --- a/init.org +++ b/init.org @@ -419,31 +419,23 @@ Windows Theme: org-src-tab-acts-natively t)) #+END_SRC ** languages -#+BEGIN_SRC emacs-lisp - (org-babel-do-load-languages - 'org-babel-load-languages - '((emacs-lisp . t) - (gnuplot . t) - (js . t) - (latex . t) - (lisp . t) - (python . t) - (shell . t) - (sqlite . t) - (org . t) - (R . t) - (scheme . t) - )) - - (defun me--org-confirm-babel-evaluate (lang body) - "Do not confirm evaluation for these languages." - (not (or (string= lang "python") - (string= lang "ipython") - (string= lang "emacs-lisp") - (string= lang "R") - (string= lang "latex") - (string= lang "sqlite")))) - (setq org-confirm-babel-evaluate 'me--org-confirm-babel-evaluate) +Set some languages and disable confirmation for evaluating code blocks C-c C-c +#+BEGIN_SRC emacs-lisp +(org-babel-do-load-languages + 'org-babel-load-languages + '((emacs-lisp . t) + (gnuplot . t) + (js . t) + (latex . t) + (lisp . t) + (python . t) + (shell . t) + (sqlite . t) + (org . t) + (R . t) + (scheme . t))) + +(setq org-confirm-babel-evaluate nil) #+END_SRC ** habits #+BEGIN_SRC emacs-lisp From 213bd2ab5d94928e20456bf7ae0cfd5717788edf Mon Sep 17 00:00:00 2001 From: Marc Date: Thu, 26 Dec 2019 09:47:25 +0000 Subject: [PATCH 24/36] changed moment when company mode is enabled --- init.org | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/init.org b/init.org index d9f7f29..2fadcb0 100644 --- a/init.org +++ b/init.org @@ -337,13 +337,14 @@ Windows Theme: ("TAB" . company-complete-selection) ([tab] . company-complete-selection) ("" . company-complete-common)) + :hook + (after-init . global-company-mode) :config (setq company-idle-delay .2 company-minimum-prefix-length 1 company-require-match nil company-show-numbers t - company-tooltip-align-annotations t) - (global-company-mode 1)) + company-tooltip-align-annotations t)) (use-package company-statistics :ensure t From b4ea19a56527611643e794c5b5a29b7dca0f5913 Mon Sep 17 00:00:00 2001 From: Marc Date: Thu, 26 Dec 2019 09:54:42 +0000 Subject: [PATCH 25/36] added yaml-mode --- init.org | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/init.org b/init.org index 2fadcb0..9e3e78d 100644 --- a/init.org +++ b/init.org @@ -703,6 +703,13 @@ Manage projects and jump quickly between its files (add-hook 'web-mode-hook 'smartparens-mode)) #+END_SRC +** YAML +#+begin_src emacs-lisp +(use-package yaml-mode + :if *linux* + :ensure t + :mode ("\\.yml$" . yaml-mode)) +#+end_src ** Python Systemseitig muss python-language-server installiert sein: pip3 install 'python-language-server[all]' From ae49c32e943ce739eae95df587c4e89684546ffb Mon Sep 17 00:00:00 2001 From: Marc Date: Thu, 26 Dec 2019 10:15:00 +0000 Subject: [PATCH 26/36] changed identifiers for systems --- init.org | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/init.org b/init.org index 9e3e78d..270b54e 100644 --- a/init.org +++ b/init.org @@ -87,12 +87,29 @@ Emacs variables are dynamically scoped. That's unusual for most languages, so di * Default settings #+BEGIN_SRC emacs-lisp -(setq *home_desktop* (string-equal (system-name) "marc") - ,*home_laptop* (string-equal (system-name) "laptop") - ,*work_local* (string-equal (system-name) "PMPCNEU08") - ,*work_remote* (string-equal (system-name) "PMTS01") - ,*linux* (string-equal system-type 'gnu/linux) - ,*windows* (string-equal system-type 'windows-nt)) +(defconst *linux* + (string-equal system-type 'gnu/linux) + "Is the system running Linux?") + +(defconst *windows* + (string-equal system-type 'windows-nt) + "Is the system running Windows?") + +(defconst *home_desktop* + (string-equal (system-name) "marc") + "Is emacs running on my desktop?") + +(defconst *home_laptop* + (string-equal (system-name) "laptop") + "Is emacs running on my laptop?") + +(defconst *work_local* + (string-equal (system-name) "PMPCNEU08") + "Is emacs running at work on the local system?") + +(defconst *work_remote* + (string-equal (system-name) "PMTS01") + "Is emacs running at work on the remote system?") #+END_SRC #+BEGIN_SRC emacs-lisp From 6746529bb35f878b71fab385d7fc84ecbb86a5c6 Mon Sep 17 00:00:00 2001 From: Marc Date: Thu, 26 Dec 2019 10:16:17 +0000 Subject: [PATCH 27/36] changed some defvars with defconsts --- init.org | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/init.org b/init.org index 270b54e..5656a4d 100644 --- a/init.org +++ b/init.org @@ -117,14 +117,14 @@ Emacs variables are dynamically scoped. That's unusual for most languages, so di (defvar MY--PATH_USER_GLOBAL (expand-file-name "~/.emacs.d/user-global/")) (when *linux* - (defvar MY--PATH_ORG_FILES (expand-file-name "~/Archiv/Organisieren/")) - (defvar MY--PATH_ORG_FILES_MOBILE (expand-file-name "~/Archiv/Organisieren/mobile/"))) - (defvar MY--PATH_ORG_JOURNAl (expand-file-name "~/Archiv/Organisieren/Journal/")) + (defconst MY--PATH_ORG_FILES (expand-file-name "~/Archiv/Organisieren/")) + (defconst MY--PATH_ORG_FILES_MOBILE (expand-file-name "~/Archiv/Organisieren/mobile/"))) + (defconst MY--PATH_ORG_JOURNAl (expand-file-name "~/Archiv/Organisieren/Journal/")) (when *work_remote* - (defvar MY--PATH_ORG_FILES "p:/Eigene Dateien/Notizen/") - (defvar MY--PATH_ORG_FILES_MOBILE nil) ;; hacky way to prevent "free variable" compiler error - (defvar MY--PATH_ORG_JOURNAL nil) ;; hacky way to prevent "free variable" compiler error - (defvar MY--PATH_START "p:/Eigene Dateien/Notizen/")) + (defconst MY--PATH_ORG_FILES "p:/Eigene Dateien/Notizen/") + (defconst MY--PATH_ORG_FILES_MOBILE nil) ;; hacky way to prevent "free variable" compiler error + (defconst MY--PATH_ORG_JOURNAL nil) ;; hacky way to prevent "free variable" compiler error + (defconst MY--PATH_START "p:/Eigene Dateien/Notizen/")) (setq bookmark-default-file (concat MY--PATH_USER_LOCAL "bookmarks")) (setq recentf-save-file (concat MY--PATH_USER_LOCAL "recentf")) (setq custom-file (concat MY--PATH_USER_LOCAL "custom.el")) ;; don't spam init.e with saved customization settings From 9f728b6f31d10de27015a3766b53c04d69f33bbe Mon Sep 17 00:00:00 2001 From: Marc Date: Thu, 26 Dec 2019 10:26:45 +0000 Subject: [PATCH 28/36] changed system identifier names --- init.org | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/init.org b/init.org index 5656a4d..1162d66 100644 --- a/init.org +++ b/init.org @@ -87,11 +87,11 @@ Emacs variables are dynamically scoped. That's unusual for most languages, so di * Default settings #+BEGIN_SRC emacs-lisp -(defconst *linux* +(defconst *sys/linux* (string-equal system-type 'gnu/linux) "Is the system running Linux?") -(defconst *windows* +(defconst *sys/windows* (string-equal system-type 'windows-nt) "Is the system running Windows?") @@ -116,7 +116,7 @@ Emacs variables are dynamically scoped. That's unusual for most languages, so di (defvar MY--PATH_USER_LOCAL (expand-file-name "~/.emacs.d/user-local/")) (defvar MY--PATH_USER_GLOBAL (expand-file-name "~/.emacs.d/user-global/")) -(when *linux* +(when *sys/linux* (defconst MY--PATH_ORG_FILES (expand-file-name "~/Archiv/Organisieren/")) (defconst MY--PATH_ORG_FILES_MOBILE (expand-file-name "~/Archiv/Organisieren/mobile/"))) (defconst MY--PATH_ORG_JOURNAl (expand-file-name "~/Archiv/Organisieren/Journal/")) @@ -144,7 +144,7 @@ Emacs variables are dynamically scoped. That's unusual for most languages, so di (set-terminal-coding-system 'utf-8) (set-keyboard-coding-system 'utf-8) (set-selection-coding-system 'utf-8) -(if *windows* +(if *sys/windows* (prefer-coding-system 'utf-8-dos) (prefer-coding-system 'utf-8)) @@ -181,7 +181,7 @@ Some windows specific stuff * visuals ** Font #+BEGIN_SRC emacs-lisp -(when *linux* +(when *sys/linux* (set-face-font 'default "Hack-10")) (when *work_remote* (set-face-font 'default "Lucida Sans Typewriter-11")) @@ -192,7 +192,7 @@ Some windows specific stuff #+BEGIN_SRC emacs-lisp (defun my/toggle-theme () (interactive) - (when (or *windows* *linux*) + (when (or *sys/windows* *sys/linux*) (if (eq (car custom-enabled-themes) 'tango-dark) (progn (disable-theme 'tango-dark) (load-theme 'tango)) @@ -205,7 +205,7 @@ Some windows specific stuff Windows Theme: #+BEGIN_SRC emacs-lisp -(when *windows* +(when *sys/windows* (load-theme 'tango)) #+END_SRC ** line wrappings @@ -419,7 +419,7 @@ Windows Theme: org-agenda-files (list (concat MY--PATH_ORG_FILES "notes.org") (concat MY--PATH_ORG_FILES "projects.org") (concat MY--PATH_ORG_FILES "todo.org"))) - (when *linux* + (when *sys/linux* (setq org-agenda-files (list org-agenda-files MY--PATH_ORG_FILES_MOBILE))) (setq org-id-locations-file (concat MY--PATH_USER_LOCAL ".org-id-locations") @@ -545,7 +545,7 @@ Vorerst deaktiviert, Nutzen evtl. nicht vorhanden #+BEGIN_SRC emacs-lisp (use-package org-journal - :if *linux* + :if *sys/linux* :ensure t :defer t :config @@ -723,7 +723,7 @@ Manage projects and jump quickly between its files ** YAML #+begin_src emacs-lisp (use-package yaml-mode - :if *linux* + :if *sys/linux* :ensure t :mode ("\\.yml$" . yaml-mode)) #+end_src From edab768dfc376347acea407e70da2bebbd5c475b Mon Sep 17 00:00:00 2001 From: Marc Date: Thu, 26 Dec 2019 10:29:42 +0000 Subject: [PATCH 29/36] streamlined system identifications --- init.org | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/init.org b/init.org index 1162d66..5b6d201 100644 --- a/init.org +++ b/init.org @@ -166,7 +166,7 @@ Emacs variables are dynamically scoped. That's unusual for most languages, so di Some windows specific stuff #+BEGIN_SRC emacs-lisp - (when (eq system-type 'windows-nt) + (when *sys/windows* (remove-hook 'find-file-hooks 'vc-refresh-state) (progn (setq gc-cons-threshold (* 511 1024 1024) @@ -735,7 +735,7 @@ Manage projects and jump quickly between its files https://github.com/emacs-lsp/lsp-mode#install-language-server #+BEGIN_SRC emacs-lisp -(if (string-equal system-type "gnu/linux") +(if *sys/linux* (defun my/postactivatehook () (setq lsp-python-ms-extra-paths pyvenv-virtual-env)) @@ -773,21 +773,21 @@ deactivate #+END_SRC #+BEGIN_SRC emacs-lisp - (if (string-equal system-type "gnu/linux") - (use-package beancount - :load-path "user-global/elisp" -; :ensure t - :defer t - :mode - ("\\.beancount$" . beancount-mode) - :init - (add-hook 'beancount-mode-hook 'company/beancount-mode-hook) +(use-package beancount + :if *sys/linux* + :load-path "user-global/elisp" +; :ensure t + :defer t + :mode + ("\\.beancount$" . beancount-mode) + :init + (add-hook 'beancount-mode-hook 'company/beancount-mode-hook) ; (add-hook 'beancount-mode-hook (pyvenv-activate "/opt/beancount")) ; (setenv "PATH" ; (concat "/opt/beancount/bin:" ; (getenv "PATH"))) - :config - (setq beancount-filename-main "/home/marc/Archiv/Finanzen/Transaktionen/transactions.beancount"))) + :config + (setq beancount-filename-main "/home/marc/Archiv/Finanzen/Transaktionen/transactions.beancount")) #+END_SRC To support org-babel, check if it can find the symlink to ob-beancount.el From e8895fc17cd259cb8e8ead28e356108926d1ca0f Mon Sep 17 00:00:00 2001 From: Marc Date: Thu, 26 Dec 2019 10:32:33 +0000 Subject: [PATCH 30/36] added some todos --- init.org | 2 ++ 1 file changed, 2 insertions(+) diff --git a/init.org b/init.org index 5b6d201..db44db4 100644 --- a/init.org +++ b/init.org @@ -21,9 +21,11 @@ - visual-regexp - org configuration: paths - org custom agenda + - org-ql (related to org agendas) - org configuration: everything else - beancount configuration from config.org - CONTINUE TODO from config.org at Programming + - all-the-icons? * Header Emacs variables are dynamically scoped. That's unusual for most languages, so disable it here, too From 3e14507c0c0149ae7b45c5243d23f484327f7348 Mon Sep 17 00:00:00 2001 From: Marc Date: Thu, 26 Dec 2019 10:49:20 +0000 Subject: [PATCH 31/36] added keybindings to smartparens --- init.org | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/init.org b/init.org index db44db4..54e2aee 100644 --- a/init.org +++ b/init.org @@ -692,8 +692,20 @@ Manage projects and jump quickly between its files (use-package smartparens :ensure t :diminish smartparens-mode + :bind + (:map smartparens-mode-map + ("C-M-f" . sp-forward-sexp) + ("C-M-b" . sp-backward-sexp) + ("C-M-a" . sp-backward-down-sexp) + ("C-M-e" . sp-up-sexp) + ("C-M-w" . sp-copy-sexp) + ("M-k" . sp-kill-sexp) + ("C-M-" . sp-slice-sexp-killing-backward) + ("C-S-" . sp-slice-sexp-killing-around) + ("C-]" . sp-select-next-thing-exchange)) :config - (setq sp-show-pair-from-inside nil) + (setq sp-show-pair-from-inside nil + sp-escape-quotes-after-insert nil) (require 'smartparens-config)) #+END_SRC From 405a1ef73673a4672dd85aaf7e66796bb26ce528 Mon Sep 17 00:00:00 2001 From: Marc Date: Thu, 26 Dec 2019 10:53:56 +0000 Subject: [PATCH 32/36] added identifier for emacs in gui --- init.org | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/init.org b/init.org index 54e2aee..269f6e6 100644 --- a/init.org +++ b/init.org @@ -89,6 +89,10 @@ Emacs variables are dynamically scoped. That's unusual for most languages, so di * Default settings #+BEGIN_SRC emacs-lisp +(defconst *sys/gui* + (display-graphic-p) + "Is emacs running in a gui?") + (defconst *sys/linux* (string-equal system-type 'gnu/linux) "Is the system running Linux?") From ce0b4791b50987c9796a830f1767f8e513ca21b6 Mon Sep 17 00:00:00 2001 From: Marc Date: Thu, 26 Dec 2019 10:55:29 +0000 Subject: [PATCH 33/36] changed check for gui identifier --- init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.org b/init.org index 269f6e6..d9ed81b 100644 --- a/init.org +++ b/init.org @@ -624,7 +624,7 @@ TODO Unterverzeichnisse wurden noch nicht getestet lsp-ui-sideline-enable nil lsp-ui-sideline-ignore-duplicate t lsp-ui-sideline-show-code-actions nil) - (when (display-graphic-p) + (when *sys/gui* (setq lsp-ui-doc-use-webkit t)) ;; workaround hide mode-line of lsp-ui-imenu buffer (defadvice lsp-ui-imenu (after hide-lsp-ui-imenu-mode-line activate) From beede1da35b4e340050cd94b49dd072b4eadf18a Mon Sep 17 00:00:00 2001 From: Marc Date: Thu, 26 Dec 2019 15:06:01 +0000 Subject: [PATCH 34/36] for now default theme for linux is tango --- init.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.org b/init.org index d9ed81b..5c66bf4 100644 --- a/init.org +++ b/init.org @@ -211,7 +211,7 @@ Some windows specific stuff Windows Theme: #+BEGIN_SRC emacs-lisp -(when *sys/windows* +(when (or *sys/windows* *sys/linux*) (load-theme 'tango)) #+END_SRC ** line wrappings From 57cae7d3f1b8bff6a215fbad43ad380d034c2db0 Mon Sep 17 00:00:00 2001 From: Marc Date: Thu, 26 Dec 2019 19:15:15 +0000 Subject: [PATCH 35/36] added emmet and hippie expand to include yasnippet to the same key --- init.org | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/init.org b/init.org index 5c66bf4..6109b88 100644 --- a/init.org +++ b/init.org @@ -650,9 +650,22 @@ TODO Unterverzeichnisse wurden noch nicht getestet :config (setq yas-snippet-dirs (list (concat MY--PATH_USER_GLOBAL "snippets"))) (yas-global-mode t) - (yas-reload-all)) + (yas-reload-all) + (unbind-key "TAB" yas-minor-mode-map) + (unbind-key "" yas-minor-mode-map)) #+end_src +** hippie expand +With hippie expand I am able to use yasnippet and emmet at the same time with the same key. +#+begin_src emacs-lisp +(use-package hippie-exp + :defer t + :bind + ("C-" . hippie-expand) + :config + (setq hippie-expand-try-functions-list + '(yas-hippie-try-expand emmet-expand-line))) +#+end_src ** flycheck #+BEGIN_SRC emacs-lisp (use-package flycheck @@ -738,6 +751,20 @@ Manage projects and jump quickly between its files (add-hook 'web-mode-hook 'smartparens-mode)) #+END_SRC +Emmet offers snippets, similar to yasnippet. +Default completion is C-j +[[https://github.com/smihica/emmet-mode#usage][Github]] + +#+begin_src emacs-lisp +(use-package emmet-mode + :ensure t + :defer t + :hook + ((web-mode . emmet-mode) + (css-mode . emmet-mode)) + :config + (unbind-key "C-" . emmet-mode-keymap)) +#+end_src ** YAML #+begin_src emacs-lisp (use-package yaml-mode From c9a8bfa52244386dd0a860118a79606e7a4eacd5 Mon Sep 17 00:00:00 2001 From: Marc Date: Thu, 26 Dec 2019 19:34:18 +0000 Subject: [PATCH 36/36] fixed bug in unbind key emmet --- init.org | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init.org b/init.org index 6109b88..391cb0b 100644 --- a/init.org +++ b/init.org @@ -642,6 +642,8 @@ TODO Unterverzeichnisse wurden noch nicht getestet #+END_SRC ** yasnippet +For useful snippet either install yasnippet-snippets or get them from here +[[https://github.com/AndreaCrotti/yasnippet-snippets][Github]] #+begin_src emacs-lisp (use-package yasnippet @@ -763,7 +765,7 @@ Default completion is C-j ((web-mode . emmet-mode) (css-mode . emmet-mode)) :config - (unbind-key "C-" . emmet-mode-keymap)) + (unbind-key "C-" emmet-mode-keymap)) #+end_src ** YAML #+begin_src emacs-lisp