From 662c04cada9f0e92ec30aeafb6755efed7afbc05 Mon Sep 17 00:00:00 2001 From: luxick Date: Mon, 14 Sep 2020 15:14:02 +0200 Subject: [PATCH] Misc changes and cleanup. --- README.org | 180 ++++++++++++++++++++--------------------------------- 1 file changed, 68 insertions(+), 112 deletions(-) diff --git a/README.org b/README.org index 7315a9c..6b6eafb 100644 --- a/README.org +++ b/README.org @@ -140,21 +140,23 @@ And it should be accessible with a quick keystroke: (mapc load-it (directory-files dir nil "\\.el$")))) #+END_SRC * Theming -Load font from file. See [[https://github.com/rougier/elegant-emacs]] for more. +Apply a nice looking theme. + #+BEGIN_SRC emacs-lisp ;; Light Theme (use-package modus-operandi-theme) (load-theme 'modus-operandi t) - ;; Dark Theme - ;(use-package modus-vivendi-theme) - ;(load-theme 'modus-vivendi t) + ;; Syntax highlighing + (setq modus-operandi-theme-faint-syntax t) + + (setq modus-operandi-theme-org-blocks "greyscale") (setq default-frame-alist (append (list '(width . 90) '(height . 50) '(vertical-scroll-bars . nil) '(internal-border-width . 10) - '(font . "Roboto Mono Light 10")))) + '(font . "Roboto Mono Light 11")))) #+END_SRC Use a nice looking modeline package @@ -167,84 +169,53 @@ Use a nice looking modeline package Use Ivy to make minibuf promts better. Adds the ability to sort and filter. ** Use Ivy #+BEGIN_SRC emacs-lisp - (use-package ivy - :init - (ivy-mode 1) - (unbind-key "S-SPC" ivy-minibuffer-map) - (setq ivy-height 30 - ivy-use-virtual-buffers t - ivy-use-selectable-prompt t) - (defun swiper-at-point () - (interactive) - (swiper (thing-at-point 'word))) - :bind (("C-x b" . ivy-switch-buffer) - ("C-c C-r" . ivy-resume) - ("C-c s" . swiper-at-point) - ("C-s" . swiper)) - :diminish) + (use-package ivy + :diminish + :init + (ivy-mode 1) + (unbind-key "S-SPC" ivy-minibuffer-map) + (setq ivy-height 30 + ivy-use-virtual-buffers t + ivy-use-selectable-prompt t) + :bind (("C-x b" . ivy-switch-buffer) + ("C-c C-r" . ivy-resume) + ("C-s" . swiper))) - ;; ivy-rich makes Ivy look a little bit more like Helm. - (use-package ivy-rich - :after counsel - :custom - (ivy-virtual-abbreviate 'full - ivy-rich-switch-buffer-align-virtual-buffer t - ivy-rich-path-style 'abbrev) - :init - (ivy-rich-mode)) + ;; ivy-rich makes Ivy look a little bit more like Helm. + (use-package ivy-rich + :after counsel + :custom + (ivy-virtual-abbreviate 'full + ivy-rich-switch-buffer-align-virtual-buffer t + ivy-rich-path-style 'abbrev) + :init + (ivy-rich-mode)) - (use-package ivy-hydra) + (use-package ivy-hydra) #+END_SRC ** Smex Sort commands by recency in ivy windows #+BEGIN_SRC emacs-lisp - (use-package smex) + (use-package smex) #+END_SRC * Counsel #+BEGIN_SRC emacs-lisp - (use-package counsel - :ensure t - :after ivy - :init - (counsel-mode 1) - - :bind (("C-c ;" . counsel-M-x) - ("C-c U" . counsel-unicode-char) - ("C-c i" . counsel-imenu) - ("C-x f" . counsel-find-file) - ("C-c y" . counsel-yank-pop) - ("C-c r" . counsel-recentf) - :map ivy-minibuffer-map - ("C-r" . counsel-minibuffer-history)) - :diminish) + (use-package counsel + :after ivy + :init (counsel-mode 1) + :bind (("C-c ;" . counsel-M-x) + ("C-c U" . counsel-unicode-char) + ("C-c i" . counsel-imenu) + ("C-x f" . counsel-find-file) + ("C-c y" . counsel-yank-pop) + ("C-c r" . counsel-recentf) + :map ivy-minibuffer-map + ("C-r" . counsel-minibuffer-history)) + :diminish) #+END_SRC -* Undo Tree -Using the beauty that is undo-tree, we can easily navigate through history of a buffer. -This includes obviously going back in edit history, but also branching of end returning to previous states. -#+BEGIN_SRC emacs-lisp - (use-package undo-tree - :bind (("C-x u" . undo-tree-visualize) - ("C-z" . undo-tree-undo) - ("C-S-z" . undo-tree-redo)) - :config - (global-undo-tree-mode +1) - (unbind-key "M-_" undo-tree-map) - :diminish) - - ;; Trying undo-propose, which seems to offer a better experience, as - ;; undo tree is prone to losing data. - (use-package undo-propose - :disabled - :bind (("C-c _" . undo-propose) - :map undo-propose-mode-map - ("" . undo-only))) -#+END_SRC -With this we can use ~C-x u~ in any buffer to bring up the tree and navigate it using the arrow key. -Once in a state we agree with, just press ~q~ and we are done. - * Magit Magit is THE go to package for using git in emacs. #+BEGIN_SRC emacs-lisp @@ -314,7 +285,6 @@ I use a single file to dump all links I plan on viewing later. (interactive) (find-file link-dump)) #+END_SRC - ** Configure org-mode This is the main configuration for the infamous org-mode. The most important parts are configuring key bindings to quickly access the files we have defined above. @@ -347,7 +317,6 @@ The most important parts are configuring key bindings to quickly access the file org-startup-with-inline-images t org-pretty-entities t org-indent-mode t - org-ellipsis "⤵" org-footnote-section nil org-hide-leading-stars nil org-link-file-path-type 'relative @@ -366,11 +335,10 @@ When archiving items in org files, the default ist to crate a separate file name This clutters up my notes folder quite a bit, as I use a lot of separate files with thier respective archives. All archives should be stored in a single ~.archive~ file per directory. #+BEGIN_SRC emacs-lisp - (setq org-archive-location "./.archive::* From %s") + (setq org-archive-location "./.archive::* From %s") #+END_SRC - ** Beautify org-mode -*** Icons for headline indentation +*** Icons #+BEGIN_SRC emacs-lisp (use-package org-bullets :init (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))) @@ -378,7 +346,12 @@ All archives should be stored in a single ~.archive~ file per directory. (setq org-bullets-bullet-list '("◉" "○" "◆" "✿" "✚" "▶")) #+END_SRC -*** Replace checkmark with unicode icons +Ellipsis icon: +#+BEGIN_SRC emacs-lisp + (setq org-ellipsis "▾") +#+END_SRC + +Nice Icons for lists: #+BEGIN_SRC emacs-lisp (use-package pretty-mode :init (global-pretty-mode t)) @@ -417,56 +390,44 @@ We also want them in exported HTML files (0 (prog1 () (compose-region (match-beginning 1) (match-end 1) "•")))))) #+END_SRC -** Prettier Timestamps in Exports -The default timestamps look pretty unintuitive, with all the angle brackets and all. Let's make them look better. -#+BEGIN_SRC emacs-lisp - ;;(add-to-list 'org-export-filter-timestamp-functions - ;; #'endless/filter-timestamp) - ;;(defun endless/filter-timestamp (trans back _comm) - ;; (pcase back - ;; ((or `jekyll `html) - ;; (replace-regexp-in-string "&[lg]t;" "" trans)) - ;; (`latex - ;; (replace-regexp-in-string "[<>]" "" trans)))) -#+END_SRC -Removed for now, this somehow breaks emacs - -OK, no more brackets. Now for a better formatted display. - +*** Prettier Timestamps in Exports #+BEGIN_SRC emacs-lisp (setq-default org-display-custom-times t) (setq org-time-stamp-custom-formats '("<%a %d.%m.%Y>" . "<%d.%m.%y %H:%M>")) #+END_SRC - ** Templates *** Babel Here we set custom templates to be used for structure expansion. These are used when we type "<" folowed by the shortcut for a template and hit "TAB". e.g. "