2019-01-24 10:21:19 +01:00
|
|
|
|
;;; oni-gui.el --- GUI settings for Emacs -*- lexical-binding: t; -*-
|
|
|
|
|
|
|
|
|
|
;; Copyright (C) 2019 Tom Willemse
|
|
|
|
|
|
|
|
|
|
;; Author: Tom Willemse <tom@ryuslash.org>
|
|
|
|
|
;; Keywords: local
|
2023-08-06 08:38:18 +02:00
|
|
|
|
;; Version: 2023.0805.233624
|
2021-07-27 23:48:22 +02:00
|
|
|
|
;; Package-Requires: (oni-ui oni-hydra yoshi-theme diminish)
|
2019-01-24 10:21:19 +01:00
|
|
|
|
|
|
|
|
|
;; This program is free software; you can redistribute it and/or modify
|
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
;; (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
;; This program is distributed in the hope that it will be useful,
|
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
|
|
|
|
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
|
|
|
|
;; These are my GUI settings.
|
|
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
|
2020-09-09 17:51:26 +02:00
|
|
|
|
(require 'hydra)
|
2021-11-23 09:38:09 +01:00
|
|
|
|
(require 'oni-ui)
|
2020-09-09 17:51:26 +02:00
|
|
|
|
|
2019-01-24 10:21:19 +01:00
|
|
|
|
(add-to-list 'default-frame-alist '(font . "Fantasque Sans Mono-15"))
|
|
|
|
|
(add-to-list 'default-frame-alist '(internal-border-width . 15))
|
|
|
|
|
|
2021-12-02 02:45:05 +01:00
|
|
|
|
(defconst oni-gui-isearch-icon #xf002)
|
|
|
|
|
(defconst oni-gui-arev-icon #xf1b8)
|
2020-04-09 08:48:56 +02:00
|
|
|
|
|
2021-09-11 11:55:05 +02:00
|
|
|
|
(defun oni-gui-setup-faces (frame)
|
|
|
|
|
"Setup faces for FRAME."
|
|
|
|
|
(set-face-attribute 'fixed-pitch frame :font "Fantasque Sans Mono-15")
|
|
|
|
|
(set-face-attribute 'variable-pitch frame :font "Comic Neue-15"))
|
|
|
|
|
|
2020-04-09 22:13:59 +02:00
|
|
|
|
(defun oni-gui-setup-fontsets (frame)
|
|
|
|
|
"Setup fontsets for FRAME.
|
|
|
|
|
If FRAME is nil, they’re set for the current frame."
|
|
|
|
|
(let ((font-awesome "Font Awesome 5 Free Solid-12"))
|
|
|
|
|
(set-fontset-font t oni-gui-isearch-icon font-awesome frame)
|
2021-12-02 02:45:05 +01:00
|
|
|
|
(set-fontset-font t #xf026 font-awesome frame)
|
|
|
|
|
(set-fontset-font t #xf027 font-awesome frame)
|
|
|
|
|
(set-fontset-font t #xf028 font-awesome frame)
|
|
|
|
|
(set-fontset-font t #xf240 font-awesome frame)
|
|
|
|
|
(set-fontset-font t #xf241 font-awesome frame)
|
|
|
|
|
(set-fontset-font t #xf242 font-awesome frame)
|
|
|
|
|
(set-fontset-font t #xf243 font-awesome frame)
|
|
|
|
|
(set-fontset-font t #xf244 font-awesome frame)
|
|
|
|
|
(set-fontset-font t #xf2c9 font-awesome frame)
|
|
|
|
|
(set-fontset-font t #xf6a9 font-awesome frame)
|
|
|
|
|
(set-fontset-font t #xf769 font-awesome frame)
|
|
|
|
|
(set-fontset-font t #xf76b font-awesome frame)
|
2020-04-09 22:17:05 +02:00
|
|
|
|
(set-fontset-font t oni-gui-arev-icon font-awesome frame))
|
2020-04-13 09:40:22 +02:00
|
|
|
|
(let ((font-awesome "Font Awesome 5 Free Regular-12"))
|
2021-12-02 02:45:05 +01:00
|
|
|
|
(set-fontset-font t #xf0c8 font-awesome frame)
|
|
|
|
|
(set-fontset-font t #xf14a font-awesome frame))
|
2020-04-11 04:12:39 +02:00
|
|
|
|
(let ((dejavu-sans-mono "DejaVu Sans Mono-12"))
|
2021-12-02 02:45:05 +01:00
|
|
|
|
(set-fontset-font t #x25c9 dejavu-sans-mono frame)
|
|
|
|
|
(set-fontset-font t #x25cb dejavu-sans-mono frame)
|
|
|
|
|
(set-fontset-font t #x2738 dejavu-sans-mono frame)
|
|
|
|
|
(set-fontset-font t #x273f dejavu-sans-mono frame)
|
|
|
|
|
(set-fontset-font t #x2713 dejavu-sans-mono frame)))
|
2020-04-09 22:13:59 +02:00
|
|
|
|
|
2021-03-17 07:31:03 +01:00
|
|
|
|
;; Thanks to the article at
|
|
|
|
|
;; https://andreyorst.gitlab.io/posts/2020-07-21-programming-ligatures-in-emacs/
|
|
|
|
|
(defun oni-gui-setup-ligatures (&optional _)
|
|
|
|
|
"Define ligatures supported by Fantasque Sans Mono."
|
|
|
|
|
(let ((ligatures
|
|
|
|
|
`((?= . ,(regexp-opt '("==" "===" "=/=" "=>" "==>" "=>>" "=<<")))
|
|
|
|
|
(?! . ,(regexp-opt '("!=" "!==")))
|
|
|
|
|
(?< . ,(regexp-opt '("<-<" "<<-" "<--" "<-" "<->" "<=<" "<<=" "<=="
|
|
|
|
|
"<=>" "<~>" "<~~" "<~" "<<<" "<<" "<=" "<>"
|
|
|
|
|
"<|||" "<||" "<|" "<|>" "<!--")))
|
|
|
|
|
(?- . ,(regexp-opt '("->" "-->" "->>" "-<" "-<<")))
|
|
|
|
|
(?> . ,(regexp-opt '(">->" ">=>" ">>=" ">>-" ">-" ">=" ">>" ">>>")))
|
|
|
|
|
(?~ . ,(regexp-opt '("~~" "~>" "~~>")))
|
2021-03-18 05:21:31 +01:00
|
|
|
|
(?| . ,(regexp-opt '("|>" "||>" "|||>" "||")))
|
|
|
|
|
(?: . ,(regexp-opt '("::")))
|
|
|
|
|
(?& . ,(regexp-opt '("&&")))
|
|
|
|
|
(?/ . ,(regexp-opt '("//" "/*")))
|
|
|
|
|
(?* . ,(regexp-opt '("*/" "**/"))))))
|
2021-03-17 07:31:03 +01:00
|
|
|
|
(dolist (char-regexp ligatures)
|
|
|
|
|
(set-char-table-range composition-function-table (car char-regexp)
|
|
|
|
|
`([,(cdr char-regexp) 0 font-shape-gstring])))))
|
|
|
|
|
|
2020-04-09 22:13:59 +02:00
|
|
|
|
(with-eval-after-load 'isearch
|
|
|
|
|
(diminish 'isearch-mode (string ?\s oni-gui-isearch-icon)))
|
2020-04-09 22:17:05 +02:00
|
|
|
|
(with-eval-after-load 'autorevert
|
|
|
|
|
(diminish 'auto-revert-mode (string ?\s oni-gui-arev-icon)))
|
2019-04-24 09:59:12 +02:00
|
|
|
|
|
2020-03-07 08:19:24 +01:00
|
|
|
|
(defhydra oni-gui-hydra (:color teal :hint nil)
|
|
|
|
|
"
|
2020-03-09 01:15:56 +01:00
|
|
|
|
^Buffer^ ^Packages^ ^Sort^
|
|
|
|
|
^^^^^^-----------------------------------
|
|
|
|
|
_br_: Revert _pl_: List _sl_: Sort
|
|
|
|
|
_bi_: Auto Insert ^^ ^^
|
2020-03-07 08:19:24 +01:00
|
|
|
|
"
|
2020-03-08 23:18:12 +01:00
|
|
|
|
("br" (revert-buffer nil t))
|
|
|
|
|
("bi" auto-insert)
|
2020-03-09 01:15:56 +01:00
|
|
|
|
("pl" list-packages)
|
|
|
|
|
("sl" sort-lines))
|
2020-03-07 08:19:24 +01:00
|
|
|
|
|
2019-01-24 10:21:19 +01:00
|
|
|
|
(setq-default cursor-type '(bar . 2))
|
|
|
|
|
(setq-default cursor-in-non-selected-windows 'box)
|
2020-04-11 03:12:55 +02:00
|
|
|
|
(setq frame-resize-pixelwise t)
|
2019-01-24 10:21:19 +01:00
|
|
|
|
|
2019-02-26 04:10:31 +01:00
|
|
|
|
(scroll-bar-mode -1)
|
|
|
|
|
|
2021-12-02 03:19:06 +01:00
|
|
|
|
(unless (eq system-type 'windows-nt)
|
|
|
|
|
(if (daemonp)
|
|
|
|
|
(progn
|
|
|
|
|
(add-hook 'after-make-frame-functions #'oni-gui-setup-ligatures)
|
2021-12-02 02:46:16 +01:00
|
|
|
|
(add-hook 'after-make-frame-functions #'oni-gui-setup-fontsets)
|
2021-12-02 03:19:06 +01:00
|
|
|
|
(add-hook 'after-make-frame-functions #'oni-gui-setup-faces))
|
2021-12-02 02:46:16 +01:00
|
|
|
|
(oni-gui-setup-fontsets nil)
|
2021-12-02 03:19:06 +01:00
|
|
|
|
(oni-gui-setup-faces nil)
|
|
|
|
|
(oni-gui-setup-ligatures)))
|
2020-04-09 22:13:59 +02:00
|
|
|
|
|
2019-03-05 08:52:24 +01:00
|
|
|
|
(global-unset-key (kbd "C-z"))
|
2022-12-13 16:11:36 +01:00
|
|
|
|
(global-set-key (kbd "C-c c") '("Frequently used commands" . oni-gui-hydra/body))
|
2019-03-05 08:52:24 +01:00
|
|
|
|
|
2019-10-17 08:27:53 +02:00
|
|
|
|
(load-theme 'yoshi :no-confirm)
|
2019-01-24 10:21:19 +01:00
|
|
|
|
|
2023-08-06 08:38:18 +02:00
|
|
|
|
(when (fboundp 'pixel-scroll-precision-mode)
|
|
|
|
|
(pixel-scroll-precision-mode))
|
|
|
|
|
|
2019-01-24 10:21:19 +01:00
|
|
|
|
(provide 'oni-gui)
|
|
|
|
|
;;; oni-gui.el ends here
|