From f2e73e2570ab12c8ec78bd39cf433db6a98f79fd Mon Sep 17 00:00:00 2001 From: Sameer Rahmani Date: Wed, 21 Apr 2021 19:42:09 +0100 Subject: [PATCH] Add buffer/window navigation cubes and font cube --- core/cubes/editor.el | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/core/cubes/editor.el b/core/cubes/editor.el index 56ee4b8..fc4f7bc 100644 --- a/core/cubes/editor.el +++ b/core/cubes/editor.el @@ -24,9 +24,35 @@ (require 'fpkg) (require 'fg42/cube) +(defflag font-icons + "Enable the support for font icones in FG42.") -(defvar fg42/editor-defaults '() - "Default features of the editor cube.") + +(defcube fg42/buffer-navigation-cube + (:docs "cubes/fg42/buffer-navigation-cube.org") + + (fpkg/use avy + :bind ("M-1" . avy-goto-word-1))) + + +(defcube fg42/window-navigation-cube + (:docs "cubes/fg42/window-navigation-cube.org") + + (fpkg/use ace-window + :bind ("C-" . ace-window))) + + +(defcube fg42/font-cube + (:docs "cubes/fg42/font-cube.org") + + (let ((font (or (plist-get fg42/font-cube-params :font-name) + "Fira Mono")) + (size (or (plist-get fg42/font-cube-params :font-size) + 12))) + ;; Sets the default font to fg42 font + (add-to-list 'default-frame-alist + (cons 'font (format "%s-%d" font size))) + (set-face-attribute 'default t :font font))) (defcube fg42/editor-cube @@ -37,11 +63,14 @@ ;; But we use it any way they might fix it :hook (prog-mode . rainbow-delimiters-mode)) + (when-flag font-icon + (fpkg/use all-the-icons)) + ;; In the following section we're setting some default behavior of FG42. ;; Most of these configuration are opiniated and I think most of people ;; shared the same opinion or don't care at all. - ;; Remove splash screen + ;; Remove splash screen (setq inhibit-splash-screen t) ;; scratch should be scratch (setq initial-scratch-message nil) @@ -51,6 +80,8 @@ (setq tab-width 2) ;; Share the clipboard with X applications (setq x-select-enable-clipboard t) + ;; Automatically removed excess backups of the file + (setq delete-old-versions t) ;; Global configurations (tool-bar-mode -1)