diff --git a/agenda.org b/agenda.org new file mode 100644 index 0000000..e69de29 diff --git a/config.org b/config.org index 078c788..9e0064d 100644 --- a/config.org +++ b/config.org @@ -1,4 +1,4 @@ -* Bloxie's Emacs Configuration +* Bloxie's Emacs Configuration ** By Curt Spark / Bloxiebird. * Introduction @@ -65,11 +65,35 @@ Install the package, enable it and ensure that it always is installed: *** Theming The theme for Emacs. Install and set the theme, ensuring that it is always installed: -#+BEGIN_SRC emacs-lisp +Old theme for if you'd like to follow Xresources ++BEGIN_SRC emacs-lisp (use-package xresources-theme :ensure t :init (load-theme 'xresources t)) ++END_SRC + +#+BEGIN_SRC emacs-lisp + (use-package doom-themes + :ensure t + :config + ;; Global settings (defaults) + (setq doom-themes-enable-bold t ; if nil, bold is universally disabled + doom-themes-enable-italic t) ; if nil, italics is universally disabled + + (load-theme 'doom-gruvbox t) + + ;; Enable flashing mode-line on errors + (doom-themes-visual-bell-config) + + ;; Enable custom neotree theme (all-the-icons must be installed!) + (doom-themes-neotree-config) + ;; or for treemacs users + (setq doom-themes-treemacs-theme "doom-colors") ; use the colorful treemacs theme + (doom-themes-treemacs-config) + + ;; Corrects (and improves) org-mode's native fontification. + (doom-themes-org-config)) #+END_SRC *** All The Icons All The Icons is a package to display cool icons within Emacs. @@ -156,6 +180,40 @@ Install the package, enable it and ensure that it always is installed: )) #+END_SRC ** Custom +*** Auto Popup frame Mode +A mode that is similiar in functionality to pop-up-frame, however much more granular in control and toggleable as it is mode. Will stop duplicate windows from creating new frames etc. + +Using simpler solution instead: +#+BEGIN_SRC emacs-lisp + (setq pop-up-frames t) +#+END_SRC + ++BEGIN_SRC emacs-lisp + (defun which-active-modes () + "Which minor modes are enabled in the current buffer." + (let ((active-modes)) + (mapc (lambda (mode) (condition-case nil + (if (and (symbolp mode) (symbol-value mode)) + (add-to-list 'active-modes mode)) + (error nil) )) + minor-mode-list) + active-modes)) + + (defun pop-up-frames-switch-to-buffer (buffer alist) + "Auto Pop up frames switch to buffer command." + (member 'pop-up-frames-mode (which-active-modes))) + + (setq display-buffer-alist + (append display-buffer-alist + '((pop-up-frames-switch-to-buffer . ((display-buffer-reuse-window display-buffer-pop-up-frame) . ((reusable-frames . 0))) + )))) + + (define-minor-mode pop-up-frames-mode + "Pop up frames minor mode" + :lighter " PUF") + + (provide 'pop-up-frames-mode) ++END_SRC *** Resizing Buffers These are controls to resize the width and height of windows. Set keys: @@ -165,6 +223,23 @@ Set keys: (global-set-key (kbd "") 'shrink-window-horizontally) (global-set-key (kbd "") 'enlarge-window-horizontally) #+END_SRC +*** Split and Follow Buffer +When splitting a window vertically or horizontally, make sure the mouse and focus follows that new window. +#+BEGIN_SRC emacs-lisp + (defun split-and-follow-horizontally () + (interactive) + (split-window-below) + (balance-windows) + (other-window 1)) + (global-set-key (kbd "C-x 2") 'split-and-follow-horizontally) + + (defun split-and-follow-vertically () + (interactive) + (split-window-right) + (balance-windows) + (other-window 1)) + (global-set-key (kbd "C-x 3") 'split-and-follow-vertically) +#+END_SRC ** Autosave Default Emacs will store backup and "temporary" files in the edited files directory, instead this changes it to move it to the UNIX Temporary Directory. Set backup/temporary file directories: @@ -218,6 +293,25 @@ Set Minor Mode as Global : (global-rainbow-mode 1) #+END_SRC +** Pdf Viewer +PDF Tools is, among other things, a replacement of DocView for PDF +files. The key difference is that pages are not pre-rendered by +e.g. ghostscript and stored in the file-system, but rather created +on-demand and stored in memory. + +Actually, displaying PDF files is just one part of PDF Tools. Since +poppler can provide us with all kinds of information about a document +and is also able to modify it, there is a lot more we can do with +it. + +Install the package, enable it and ensure that it always is installed: +#+BEGIN_SRC emacs-lisp + (use-package pdf-tools + :ensure t + :init + (pdf-loader-install)) +#+END_SRC + ** Org Mode *** Simple Org Mode Preview These are a simple set of functions that will automatically refresh @@ -415,14 +509,32 @@ Company Box Mode is a mode that gives Company menu options icons. ** Multiple Cursors The Multiple Cursors package is pretty self explanatory, you can select and manipulate multiple lines of the same text at the same time, move the cursors in unison. Etc. Install the package, enable it and ensure that it always is installed, and then bind the useful functions to a mnenomic key chord: -#+BEGIN_SRC emacs-lisp + +To remove the cursors on non-evil mode implementation, use keybind C-g. +For non-evil mode: ++BEGIN_SRC emacs-lisp (use-package multiple-cursors :ensure t :bind ("C-c m" . 'mc/mark-next-like-this) :bind ("C-c C-m" . 'mc/mark-all-like-this)) ++END_SRC + +To undo the last cursors added on evil mode implementation, type gru in NORMAL mode. +To remove the cursors on evil mode implementation, type grq in NORMAL mode. +For evil mode: +#+BEGIN_SRC emacs-lisp + (use-package evil-mc + :ensure t + :config + (global-evil-mc-mode 1) + :bind + ("C-c m" . 'evil-mc-make-all-cursors) + :bind + ("C-c C-m" . 'evil-mc-make-and-goto-next-match)) #+END_SRC + ** Expand Region Auto selects a region of text/code, if executed multiple times it will wrap further, like layers of a binary onion. Install the package, enable it and ensure that it always is installed, and then bind the useful functions to a mnenomic key chord: diff --git a/init.el b/init.el index 779da4a..e5302f4 100644 --- a/init.el +++ b/init.el @@ -1,4 +1,4 @@ -;; Added by Package.el. This must come before configurations of +;; Added by Package.el. This must come before configurations of ;; installed packages. Don't delete this line. If you don't want it, ;; just comment it out by adding a semicolon to the start of the line. ;; You may delete these explanatory comments. @@ -27,14 +27,11 @@ ;; If there is more than one, they won't work right. '(ansi-color-names-vector ["#d2ceda" "#f2241f" "#67b11d" "#b1951d" "#3a81c3" "#a31db1" "#21b8c7" "#655370"]) - '(custom-enabled-themes (quote (ewal-doom-one))) '(custom-safe-themes - (quote - ("ba72dfc6bb260a9d8609136b9166e04ad0292b9760a3e2431cf0cd0679f83c3a" "e1ecb0536abec692b5a5e845067d75273fe36f24d01210bf0aa5842f2a7e029f" "be9645aaa8c11f76a10bcf36aaf83f54f4587ced1b9b679b55639c87404e2499" "8a379e7ac3a57e64de672dd744d4730b3bdb88ae328e8106f95cd81cbd44e0b6" "41098e2f8fa67dc51bbe89cce4fb7109f53a164e3a92356964c72f76d068587e" "bffa9739ce0752a37d9b1eee78fc00ba159748f50dc328af4be661484848e476" "fa2b58bb98b62c3b8cf3b6f02f058ef7827a8e497125de0254f56e373abee088" "2035a16494e06636134de6d572ec47c30e26c3447eafeb6d3a9e8aee73732396" "86704574d397606ee1433af037c46611fb0a2787e8b6fd1d6c96361575be72d2" "a41b81af6336bd822137d4341f7e16495a49b06c180d6a6417bf9fd1001b6d2b" "3c83b3676d796422704082049fc38b6966bcad960f896669dfc21a7a37a748fa" default))) + '("7546a14373f1f2da6896830e7a73674ef274b3da313f8a2c4a79842e8a93953e" "d6603a129c32b716b3d3541fc0b6bfe83d0e07f1954ee64517aa62c9405a3441" "8f5a7a9a3c510ef9cbb88e600c0b4c53cdcdb502cfe3eb50040b7e13c6f4e78e" "ba72dfc6bb260a9d8609136b9166e04ad0292b9760a3e2431cf0cd0679f83c3a" "e1ecb0536abec692b5a5e845067d75273fe36f24d01210bf0aa5842f2a7e029f" "be9645aaa8c11f76a10bcf36aaf83f54f4587ced1b9b679b55639c87404e2499" "8a379e7ac3a57e64de672dd744d4730b3bdb88ae328e8106f95cd81cbd44e0b6" "41098e2f8fa67dc51bbe89cce4fb7109f53a164e3a92356964c72f76d068587e" "bffa9739ce0752a37d9b1eee78fc00ba159748f50dc328af4be661484848e476" "fa2b58bb98b62c3b8cf3b6f02f058ef7827a8e497125de0254f56e373abee088" "2035a16494e06636134de6d572ec47c30e26c3447eafeb6d3a9e8aee73732396" "86704574d397606ee1433af037c46611fb0a2787e8b6fd1d6c96361575be72d2" "a41b81af6336bd822137d4341f7e16495a49b06c180d6a6417bf9fd1001b6d2b" "3c83b3676d796422704082049fc38b6966bcad960f896669dfc21a7a37a748fa" default)) '(fci-rule-color "#a28c6f") '(hl-todo-keyword-faces - (quote - (("TODO" . "#dc752f") + '(("TODO" . "#dc752f") ("NEXT" . "#dc752f") ("THEM" . "#2d9574") ("PROG" . "#3a81c3") @@ -48,15 +45,14 @@ ("TEMP" . "#b1951d") ("FIXME" . "#dc752f") ("XXX+" . "#dc752f") - ("\\?\\?\\?+" . "#dc752f")))) + ("\\?\\?\\?+" . "#dc752f"))) '(jdee-db-active-breakpoint-face-colors (cons "#030100" "#A76A19")) '(jdee-db-requested-breakpoint-face-colors (cons "#030100" "#813c07")) '(jdee-db-spec-breakpoint-face-colors (cons "#030100" "#100e0d")) '(objed-cursor-color "#874804") '(package-selected-packages - (quote - (omnisharp csharp-mode bug-hunter ewal-doom-themes ewal-evil-cursors ewal-spacemacs-themes ewal org-bullets company flyspell-correct-ivy evil ivy which-key use-package))) - '(pdf-view-midnight-colors (quote ("#655370" . "#fbf8ef"))) + '(omnisharp csharp-mode bug-hunter ewal-doom-themes ewal-evil-cursors ewal-spacemacs-themes ewal org-bullets company flyspell-correct-ivy evil ivy which-key use-package)) + '(pdf-view-midnight-colors '("#655370" . "#fbf8ef")) '(rustic-ansi-faces ["#040201" "#874804" "#813c07" "#a45101" "#A76A19" "#D76C03" "#F09010" "#e8c99f"]) '(vc-annotate-background "#040201")