emacs-config/init.org.d/50-ui.org

4.2 KiB

UI Configurations

Intro

nn this file/section configures the UI settings

Toolbar and Scrollbar

removing this stuff makes emacs looks more cleaner

  (tool-bar-mode -1)
  (menu-bar-mode 1)
  (scroll-bar-mode 1)

Maximize

Start emacs as a maximized window at start

  ;; (add-hook 'window-setup-hook 'toggle-frame-maximized t)

Fringes

Fringes are the small gap at the side of emacs.

     (fringe-mode '(12 . 6))

80 Column Line with fill-column-indicator

  (add-hook 'text-mode-hook #'display-fill-column-indicator-mode)
  (add-hook 'prog-mode-hook #'display-fill-column-indicator-mode)

Cursor Shape

The most visible type of cursor shape

	(setq-default cursor-type 'box)

Tab Size

sets the tab size 5 spaces

  (defvar default-custom-tab-size 5 "set the main tab size for all configs")

  (setq-default default-tab-width default-custom-tab-size
                tab-width default-custom-tab-size
                c-basic-offset default-custom-tab-size)

Line numbers

Turn on line numbers in text mode/code modes. this part is not fully working

(add-hook 'term-mode-hook (lambda () (display-line-numbers-mode -1)))
(add-hook 'text-mode-hook 'display-line-numbers-mode)
(add-hook 'emacs-lisp-mode-hook 'display-line-numbers-mode)
(add-hook 'prog-mode-hook 'display-line-numbers-mode)

Line Highlight

Highlights the current line

  (global-hl-line-mode 1)

Matching Pairs

Highlight

highlight matching pairs of parenthesis, and other characters

  (show-paren-mode 1)

Electric-pair-mode

Automatically pair parentheses, and other characters, built in on emacs

 (electric-pair-mode 1)

Clock/Time in Modeline

currently unused

  ;; (display-time-mode)

Ligatures

  (use-package ligature
      :config
      ;; Enable the "www" ligature in every possible major mode
      (ligature-set-ligatures 't '("www"))
      ;; Enable traditional ligature support in eww-mode, if the
      ;; `variable-pitch' face supports it
      (ligature-set-ligatures 'eww-mode '("ff" "fi" "ffi"))
      ;; Enable all Cascadia Code ligatures in programming modes
      (ligature-set-ligatures 'prog-mode '("|||>" "<|||" "<==>" "<!--" "####" "~~>" "***" "||=" "||>"
                                           ":::" "::=" "=:=" "===" "==>" "=!=" "=>>" "=<<" "=/=" "!=="
                                           "!!." ">=>" ">>=" ">>>" ">>-" ">->" "->>" "-->" "---" "-<<"
                                           "<~~" "<~>" "<*>" "<||" "<|>" "<$>" "<==" "<=>" "<=<" "<->"
                                           "<--" "<-<" "<<=" "<<-" "<<<" "<+>" "</>" "###" "#_(" "..<"
                                           "..." "+++" "/==" "///" "_|_" "www" "&&" "^=" "~~" "~@" "~="
                                           "~>" "~-" "**" "*>" "*/" "||" "|}" "|]" "|=" "|>" "|-" "{|"
                                           "[|" "]#" "::" ":=" ":>" ":<" "$>" "==" "=>" "!=" "!!" ">:"
                                           ">=" ">>" ">-" "-~" "-|" "->" "--" "-<" "<~" "<*" "<|" "<:"
                                           "<$" "<=" "<>" "<-" "<<" "<+" "</" "#{" "#[" "#:" "#=" "#!"
                                           "##" "#(" "#?" "#_" "%%" ".=" ".-" ".." ".?" "+>" "++" "?:"
                                           "?=" "?." "??" ";;" "/*" "/=" "/>" "//" "__" "~~" "(*" "*)"
                                           "\\\\" "://"))
      ;; Enables ligature checks globally in all buffers. You can also do it
      ;; per mode with `ligature-mode'.
      (global-ligature-mode t))

Theme

Load theme (that is built-in)

  (load-theme 'modus-operandi t)

Welcome Screen

Having a blank screen at the start is much more simpler and better

  (setq inhibit-startup-screen t)