164 lines
4.9 KiB
Org Mode
164 lines
4.9 KiB
Org Mode
#+TITLE: UI Configurations
|
|
|
|
* Intro
|
|
this file/section configures the UI settings
|
|
|
|
* Toolbar and Scrollbar
|
|
removing this stuff makes emacs looks more cleaner
|
|
#+begin_src emacs-lisp
|
|
(tool-bar-mode -1)
|
|
(menu-bar-mode 1)
|
|
(scroll-bar-mode -1)
|
|
#+end_src
|
|
|
|
* Maximize
|
|
Start emacs as a maximized window at start
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
;; (add-hook 'window-setup-hook 'toggle-frame-maximized t)
|
|
|
|
#+END_SRC
|
|
|
|
* Window Size
|
|
Set the default window size when making a new frame
|
|
#+begin_src emacs-lisp
|
|
(defun set-window-size ()
|
|
(add-to-list 'default-frame-alist '(width . 80))
|
|
(add-to-list 'default-frame-alist '(height . 40))
|
|
(add-to-list 'initial-frame-alist '(width . 80))
|
|
(add-to-list 'initial-frame-alist '(height . 40)))
|
|
#+end_src
|
|
|
|
run the function at startup of a frame
|
|
#+begin_src emacs-lisp
|
|
(when (display-graphic-p)
|
|
(set-window-size))
|
|
(add-hook 'before-make-frame-hook 'set-window-size)
|
|
#+end_src
|
|
|
|
* Fringes
|
|
Fringes are the small gap at the side of emacs.
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
(fringe-mode '(12 . 6))
|
|
#+END_SRC
|
|
|
|
* 80 Column Line with fill-column-indicator
|
|
#+begin_src emacs-lisp
|
|
(when (> emacs-major-version 27)
|
|
(add-hook 'text-mode-hook #'display-fill-column-indicator-mode)
|
|
(add-hook 'prog-mode-hook #'display-fill-column-indicator-mode))
|
|
#+end_src
|
|
|
|
* Cursor Shape
|
|
The most visible type of cursor shape
|
|
|
|
#+begin_src emacs-lisp
|
|
(setq-default cursor-type 'box)
|
|
#+end_src
|
|
|
|
* Tab Size
|
|
sets the tab size 5 spaces
|
|
|
|
#+begin_src emacs-lisp
|
|
(let ((custom-tab-size 5))
|
|
(setq-default default-tab-width custom-tab-size
|
|
tab-width custom-tab-size
|
|
c-basic-offset custom-tab-size))
|
|
#+end_src
|
|
|
|
* Line numbers
|
|
Turn on line numbers in text mode/code modes. ~this part is not fully working~
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(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)
|
|
|
|
#+END_SRC
|
|
|
|
* Line Highlight
|
|
Highlights the current line
|
|
|
|
#+begin_src emacs-lisp
|
|
|
|
(global-hl-line-mode 1)
|
|
|
|
#+end_src
|
|
|
|
* Matching Pairs
|
|
|
|
** Highlight
|
|
highlight matching pairs of parenthesis, and other characters
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(show-paren-mode 1)
|
|
|
|
#+END_SRC
|
|
|
|
** Electric-pair-mode
|
|
Automatically pair parentheses, and other characters, built in on emacs
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(electric-pair-mode 1)
|
|
|
|
#+END_SRC
|
|
|
|
* Clock/Time in Modeline
|
|
currently unused
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
;; (display-time-mode)
|
|
#+END_SRC
|
|
|
|
* Ligatures
|
|
#+begin_src emacs-lisp
|
|
;; (when (> emacs-major-version 28)
|
|
;; (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 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)))
|
|
#+end_src
|
|
|
|
* Theme
|
|
Load theme (that is built-in)
|
|
#+begin_src emacs-lisp
|
|
(load-theme 'modus-operandi t)
|
|
;; (use-package solarized-theme
|
|
;; :config
|
|
;; (load-theme 'solarized-selenized-black))
|
|
|
|
#+end_src
|
|
|
|
* Welcome Screen
|
|
Having a blank screen at the start is much more simpler and better
|
|
#+begin_src emacs-lisp
|
|
(setq inhibit-startup-screen t)
|
|
#+end_src
|
|
|