I showed you my source code, pls respond
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

211 lines
5.6 KiB

4 years ago
4 years ago
4 years ago
  1. ;; Ivy
  2. ;; Download and configure [[https://oremacs.com/swiper/][ivy]], a powerful selection menu for Emacs.
  3. (use-package ivy
  4. :diminish
  5. :config (ivy-mode 1))
  6. ;; Counsel is a customized set of commands to replace built in completion buffers.
  7. (use-package counsel
  8. :after ivy
  9. :custom (counsel-linux-app-format-function #'counsel-linux-app-format-function-name-only)
  10. :config (counsel-mode 1))
  11. ;; Switch buffers with =SPC , (comma)=.
  12. (dotfiles/leader
  13. "," '(counsel-switch-buffer :which-key "Buffers"))
  14. ;; Provide more information about each item with [[https://github.com/Yevgnen/ivy-rich][ivy-rich]].
  15. (use-package ivy-rich
  16. :after counsel
  17. :init (ivy-rich-mode 1))
  18. ;; Fonts
  19. ;; Write out to all *3* of Emacs' default font faces.
  20. (set-face-attribute 'default nil :font dotfiles/font :height dotfiles/font-size)
  21. (set-face-attribute 'fixed-pitch nil :font dotfiles/font :height dotfiles/font-size)
  22. (set-face-attribute 'variable-pitch nil :font dotfiles/font :height dotfiles/font-size)
  23. ;; Define a transient keybinding for scaling the text.
  24. (defhydra hydra-text-scale (:timeout 4)
  25. "Scale"
  26. ("j" text-scale-increase "Increase")
  27. ("k" text-scale-decrease "Decrease")
  28. ("f" nil "Finished" :exit t))
  29. ;; Increase the font size in buffers with =SPC t f=.
  30. ;; + Increase =j=
  31. ;; + Decrease =k=
  32. ;; + Finish =f=
  33. (dotfiles/leader
  34. "tf" '(hydra-text-scale/body :which-key "Font"))
  35. ;; Lines
  36. ;; Relative line numbers are important when using =VI= emulation keys. You can prefix most commands with a *number*, allowing you to jump up / down by a line count.
  37. ;; #+begin_example
  38. ;; 5:
  39. ;; 4:
  40. ;; 3:
  41. ;; 2:
  42. ;; 1:
  43. ;; 156: << CURRENT LINE >>
  44. ;; 1:
  45. ;; 2:
  46. ;; 3:
  47. ;; 4:
  48. ;; 5:
  49. ;; #+end_example
  50. ;; https://github.com/emacsmirror/linum-relative
  51. ;; + Integrate with ~display-line-numbers-mode~ for performance
  52. (use-package linum-relative
  53. :commands (linum-relative-global-mode)
  54. :custom (linum-relative-backend 'display-line-numbers-mode))
  55. ;; Add line numbers to the toggles behind =SPC t l=.
  56. (dotfiles/leader
  57. "tl" '(linum-relative-global-mode :which-key "Lines"))
  58. ;; https://github.com/Fanael/rainbow-delimiters
  59. ;; + Colourize nested parenthesis
  60. (use-package rainbow-delimiters
  61. :hook (prog-mode . rainbow-delimiters-mode))
  62. ;; Themes
  63. ;; #+ATTR_ORG: :width 420px
  64. ;; #+ATTR_HTML: :width 420px
  65. ;; #+ATTR_LATEX: :width 420px
  66. ;; [[./docs/images/what-is-emacs-customizable.gif]]
  67. ;; Cherry pick a few modules from =doom-emacs=. High quality and modern colour themes are provided in the [[https://github.com/hlissner/emacs-doom-themes][doom-themes]] package.
  68. (use-package doom-themes
  69. :init (load-theme 'doom-moonlight t))
  70. ;; [[https://github.com/seagle0128/doom-modeline][doom-modeline]] provides an elegant status bar / modeline.
  71. (use-package doom-modeline
  72. :custom (doom-modeline-height 16)
  73. :config (doom-modeline-mode 1))
  74. ;; Load a theme with =SPC t t=.
  75. (dotfiles/leader
  76. "tt" '(counsel-load-theme t t :which-key "Theme"))
  77. ;; Pretty
  78. ;; Make programming buffers prettier with [[https://github.com/pretty-mode/pretty-mode][pretty-mode]], complimentary to the built in ~prettify-symbols-mode~.
  79. (use-package pretty-mode
  80. :hook (python-mode . turn-on-pretty-mode))
  81. ;; Ligatures
  82. ;; Enable font ligatures via [[https://github.com/jming422/fira-code-mode][fira-code-mode]], perform this action *only* when ~Fira Code~ is the current font.
  83. (when (display-graphic-p)
  84. (use-package fira-code-mode
  85. :hook (prog-mode org-mode)))
  86. ;; Toggle global ligature mode with =SPC t g=.
  87. (dotfiles/leader
  88. "tg" '(global-fira-code-mode :which-key "Ligatures"))
  89. ;; Dashboard
  90. ;; #+ATTR_ORG: :width 420px
  91. ;; #+ATTR_HTML: :width 420px
  92. ;; #+ATTR_LATEX: :width 420px
  93. ;; [[./docs/images/desktop.png]]
  94. ;; Present a dashboard when first launching Emacs. Customize the buttons of the navigator:
  95. ;; + Brain @ http://localhost:8080
  96. ;; + Homepage @ https://chrishayward.xyz
  97. ;; + Athabasca @ https://login.athabascau.ca/cas/login
  98. ;; + Bookshelf @ https://online.vitalsource.com
  99. (use-package dashboard
  100. :custom (dashboard-center-content t)
  101. (dashboard-set-init-info t)
  102. (dashboard-set-file-icons t)
  103. (dashboard-set-heading-icons t)
  104. (dashboard-set-navigator t)
  105. (dashboard-startup-banner 'logo)
  106. (dashboard-projects-backend 'projectile)
  107. (dashboard-items '((projects . 5) (recents . 5) (agenda . 10)))
  108. (dashboard-navigator-buttons `(((,(all-the-icons-fileicon "brain" :height 1.1 :v-adjust 0.0)
  109. "Brain" "Knowledge base"
  110. (lambda (&rest _) (browse-url "http://localhost:8080"))))
  111. ((,(all-the-icons-material "public" :height 1.1 :v-adjust 0.0)
  112. "Homepage" "Personal website"
  113. (lambda (&rest _) (browse-url "https://chrishayward.xyz"))))
  114. ((,(all-the-icons-faicon "university" :height 1.1 :v-adjust 0.0)
  115. "Athabasca" "Univeristy login"
  116. (lambda (&rest _) (browse-url "https://login.athabascau.ca/cas/login"))))
  117. ((,(all-the-icons-faicon "book" :height 1.1 :v-adjust 0.0)
  118. "Bookshelf" "Vitalsource bookshelf"
  119. (lambda (&rest _) (browse-url "https://online.vitalsource.com"))))))
  120. :config (dashboard-setup-startup-hook))
  121. ;; When running in *daemon* mode, ensure that the dashboard is the initial buffer.
  122. (setq initial-buffer-choice
  123. (lambda ()
  124. (get-buffer "*dashboard*")))