dotfiles

Personal dotfiles.
git clone git://vcs.sapka.me/dotfiles
Log | Files | Refs | Submodules

commit b513b497b2332035995048b2f5d461da61dedb5f
parent e1a9b8fbe1af32266d0e8b3d1cdc5c86b208467a
Author: Michał M. Sapka <michal@sapka.me>
Date:   Sun,  4 Jun 2023 22:55:30 +0200

more emacs goodies

Diffstat:
Memacs/.emacs.d/config.org | 112++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------
1 file changed, 102 insertions(+), 10 deletions(-)

diff --git a/emacs/.emacs.d/config.org b/emacs/.emacs.d/config.org @@ -2,18 +2,23 @@ #+AUTHOR: Michał Sapka #+STARTUP: showall indent -* Table of contents :toc: +* Table of contents :toc_3: - [[#general-configuration][General configuration]] - [[#lexical-binding][Lexical binding]] - [[#package-management][Package management]] - [[#encoding][Encoding]] - [[#set-look-and-behavior][Set look and behavior]] - [[#autocomplete-user-input][Autocomplete user input]] + - [[#marginalia][Marginalia]] + - [[#savehist][Savehist]] - [[#asdf][ASDF]] - [[#tree-sitter][Tree sitter]] - [[#which-key][Which Key]] - [[#programing][Programing]] - [[#git][Git]] + - [[#magit][Magit]] + - [[#forge][Forge]] + - [[#git-gutter][Git gutter]] - [[#flycheck][Flycheck]] - [[#company-mode][Company mode]] - [[#indentation][Indentation]] @@ -24,10 +29,14 @@ - [[#email][Email]] - [[#mastodon][Mastodon]] - [[#rss][RSS]] + - [[#elfeed][Elfeed]] + - [[#elfeed-org][Elfeed-org]] + - [[#feeds][Feeds]] - [[#ebooks-reading][Ebooks reading]] - [[#org-mode][Org-mode]] - [[#org-mode-1][Org-mode]] - [[#toc-mode][TOC-mode]] + - [[#babel][Babel]] * General configuration ** Lexical binding @@ -87,14 +96,49 @@ Hide the UI (setq visible-bell t) #+END_SRC +Show line numbers in the gutter + +#+BEGIN_SRC emacs-lisp + (global-display-line-numbers-mode) +#+END_SRC + ** Autocomplete user input FIDO mode is all I need +REF: https://michal.sapka.me/2023/input-completition-in-emacs/ #+BEGIN_SRC emacs-lisp (fido-vertical-mode t) #+END_SRC +** Marginalia + +Marginalia adds extra information to the autocomplete minibuffer. Looks nice, but it sees slow +so we'll see. + +#+begin_src emacs-lisp + (use-package marginalia + :ensure t + ;; Bind `marginalia-cycle' locally in the minibuffer. To make the binding + ;; available in the *Completions* buffer, add it to the + ;; `completion-list-mode-map'. + :bind (:map minibuffer-local-map + ("M-A" . marginalia-cycle)) + :init + (marginalia-mode)) +#+end_src + +** Savehist + +#+begin_src emacs-lisp + (use-package savehist + :ensure t + :init + (savehist-mode)) +#+end_src + +#+RESULTS: + ** ASDF I use ASDF as my unified version manager. It doesn't play nicely with Emacs out of the box @@ -105,16 +149,13 @@ I use ASDF as my unified version manager. It doesn't play nicely with Emacs out ** Tree sitter +I don't get Tree Sitter but it makes syntax coloring more accurate. + #+BEGIN_SRC emacs-lisp (use-package tree-sitter :ensure t :config - ;; activate tree-sitter on any buffer containing code for which it has a parser available - (global-tree-sitter-mode) - ;; you can easily see the difference tree-sitter-hl-mode makes for python, ts or tsx - ;; by switching on and off - ;; (add-hook 'tree-sitter-after-on-hook #'tree-sitter-hl-mode) - ) + (global-tree-sitter-mode)) (use-package tree-sitter-langs :ensure t @@ -123,6 +164,8 @@ I use ASDF as my unified version manager. It doesn't play nicely with Emacs out ** Which Key +Essential package. An automatic cheat sheet for keyboard bindings. + #+BEGIN_SRC emacs-lisp (use-package which-key :config @@ -137,8 +180,12 @@ I use ASDF as my unified version manager. It doesn't play nicely with Emacs out * Programing +I'm a programmer by trade and passion. This part of the config may be the most expansive. + ** Git +They say it's the best UI for Git. I can't disagree. + *** Magit #+BEGIN_SRC emacs-lisp (use-package magit @@ -148,8 +195,18 @@ I use ASDF as my unified version manager. It doesn't play nicely with Emacs out (setq magit-save-repository-buffers nil)) #+END_SRC +*** Forge + +#+begin_src emacs-lisp + (use-package forge + :ensure t + :after magit) +#+end_src + *** Git gutter +Show changed lines in the gutter + #+BEGIN_SRC emacs-lisp (use-package git-gutter :ensure t @@ -212,6 +269,7 @@ Yeah, force indentation #+BEGIN_SRC emacs-lisp (use-package lsp-mode + :ensure t :init ;; set prefix for lsp-command-keymap (few alternatives - "C-l", "C-c l") (setq lsp-keymap-prefix "C-c l") @@ -232,7 +290,9 @@ Yeah, force indentation (setq lsp-ltex-version "16.0.0")) ;; optionally - (use-package lsp-ui :commands lsp-ui-mode) + (use-package lsp-ui + :ensure t + :commands lsp-ui-mode) #+END_SRC ** Ruby @@ -294,7 +354,7 @@ Yeah, force indentation (elfeed-org)) #+END_SRC -**** Feeds :elfeed: +*** Feeds :elfeed: ***** Blogs @@ -366,12 +426,13 @@ Level1Techs ****** https://pragmaticemacs.wordpress.com/feed/ ****** https://protesilaos.com/master.xml - +****** https://sqrtminusone.xyz/posts/index.xml ** Ebooks reading #+BEGIN_SRC emacs-lisp (use-package nov + :ensure t :config (add-to-list 'auto-mode-alist '("\\.epub\\'" . nov-mode)) ) @@ -401,3 +462,34 @@ A cool package which adds table of contents. Ref: [[https://github.com/snosov1/t (add-hook 'org-mode-hook 'toc-org-mode) ) #+END_SRC + +** Babel + +I want to use org with babel for research, fun and profit :-) + +Since it's already baked-in into Org, all I need to do is enable languages I will use. + +#+begin_src emacs-lisp + (org-babel-do-load-languages + 'org-babel-load-languages + '((ruby . t) + (sql . t) + (shell . t) + (emacs-lisp . t))) + + (setq org-confirm-babel-evaluate nil) +#+end_src + +Typing code blocks is tedious, so let's make it easier. Typing =<el<TAB>= will create new block. + +#+begin_src emacs-lisp + (require 'org-tempo) + + (add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp")) + (add-to-list 'org-structure-template-alist '("rb" . "src ruby")) + (add-to-list 'org-structure-template-alist '("sql" . "src sql")) + (add-to-list 'org-structure-template-alist '("sh" . "src shell")) +#+end_src + + +