config-appearance.el (7147B)
1 ;;; config-appearance.el --- -*- lexical-binding: t -*- 2 ;;; Commentary: 3 ;;; Appearance configuration 4 ;;; Code: 5 6 (set-face-attribute 'fill-column-indicator nil 7 :foreground "#717C7C" ; katana-gray 8 ) 9 (global-display-fill-column-indicator-mode 1) 10 11 (setopt echo-keystrokes 0.1 12 line-number-display-limit-width 10000 13 indicate-buffer-boundaries 'left 14 indicate-empty-lines +1) 15 16 (line-number-mode 1) 17 (column-number-mode 1) 18 (global-unset-key (kbd "C-z")) 19 (global-unset-key (kbd "C-x C-z")) 20 (global-unset-key (kbd "C-h h")) 21 ;; let's enable it for all programming major modes 22 (add-hook 'prog-mode-hook #'hl-line-mode) 23 ;; and for all modes derived from text-mode 24 (add-hook 'text-mode-hook #'hl-line-mode) 25 26 (use-package frame 27 :unless noninteractive 28 :commands vde/cursor-type-mode 29 :config 30 (setq-default cursor-type 'box) 31 (setq-default cursor-in-non-selected-windows '(bar . 2)) 32 (setq-default blink-cursor-blinks 50) 33 (setq-default blink-cursor-interval nil) ; 0.75 would be my choice 34 (setq-default blink-cursor-delay 0.2) 35 36 (blink-cursor-mode -1) 37 38 (define-minor-mode vde/cursor-type-mode 39 "Toggle between static block and pulsing bar cursor." 40 :init-value nil 41 :global t 42 (if vde/cursor-type-mode 43 (progn 44 (setq-local blink-cursor-interval 0.75 45 cursor-type '(bar . 2) 46 cursor-in-non-selected-windows 'hollow) 47 (blink-cursor-mode 1)) 48 (dolist (local '(blink-cursor-interval 49 cursor-type 50 cursor-in-non-selected-windows)) 51 (kill-local-variable `,local)) 52 (blink-cursor-mode -1)))) 53 54 (use-package emacs 55 :config 56 (setq-default custom-safe-themes t) 57 (setq-default custom--inhibit-theme-enable nil) 58 59 (defun vde/before-load-theme (&rest args) 60 "Clear existing theme settings instead of layering them. 61 Ignores `ARGS'." 62 (mapc #'disable-theme custom-enabled-themes)) 63 64 (advice-add 'load-theme :before #'vde/before-load-theme)) 65 66 (use-package emacs 67 :config 68 (setq window-divider-default-right-width 1) 69 (setq window-divider-default-bottom-width 1) 70 (setq window-divider-default-places 'right-only) 71 :hook (after-init . window-divider-mode)) 72 73 (use-package tab-bar 74 :unless noninteractive 75 :config 76 (setq-default tab-bar-close-button-show nil) 77 (setq-default tab-bar-close-last-tab-choice 'tab-bar-mode-disable) 78 (setq-default tab-bar-close-tab-select 'recent) 79 (setq-default tab-bar-new-tab-choice t) 80 (setq-default tab-bar-new-tab-to 'right) 81 (setq-default tab-bar-position nil) 82 (setq-default tab-bar-show t) 83 (setq-default tab-bar-tab-hints nil) 84 (setq-default tab-bar-tab-name-function 'vde/tab-bar-tab-name) 85 86 (defun vde/tab-bar-tab-name () 87 "Generate tab name from the buffer of the selected window *or* projectile." 88 (cond 89 ((project-current) (let ((project-path (vde-project--project-current))) 90 (cond ((string-prefix-p "~/src" project-path) 91 (directory-file-name (file-relative-name project-path "~/src"))) 92 ((string-prefix-p "~/desktop" project-path) 93 (directory-file-name (file-relative-name project-path "~/desktop"))) 94 ((string-prefix-p "/etc" project-path) 95 (directory-file-name (file-relative-name project-path "/etc"))) 96 (t 97 (file-relative-name project-path))))) 98 (t (tab-bar-tab-name-current-with-count)))) 99 100 (defun vde/complete-tab-bar-tab-dwim () 101 "Do-What-I-Mean function for getting to a `tab-bar-mode' tab. 102 If no other tab exists, create one and switch to it. If there is 103 one other tab (so two in total) switch to it without further 104 questions. Else use completion to select the tab to switch to." 105 (interactive) 106 (let ((tabs (mapcar (lambda (tab) 107 (alist-get 'name tab)) 108 (tab-bar--tabs-recent)))) 109 (cond ((eq tabs nil) 110 (tab-new)) 111 ((eq (length tabs) 1) 112 (tab-next)) 113 (t 114 (tab-bar-switch-to-tab 115 (completing-read "Select tab: " tabs nil t)))))) 116 117 :bind (("C-x t t" . vde/complete-tab-bar-tab-dwim) 118 ("C-x t s" . tab-switcher) 119 ("C-<next>" . tab-next) 120 ("C-<prior>" . tab-previous))) 121 122 (use-package doom-modeline 123 :hook (after-init . doom-modeline-mode) 124 :init 125 (setq doom-modeline-icon nil) 126 (setq doom-modeline-battery t)) 127 128 (use-package time 129 :unless noninteractive 130 :config 131 (setq-default display-time-24hr-format t 132 display-time-day-and-date t 133 display-time-world-list '(("Europe/Paris" "Paris") 134 ("Europe/London" "London") 135 ("America/New_York" "Boston") 136 ("America/Los_Angeles" "San Francisco") 137 ("Asia/Calcutta" "Bangalore") 138 ("Australia/Brisbane" "Brisbane")) 139 display-time-string-forms 140 '((format "%s %s %s, %s:%s" 141 dayname 142 monthname day 143 24-hours minutes))) 144 (display-time)) 145 146 (use-package tooltip 147 :unless noninteractive 148 :config 149 (setq tooltip-delay 0.5) 150 (setq tooltip-short-delay 0.5) 151 (setq x-gtk-use-system-tooltips nil) 152 (setq tooltip-frame-parameters 153 '((name . "tooltip") 154 (internal-border-width . 6) 155 (border-width . 0) 156 (no-special-glyphs . t))) 157 :hook (after-init-hook . tooltip-mode)) 158 159 (use-package alert 160 :config 161 (setq alert-default-style 'libnotify)) 162 163 ;; (use-package ligature 164 ;; :config 165 ;; (ligature-set-ligatures 'prog-mode '("-|" "-~" "---" "-<<" "-<" "--" "->" "->>" "-->" "///" "/=" "/==" 166 ;; "/>" "//" "/*" "*>" "***" "*/" "<-" "<<-" "<=>" "<=" "<|" "<||" 167 ;; "<|||" "<|>" "<:" "<>" "<-<" "<<<" "<==" "<<=" "<=<" "<==>" "<-|" 168 ;; "<<" "<~>" "<=|" "<~~" "<~" "<$>" "<$" "<+>" "<+" "</>" "</" "<*" 169 ;; "<*>" "<->" "<!--" ":>" ":<" ":::" "::" ":?" ":?>" ":=" "::=" "=>>" 170 ;; "==>" "=/=" "=!=" "=>" "===" "=:=" "==" "!==" "!!" "!=" ">]" ">:" 171 ;; ">>-" ">>=" ">=>" ">>>" ">-" ">=" "&&&" "&&" "|||>" "||>" "|>" "|]" 172 ;; "|}" "|=>" "|->" "|=" "||-" "|-" "||=" "||" ".." ".?" ".=" ".-" "..<" 173 ;; "..." "+++" "+>" "++" "[||]" "[<" "[|" "{|" "??" "?." "?=" "?:" "##" 174 ;; "###" "####" "#[" "#{" "#=" "#!" "#:" "#_(" "#_" "#?" "#(" ";;" "_|_" 175 ;; "__" "~~" "~~>" "~>" "~-" "~@" "$>" "^=" "]#")) 176 ;; :hook 177 ;; (after-init . global-ligature-mode)) 178 179 (provide 'config-appearance) 180 ;;; config-appearance.el ends here