2 Commits c6517567c8 ... 9795ec77d5

Autor SHA1 Mensagem Data
  Eiyeron Fulmincendii 9795ec77d5 Buffer narrowing shortcuts mapped on SPC-v- 4 anos atrás
  Eiyeron Fulmincendii 39218f34d3 Quick mode selector 4 anos atrás
1 arquivos alterados com 32 adições e 0 exclusões
  1. 32 0
      config.org

+ 32 - 0
config.org

@@ -849,6 +849,15 @@ keyboard. Let's add a mapping to quickly insert various kaomojis.
 I have further questions adressed to myself regarding the mental sanity behind
 such feature.
 ** TODO Pragmata's own characters
+* TODO Narrow shortcuts
+#+begin_src emacs-lisp
+(map! :leader
+      :desc "View" "v" nil
+      :desc "Narrow to region" "vr" #'narrow-to-region
+      :desc "Narrow to defun" "vd" #'narrow-to-defun
+      :desc "Narrow to page" "vp" #'narrow-to-page
+      :desc "Widen" "vw" #'widen)
+#+end_src
 * TODO Command line extension
 #+begin_src emacs-lisp
     (defun command-line-ediff (switch)
@@ -866,6 +875,29 @@ such feature.
     (add-to-list 'command-switch-alist '("ediff" . command-line-ediff))
     (add-to-list 'command-switch-alist '("ediff-merge" . command-line-ediff-merge))
 #+end_src
+* Quick mode selection
+As both an exercise and a way to quickly get the proper mode for newly created
+buffer, I created a small quick mode selector.
+#+begin_src emacs-lisp
+(setq chicken/quick-mode-modes '(("Org" . org-mode)
+                                 ("Emacs" . emacs-lisp-mode)
+                                 ("Lua" . lua-mode)))
+
+(defun chicken/quick-mode-set()
+  (interactive)
+  (ivy-read
+   "Select a mode"
+   chicken/quick-mode-modes
+   :require-match t
+   :action (lambda (selection)
+             (with-ivy-window
+               (when selection
+                 (funcall (cdr selection)))))))
+
+(map! :leader
+      :desc "Chicken" "M" nil
+      :desc "Quick mode select" "Mm" #'chicken/quick-mode-set)
+#+end_src
 
 * Unsorted Functions
 ** Search Everything with Everything