ill make my modeline later

This commit is contained in:
Sakooooo 2024-01-12 15:07:18 +04:00
parent b44ae8a64e
commit a7ae2ce062
Signed by: sako
GPG key ID: FE52FD65B76E4751

View file

@ -191,108 +191,109 @@ Cause emacs overlay lol
#+end_src #+end_src
* Custom Modeline * Custom Modeline
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq mode-line-format nil) ;; ill continue making this later
;; (setq mode-line-format nil)
(kill-local-variable 'mode-line-format) ;; (kill-local-variable 'mode-line-format)
(force-mode-line-update) ;; (force-mode-line-update)
(setq-default mode-line-format ;; (setq-default mode-line-format
'((:eval (sakoline-render ;; '((:eval (sakoline-render
;; left ;; ;; left
(quote ("%e" ;; (quote ("%e"
sakoline-evil-mode ;; sakoline-evil-mode
" " ;; " "
sakoline-buffer-name ;; sakoline-buffer-name
" " ;; " "
sakoline-buffer-state)) ;; sakoline-buffer-state))
;; right ;; ;; right
(quote (sakoline-major-mode ;; (quote (sakoline-major-mode
) ;; )
))))) ;; )))))
(defun sakoline-render (left right) ;; (defun sakoline-render (left right)
"Return a string of `window-width' length. ;; "Return a string of `window-width' length.
Containing LEFT, and RIGHT aligned respectively." ;; Containing LEFT, and RIGHT aligned respectively."
(let ((available-width ;; (let ((available-width
(- (window-total-width) ;; (- (window-total-width)
(+ (length (format-mode-line left)) ;; (+ (length (format-mode-line left))
(length (format-mode-line right)))))) ;; (length (format-mode-line right))))))
(append left ;; (append left
(list (format (format "%%%ds" available-width) "")) ;; (list (format (format "%%%ds" available-width) ""))
right))) ;; right)))
(defvar-local sakoline-buffer-name ;; (defvar-local sakoline-buffer-name
'(:eval ;; '(:eval
(propertize (buffer-name) 'face '(:foreground "#ffffff"))) ;; (propertize (buffer-name) 'face '(:foreground "#ffffff")))
"Mode line variable that shows the buffer name.") ;; "Mode line variable that shows the buffer name.")
(put 'sakoline-buffer-name 'risky-local-variable t) ;; (put 'sakoline-buffer-name 'risky-local-variable t)
(defface sakoline-major-mode-color ;; (defface sakoline-major-mode-color
'((t :foreground "grey")) ;; '((t :foreground "grey"))
"Major Mode color for sakoline.") ;; "Major Mode color for sakoline.")
(defun sakoline--major-mode-name () ;; (defun sakoline--major-mode-name ()
"Return Capitalized Major Mode" ;; "Return Capitalized Major Mode"
(capitalize (symbol-name major-mode))) ;; (capitalize (symbol-name major-mode)))
(defvar-local sakoline-major-mode ;; (defvar-local sakoline-major-mode
'(:eval ;; '(:eval
(propertize (sakoline--major-mode-name) 'face 'sakoline-major-mode-color))) ;; (propertize (sakoline--major-mode-name) 'face 'sakoline-major-mode-color)))
(put 'sakoline-major-mode 'risky-local-variable t) ;; (put 'sakoline-major-mode 'risky-local-variable t)
(defface sakoline-evil-visual-color ;; (defface sakoline-evil-visual-color
'((t :background "#6600cc" :foreground "black")) ;; '((t :background "#6600cc" :foreground "black"))
"Evil Visual Color") ;; "Evil Visual Color")
(defface sakoline-evil-normal-color ;; (defface sakoline-evil-normal-color
'((t :background "#99ff99" :foreground "black")) ;; '((t :background "#99ff99" :foreground "black"))
"Evil Visual Color") ;; "Evil Visual Color")
(defface sakoline-evil-insert-color ;; (defface sakoline-evil-insert-color
'((t :background "#00cc66" :foreground "black")) ;; '((t :background "#00cc66" :foreground "black"))
"Evil Visual Color") ;; "Evil Visual Color")
(defface sakoline-evil-emacs-color ;; (defface sakoline-evil-emacs-color
'((t :background "#9900ff" :foreground "black")) ;; '((t :background "#9900ff" :foreground "black"))
"Evil Visual Color") ;; "Evil Visual Color")
(defface sakoline-evil-operator-color ;; (defface sakoline-evil-operator-color
'((t :background "#ff3300" :foreground "black")) ;; '((t :background "#ff3300" :foreground "black"))
"Evil Visual Color") ;; "Evil Visual Color")
(defvar-local sakoline-evil-mode ;; (defvar-local sakoline-evil-mode
'(:eval (cond ;; '(:eval (cond
((eq evil-state 'visual) (propertize " VISUAL " 'face 'sakoline-evil-visual-color )) ;; ((eq evil-state 'visual) (propertize " VISUAL " 'face 'sakoline-evil-visual-color ))
((eq evil-state 'normal) (propertize " NORMAL " 'face 'sakoline-evil-normal-color )) ;; ((eq evil-state 'normal) (propertize " NORMAL " 'face 'sakoline-evil-normal-color ))
((eq evil-state 'insert) (propertize " INSERT " 'face 'sakoline-evil-insert-color )) ;; ((eq evil-state 'insert) (propertize " INSERT " 'face 'sakoline-evil-insert-color ))
((eq evil-state 'emacs) (propertize " EMACS " 'face 'sakoline-evil-emacs-color )) ;; ((eq evil-state 'emacs) (propertize " EMACS " 'face 'sakoline-evil-emacs-color ))
((eq evil-state 'operator) (propertize " OPERATOR " 'face 'sakoline-evil-operator-color)) ;; ((eq evil-state 'operator) (propertize " OPERATOR " 'face 'sakoline-evil-operator-color))
"Get current evil mode state"))) ;; "Get current evil mode state")))
(put 'sakoline-evil-mode 'risky-local-variable t) ;; (put 'sakoline-evil-mode 'risky-local-variable t)
(defface sakoline-buffer-state-readonly ;; (defface sakoline-buffer-state-readonly
'((t :foreground "red")) ;; '((t :foreground "red"))
"Face for read-only buffer") ;; "Face for read-only buffer")
(defface sakoline-buffer-state-modified ;; (defface sakoline-buffer-state-modified
'((t :foreground "orange")) ;; '((t :foreground "orange"))
"Face for modified buffer") ;; "Face for modified buffer")
(defvar-local sakoline-buffer-state ;; (defvar-local sakoline-buffer-state
'(:eval ;; '(:eval
(cond ;; (cond
(buffer-read-only ;; (buffer-read-only
(propertize ">:(" ;; (propertize ">:("
'face 'sakoline-buffer-state-readonly ;; 'face 'sakoline-buffer-state-readonly
'help-echo "buffer is read only")) ;; 'help-echo "buffer is read only"))
((buffer-modified-p) ;; ((buffer-modified-p)
(propertize "!!!" ;; (propertize "!!!"
'face 'sakoline-buffer-state-modified))))) ;; 'face 'sakoline-buffer-state-modified)))))
(put 'sakoline-buffer-state 'risky-local-variable t) ;; (put 'sakoline-buffer-state 'risky-local-variable t)
#+end_src #+end_src
* Packages * Packages
@ -356,28 +357,22 @@ Cause emacs overlay lol
#+end_src #+end_src
** Custom Themes ** Custom Themes
#+begin_src emacs-lisp #+begin_src emacs-lisp
;; (use-package doom-themes (use-package doom-themes
;; :ensure t :ensure t
;; :config :config
;; ;; Global settings (defaults) ;; Global settings (defaults)
;; (setq doom-themes-enable-bold t ; if nil, bold is universally disabled (setq doom-themes-enable-bold t ; if nil, bold is universally disabled
;; doom-themes-enable-italic t) ; if nil, italics is universally disabled doom-themes-enable-italic t) ; if nil, italics is universally disabled
;; ;; load the theme ;; load the theme
;; (load-theme 'doom-monokai-pro t) (load-theme 'doom-monokai-pro t)
;; (doom-themes-org-config) (doom-themes-org-config)
;; (doom-themes-treemacs-config) (doom-themes-treemacs-config)
;; ;; Enable flashing mode-line on errors ;; Enable flashing mode-line on errors
;; (doom-themes-visual-bell-config)) (doom-themes-visual-bell-config))
;; (use-package timu-macos-theme
;; :config
;; (load-theme 'timu-macos t))
(use-package badger-theme
:config (load-theme 'badger t))
#+end_src #+end_src
** All the Icons (to make doom-themes happy) ** All the Icons (to make doom-themes happy)
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -407,10 +402,10 @@ Cause emacs overlay lol
#+end_src #+end_src
** Custom Modeline ** Custom Modeline
#+begin_src emacs-lisp #+begin_src emacs-lisp
;; (use-package doom-modeline (use-package doom-modeline
;; :ensure t :ensure t
;; :hook (after-init . doom-modeline-mode) :hook (after-init . doom-modeline-mode)
;; :custom ((doom-modeline-height 40))) :custom ((doom-modeline-height 40)))
#+end_src #+end_src
** Hide Modeline ** Hide Modeline
#+begin_src emacs-lisp #+begin_src emacs-lisp