Guest User

config

a guest
Oct 21st, 2023
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.26 KB | Source Code | 0 0
  1. * Display and look
  2. ** Line number
  3. #+begin_src emacs-lisp
  4. (add-hook 'prog-mode-hook 'display-line-numbers-mode)
  5. (setq display-line-numbers-type 'relative)
  6. #+end_src
  7.  
  8. #+RESULTS:
  9. : relative
  10.  
  11. ** Theme
  12. #+begin_src emacs-lisp
  13. (use-package dracula-theme)
  14. #+end_src
  15.  
  16. #+begin_src emacs-lisp
  17. (use-package doom-themes
  18. :ensure t
  19. :config
  20. ;; Global settings (defaults)
  21. (setq doom-themes-enable-bold t ; if nil, bold is universally disabled
  22. doom-themes-enable-italic t) ; if nil, italics is universally disabled
  23. (load-theme 'doom-tokyo-night t))
  24. #+end_src
  25.  
  26. #+RESULTS:
  27. : t
  28.  
  29. #+begin_src emacs-lisp
  30. (use-package atom-one-dark-theme)
  31. #+end_src
  32.  
  33. #+RESULTS:
  34.  
  35. ** Font
  36.  
  37. #+begin_src emacs-lisp
  38. (set-frame-font "JetBrains Mono 10" nil t)
  39. (add-to-list 'default-frame-alist '(font . "JetBrains Mono 10"))
  40. #+end_src
  41.  
  42. #+RESULTS:
  43.  
  44. ** Lignature
  45.  
  46. Show programming lignature
  47.  
  48. #+begin_src emacs-lisp
  49. (dolist (char/ligature-re
  50. `((?- . ,(rx (or (or "-->" "-<<" "->>" "-|" "-~" "-<" "->") (+ "-"))))
  51. (?/ . ,(rx (or (or "/==" "/=" "/>" "/**" "/*") (+ "/"))))
  52. (?* . ,(rx (or (or "*>" "*/") (+ "*"))))
  53. (?< . ,(rx (or (or "<<=" "<<-" "<|||" "<==>" "<!--" "<=>" "<||" "<|>" "<-<"
  54. "<==" "<=<" "<-|" "<~>" "<=|" "<~~" "<$>" "<+>" "</>"
  55. "<*>" "<->" "<=" "<|" "<:" "<>" "<$" "<-" "<~" "<+"
  56. "</" "<*")
  57. (+ "<"))))
  58. (?: . ,(rx (or (or ":?>" "::=" ":>" ":<" ":?" ":=") (+ ":"))))
  59. (?= . ,(rx (or (or "=>>" "==>" "=/=" "=!=" "=>" "=:=") (+ "="))))
  60. (?! . ,(rx (or (or "!==" "!=") (+ "!"))))
  61. (?> . ,(rx (or (or ">>-" ">>=" ">=>" ">]" ">:" ">-" ">=") (+ ">"))))
  62. (?& . ,(rx (+ "&")))
  63. (?| . ,(rx (or (or "|->" "|||>" "||>" "|=>" "||-" "||=" "|-" "|>"
  64. "|]" "|}" "|=")
  65. (+ "|"))))
  66. (?. . ,(rx (or (or ".?" ".=" ".-" "..<") (+ "."))))
  67. (?+ . ,(rx (or "+>" (+ "+"))))
  68. (?\[ . ,(rx (or "[<" "[|")))
  69. (?\{ . ,(rx "{|"))
  70. (?\? . ,(rx (or (or "?." "?=" "?:") (+ "?"))))
  71. (?# . ,(rx (or (or "#_(" "#[" "#{" "#=" "#!" "#:" "#_" "#?" "#(")
  72. (+ "#"))))
  73. (?\; . ,(rx (+ ";")))
  74. (?_ . ,(rx (or "_|_" "__")))
  75. (?~ . ,(rx (or "~~>" "~~" "~>" "~-" "~@")))
  76. (?$ . ,(rx "$>"))
  77. (?^ . ,(rx "^="))
  78. (?\] . ,(rx "]#"))))
  79. (let ((char (car char/ligature-re))
  80. (ligature-re (cdr char/ligature-re)))
  81. (set-char-table-range composition-function-table char
  82. `([,ligature-re 0 font-shape-gstring]))))
  83. #+end_src
  84.  
  85. #+RESULTS:
  86.  
  87. ** Reduce clutter
  88.  
  89. Remove the toolbar. It's ugly and I never use it. Also remove the
  90. scroll bars; below, I set up the fringe to show my position in a
  91. buffer.
  92.  
  93. #+name: look-and-feel
  94. #+BEGIN_SRC emacs-lisp
  95. (when (window-system)
  96. (add-to-list 'image-types 'svg)
  97. (tool-bar-mode -1)
  98. (menu-bar-mode -1)
  99. (load-theme 'atom-one-dark t)
  100. (scroll-bar-mode 1))
  101. #+END_SRC
  102.  
  103. When running emacs in a terminal, remove the menu bar.
  104.  
  105. #+NAME: look-and-feel
  106. #+BEGIN_SRC emacs-lisp
  107. (when (not (window-system))
  108. (tool-bar-mode -1)
  109. (menu-bar-mode -1))
  110. #+END_SRC
  111.  
  112. #+begin_src emacs-lisp
  113. (if (daemonp)
  114. (load-theme 'atom-one-dark t))
  115. #+end_src
  116.  
  117. #+RESULTS:
  118. : t
  119.  
Add Comment
Please, Sign In to add comment