diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | README.org | 50 | ||||
-rw-r--r-- | README.pdf | bin | 0 -> 102106 bytes | |||
-rw-r--r-- | blendoit/img/logo-blendux.png | bin | 0 -> 99153 bytes | |||
-rw-r--r-- | blendoit/img/logo-blendux.png.bkp | bin | 0 -> 99153 bytes | |||
-rw-r--r-- | blendoit/img/logo-blendux_small.png | bin | 0 -> 20233 bytes | |||
-rw-r--r-- | blendoit/init-blendoit.org | 191 | ||||
-rw-r--r-- | blendoit/init-blendoit.pdf | bin | 194114 -> 173421 bytes | |||
-rw-r--r-- | blendoit/test.org | 7 | ||||
-rw-r--r-- | init-custom.el | 17 | ||||
-rw-r--r-- | init.el | 5 |
11 files changed, 193 insertions, 78 deletions
@@ -15,6 +15,7 @@ transient/** blendoit/*.el # Misc +*.eld ido.last recentf srecode-map.el @@ -1,40 +1,64 @@ #+TITLE: GNU Emacs Configuration #+AUTHOR: Marius Peter -#+DATE: <2020-07-20 Mon> +#+DATE: <2020-07-23 Thu> +#+SETUPFILE: ~/org/templates/documents/personal.org * Installation + +** GNU Emacs + +*** Linux + +Use your package manager. + +/Use Arch Linux. Dunaát make me say it twice./ + +*** Windows + +Head on over to https://www.gnu.org/savannah-checkouts/gnu/emacs/download.html +and download yourself a /fresh/ copy of GNU Emacs. + +** My distribution -** Linux +*** Linux Backup your current =~/.emacs.d= with the following command: -#+BEGIN_SRC: emacs-lisp +#+BEGIN_SRC shell mv ~/.emacs.d ~/.emacs.d.bkp #+END_SRC Clone my configuration folder to your home directory: -#+BEGIN_SRC: emacs-lisp +#+BEGIN_SRC shell cd ~ git clone https://github.com/Blendoit/.emacs.d.git #+END_SRC +*** Windows + +Download a =.zip= of the files in this repository. Then, extract the =.zip=, and +rename the extracted folder to =.emacs.d=. Place this folder it in your home +folder (one level up from =Documents=, =Pictures= or =Desktop=). + * Main Files ** =init.el= - - This file's only purpose is to load my literate configuration. +This is the first editable file that GNU Emacs loads on startup. This file's +only purpose is to load my literate configuration =blendoit/init-blendoit.org=. + +** =init-custom.el= + +All customization options available in Emacs' GUI that can be saved with +=Options - Save Options= are saved here. + +This is useful to fool around with GUI customization options, without breaking +our manually written code. ** =blendoit/init-blendoit.org= - - Load my personal literate configuration files. - -** =blendoit/custom-file.el= - - - By default, all customization options available in Emacs' GUI that can be - saved with =Options - Save Options= are saved here. - - This is useful to fool around with GUI customization options, without - breaking our manually written code. +This is my personal literate configuration files. * Usage diff --git a/README.pdf b/README.pdf Binary files differnew file mode 100644 index 0000000..1b3a41d --- /dev/null +++ b/README.pdf diff --git a/blendoit/img/logo-blendux.png b/blendoit/img/logo-blendux.png Binary files differnew file mode 100644 index 0000000..36280ea --- /dev/null +++ b/blendoit/img/logo-blendux.png diff --git a/blendoit/img/logo-blendux.png.bkp b/blendoit/img/logo-blendux.png.bkp Binary files differnew file mode 100644 index 0000000..36280ea --- /dev/null +++ b/blendoit/img/logo-blendux.png.bkp diff --git a/blendoit/img/logo-blendux_small.png b/blendoit/img/logo-blendux_small.png Binary files differnew file mode 100644 index 0000000..12bb14d --- /dev/null +++ b/blendoit/img/logo-blendux_small.png diff --git a/blendoit/init-blendoit.org b/blendoit/init-blendoit.org index 9d00fa0..f36161e 100644 --- a/blendoit/init-blendoit.org +++ b/blendoit/init-blendoit.org @@ -1,23 +1,30 @@ #+TITLE: Blendoit's literate GNU Emacs config #+AUTHOR: Marius Peter -#+DATE: <2020-07-21 Tue> +#+DATE: <2020-07-23 Thu> + #+STARTUP: customtime showall #+SETUPFILE: ~/org/templates/documents/personal.org + #+INCLUDE: ~/org/templates/documents/personal-title.org #+BEGIN_abstract GNU Emacs is most often used as a text editor. The utmost level of -customisation is afforded by enabling the user to rewrite /any/ part of -the source code and observe the editor's modified behaviour in real -time. Since its inception in 1984, GNU Emacs has grown to be much more -than a full-featured, high-productivity text editor---new /modes/ have -been written to interact with hundreds of file formats, including -=.txt=, =.pdf=, =.jpg=, =.csv=, and =.zip= just to name a few. This -configuration file itself was written in /Org mode/, a collection of -functions enabling the harmonious mixing of code and comments in view -of publication: this is the endgame of /literate programming/. +customisation is afforded by enabling the user to rewrite /any/ part of the +source code and observe the editor's modified behaviour in real time. Since its +inception in 1984, GNU Emacs has grown to be much more than a full-featured, +high-productivity text editor---new /modes/ have been written to interact with +hundreds of file formats, including =.txt=, =.pdf=, =.jpg=, =.csv=, and =.zip= just to +name a few. This configuration file itself was written in /Org mode/, a +collection of functions enabling the harmonious mixing of code and comments in +view of publication: this is the endgame of /literate programming/. #+END_abstract +# ** Test + +# #+BEGIN_SRC emacs-lisp +# (org-babel-load-file "~/.emacs.d/blendoit/test.org") +# #+END_SRC + * Preliminary setup ** Garbage collection @@ -39,6 +46,16 @@ Makes opening emacs faster for following instances. (server-start) #+END_SRC +** Profiling --- start + +We start the profiler now , and will interrupt it in section [[Profiling --- +stop]]. We will then present profiling report in [[Profiling --- report]]. + +#+NAME: server-start +#+BEGIN_SRC emacs-lisp +; (profiler-start) +#+END_SRC + ** Custom file Load settings created automatically by GNU Emacs Custom. (For example, any @@ -105,6 +122,7 @@ mode. ** Navigation #+BEGIN_SRC emacs-lisp + (global-set-key (kbd "C-`") 'delete-other-windows) (global-set-key (kbd "C-s") 'save-buffer) (global-set-key (kbd "C-b") 'ibuffer-sidebar-toggle-sidebar) (global-set-key (kbd "C-o") 'menu-find-file-existing) @@ -129,25 +147,28 @@ The following bindings lead to more natural exit behaviors. * Packages +** Package archives + List of package archives. #+NAME: packages #+BEGIN_SRC emacs-lisp (require 'package) - (add-to-list 'package-archives '("melpa" . "https://melpa.milkbox.net/packages/") t) + (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) (add-to-list 'package-archives '("org" . "https://orgmode.org/elpa/") t) (package-initialize) #+END_SRC -#+RESULTS: packages +** use-package -Ensure =use-package= is installed. +Ensure =use-package= is installed, as well as all packages described in this +configuration file. #+BEGIN_SRC emacs-lisp (unless (package-installed-p 'use-package) - (package-refresh-contents) - (package-install 'use-package) - (eval-when-compile (require 'use-package))) + (package-refresh-contents) + (package-install 'use-package) + (eval-when-compile (require 'use-package))) (setq use-package-always-ensure t) #+END_SRC @@ -325,13 +346,13 @@ LaTeX \rightarrow PDF. (global-set-key (kbd "C-c e") 'blendoit-org-quick-export) #+END_SRC -** =gnuplot= +** gnuplot #+BEGIN_SRC emacs-lisp (use-package gnuplot) #+END_SRC -** =company= +** company # #+BEGIN_SRC emacs-lisp # (use-package company) @@ -350,7 +371,9 @@ LaTeX \rightarrow PDF. SCHEDULED: <2020-07-21 Tue> #+BEGIN_SRC emacs-lisp -; (use-package ibuffer-sidebar +(use-package ibuffer-sidebar) +(ibuffer-sidebar-show-sidebar) + ; :bind ("mouse-1" . ibuffer-mouse-visit-buffer) ; :bind ("mouse-3" . ibuffer-mouse-toggle-mark)) @@ -380,14 +403,12 @@ SCHEDULED: <2020-07-21 Tue> Auto completion. #+BEGIN_SRC emacs-lisp -(use-package ivy - :config + (use-package ivy + :config + (setq ivy-use-virtual-buffers t + ivy-count-format "%d/%d " + enable-recursive-minibuffers t)) (ivy-mode t) - (setq ivy-use-virtual-buffers t - ivy-count-format "%d/%d " - enable-recursive-minibuffers t)) - - (use-package ivy-hydra) #+END_SRC *** Counsel @@ -395,11 +416,11 @@ Auto completion. Wonderful counsellor! #+BEGIN_SRC emacs-lisp -(use-package counsel - :bind ("M-x" . counsel-M-x) - :config (counsel-mode)) + (use-package counsel + :bind ("M-x" . counsel-M-x) + :config (counsel-mode t)) -(global-set-key (kbd "C-f") 'counsel-grep-or-swiper) + (global-set-key (kbd "C-f") 'counsel-grep-or-swiper) #+END_SRC *** Swiper @@ -409,14 +430,6 @@ Auto completion. :bind (("C-f" . counsel-grep-or-swiper))) #+END_SRC -** Ido - -# #+BEGIN_SRC emacs-lisp -# (setq ido-enable-flex-matching t) -# (setq ido-everywhere t) -# (ido-mode 1) -# #+END_SRC - ** Company #+NAME: company @@ -447,17 +460,46 @@ Auto completion. :config (pdf-loader-install)) #+END_SRC +** Dashboard + +We replace the standard welcome screen with our own. + +#+BEGIN_SRC emacs-lisp +(setq inhibit-startup-message t) +(use-package dashboard + :config + (dashboard-setup-startup-hook) + (setq dashboard-startup-banner "~/.emacs.d/blendoit/img/logo-blendux_small.png") + (setq dashboard-items '((recents . 5) + (projects . 5))) + (setq dashboard-banner-logo-title "The editor for the 2nd millenium.")) +#+END_SRC + +** Projectile + +This enables us to better manage our =.git= projects. + +#+BEGIN_SRC emacs-lisp +(use-package projectile + :bind ("C-c p" . 'projectile-command-map) + :init (projectile-mode 1) + (setq projectile-completion-system 'ivy)) +#+END_SRC + * Cosmetics ** Faces & cursors In order to imitate other modern text editors, we'll resort to a blinking bar -cursor. +cursor. The default cursor already blinks. *** Default cursor +In files containing only fixed-pitch fonts (i.e. files containing only code), +the cursor becomes more visible box. + #+BEGIN_SRC emacs-lisp -(setq-default cursor-type (quote bar)) +(setq-default cursor-type (quote box)) #+END_SRC *** Mixed pitch in Org mode @@ -467,14 +509,35 @@ modes. #+BEGIN_SRC emacs-lisp (use-package mixed-pitch - :hook ((org-mode - info-mode) . mixed-pitch-mode)) + :hook ((org-mode . mixed-pitch-mode) + (Info-mode . mixed-pitch-mode))) #+END_SRC -** All the icons +** Initial frame + +These settings affect the first and subsequent frames spawned by Emacs. #+BEGIN_SRC emacs-lisp -(use-package all-the-icons) +(if (display-graphic-p) + (progn + (setq initial-frame-alist + '( + (tool-bar-lines . 1) + (width . 80) ; chars + (height . 52) ; lines + (alpha . (90 . 50)))) + (setq default-frame-alist + '( + (tool-bar-lines . 1) + (width . 80) + (height . 52) + (alpha . (90 . 50)))))) +#+END_SRC + +** Scrollbars + +#+BEGIN_SRC emacs-lisp +(set-window-scroll-bars (minibuffer-window) nil nil) #+END_SRC ** Theme @@ -484,19 +547,13 @@ modes. ;; :config ;; (load-theme 'zenburn)) -(load-theme 'wombat) +; (load-theme 'wombat) #+END_SRC -** Transparency - -#+BEGIN_SRC emacs-lisp -(add-to-list 'default-frame-alist '(alpha . (90 . 50))) -#+END_SRC - -** Scrollbars +** All the icons #+BEGIN_SRC emacs-lisp -(set-window-scroll-bars (minibuffer-window) nil nil) +(use-package all-the-icons) #+END_SRC * Editing preferences @@ -515,21 +572,35 @@ This is just a better default. c-basic-offset 4) #+END_SRC -** Initial & subsequent frame size +** Recent files -# #+BEGIN_SRC emacs-lisp -# (add-to-list 'initial-frame-alist '((width . 79) (height . 60))) -# (add-to-list 'default-frame-alist '((width . 60) (height . 20))) -# #+END_SRC +#+BEGIN_SRC emacs-lisp +(recentf-mode 1) +(setq recentf-max-menu-items 25) +(setq recentf-max-saved-items 25) +(run-at-time nil (* 1 60) 'recentf-save-list) +#+END_SRC ** Better parentheses #+BEGIN_SRC emacs-lisp (use-package smartparens :config - (add-hook 'prog-mode-hook 'smartparens-mode)) + (add-hook 'prog-mode-hook #'smartparens-mode)) (use-package rainbow-delimiters :config - (add-hook 'prog-mode-hook 'rainbow-delimiters-mode)) + (add-hook 'prog-mode-hook #'rainbow-delimiters-mode)) +#+END_SRC + +* Profiling --- stop + +#+BEGIN_SRC emacs-lisp +;; (profiler-stop) +#+END_SRC + +* Profiling --- report + +#+BEGIN_SRC emacs-lisp +;; (profiler-report) #+END_SRC diff --git a/blendoit/init-blendoit.pdf b/blendoit/init-blendoit.pdf Binary files differindex bfe16f0..7507a93 100644 --- a/blendoit/init-blendoit.pdf +++ b/blendoit/init-blendoit.pdf diff --git a/blendoit/test.org b/blendoit/test.org new file mode 100644 index 0000000..d4492b8 --- /dev/null +++ b/blendoit/test.org @@ -0,0 +1,7 @@ +** hl-line + +Highlight line at point. + +#+BEGIN_SRC emacs-lisp +(when window-system (add-hook 'prog-mode-hook 'hl-line-mode)) +#+END_SRC diff --git a/init-custom.el b/init-custom.el index 0011f89..beb4fe0 100644 --- a/init-custom.el +++ b/init-custom.el @@ -1,3 +1,9 @@ +;;; init-custom.el --- Where Emacs saves gui-settable customizations. + +;;; Commentary: + +;;; Code: + (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. @@ -15,7 +21,7 @@ '(fci-rule-color "#383838") '(ibuffer-sidebar-display-column-titles t) '(ibuffer-sidebar-display-summary t) - '(ibuffer-sidebar-width 22) + '(ibuffer-sidebar-width 18) '(ledger-reports (quote (("bal" "%(binary) -f %(ledger-file) bal") @@ -27,11 +33,12 @@ ("account" "%(binary) -f %(ledger-file) reg %(account)") ("budget" "%(binary) -f %(ledger-file) budget --exchange USD")))) '(line-number-mode nil) + '(mixed-pitch-variable-pitch-cursor (quote bar)) '(mode-line-format (quote ("%e" mode-line-front-space mode-line-mule-info mode-line-client mode-line-modified mode-line-remote mode-line-frame-identification mode-line-buffer-identification " " (vc-mode vc-mode) - " " mode-line-modes mode-line-misc-info mode-line-end-spaces))) + " " mode-line-misc-info mode-line-end-spaces))) '(nrepl-message-colors (quote ("#CC9393" "#DFAF8F" "#F0DFAF" "#7F9F7F" "#BFEBBF" "#93E0E3" "#94BFF3" "#DC8CC3"))) @@ -94,11 +101,12 @@ '(org-latex-pdf-process (quote ("latexmk -pdf -f -interaction=nonstopmode -pdflatex=\"%latex\" -outdir=%o %f"))) + '(org-latex-toc-command "\\tableofcontents\\clearpage") '(org-startup-align-all-tables t) '(org-time-stamp-custom-formats (quote ("%d %b, %Y (%a)" . "%d %b, %Y (%a), at %H:%M"))) '(package-selected-packages (quote - (minimap gnuplot ledger-mode company-mode wombat-theme wombar-theme which-key srefactor-lisp srefactor all-the-icons flycheck ibuffer-sidebar pdf-tools magit rainbow-delimiters smartparens mixed-pitch org-bullets use-package tabbar powerline ivy-hydra flatui-theme evil counsel company benchmark-init))) + (projectile minimap gnuplot ledger-mode company-mode wombat-theme wombar-theme which-key srefactor-lisp srefactor all-the-icons flycheck ibuffer-sidebar pdf-tools magit rainbow-delimiters smartparens mixed-pitch org-bullets use-package tabbar powerline ivy-hydra flatui-theme evil counsel company benchmark-init))) '(pdf-view-midnight-colors (quote ("#DCDCCC" . "#383838"))) '(save-place-mode t) '(send-mail-function (quote smtpmail-send-it)) @@ -132,7 +140,8 @@ ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(default ((t (:family "Hack" :foundry "SRC" :slant normal :weight normal :height 142 :width normal)))) - '(fixed-pitch ((t (:family "Hack")))) + '(cursor ((t (:background "red")))) + '(fixed-pitch ((t (:family "Dejavu Serif")))) '(org-document-title ((t (:inherit default :weight bold :font "Liberation Sans" :height 2.0 :underline nil)))) '(org-level-1 ((t (:inherit default :weight bold :font "Liberation Sans" :height 1.75)))) '(org-level-2 ((t (:inherit default :weight bold :font "Liberation Sans" :height 1.5)))) @@ -1,6 +1,9 @@ -;;; init.el +;;; init.el --- First file ran by GNU Emacs. ;; Load literate configuration file I created for GNU Emacs. ;; The ultimate goal is to transition most of the custom settings ;; to explicitly defined customisations. + +;;; Code: + (org-babel-load-file "~/.emacs.d/blendoit/init-blendoit.org") |