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.

159 lines
4.5 KiB

4 years ago
  1. (defun dotfiles/tangle (dir)
  2. "Recursively tangle the Org files within a directory."
  3. (let ((org-files (directory-files-recursively dir "org")))
  4. (dolist (f org-files)
  5. (org-babel-tangle-file f))))
  6. (defvar dotfiles/font "Fira Code")
  7. (defvar dotfiles/font-size 96)
  8. (defvar dotfiles/idle 0.0)
  9. (defvar dotfiles/leader-key "SPC")
  10. (defvar dotfiles/home user-emacs-directory)
  11. (defvar dotfiles/cache "~/.cache/emacs")
  12. (setq create-lockfiles nil
  13. make-backup-files nil
  14. user-emacs-directory dotfiles/cache)
  15. (setq straight-repository-branch "develop"
  16. straight-use-package-by-default t)
  17. (defvar bootstrap-version)
  18. (let ((bootstrap-file
  19. (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
  20. (bootstrap-version 5))
  21. (unless (file-exists-p bootstrap-file)
  22. (with-current-buffer
  23. (url-retrieve-synchronously
  24. "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
  25. 'silent 'inhibit-cookies)
  26. (goto-char (point-max))
  27. (eval-print-last-sexp)))
  28. (load bootstrap-file nil 'nomessage))
  29. (straight-use-package 'use-package)
  30. (use-package no-littering)
  31. (setq inhibit-startup-message t)
  32. (global-prettify-symbols-mode)
  33. (scroll-bar-mode -1)
  34. (menu-bar-mode -1)
  35. (tool-bar-mode -1)
  36. (tooltip-mode -1)
  37. (set-face-attribute 'default nil :font dotfiles/font :height dotfiles/font-size)
  38. (set-face-attribute 'fixed-pitch nil :font dotfiles/font :height dotfiles/font-size)
  39. (set-face-attribute 'variable-pitch nil :font dotfiles/font :height dotfiles/font-size)
  40. (global-set-key (kbd "<escape>") 'keyboard-escape-quit)
  41. (use-package which-key
  42. :diminish which-key-mode
  43. :init (which-key-mode)
  44. :config (setq which-key-idle-delay dotfiles/idle))
  45. (use-package general
  46. :config
  47. (general-create-definer dotfiles/leader
  48. :states '(normal motion)
  49. :keymaps 'override
  50. :prefix dotfiles/leader-key))
  51. (use-package evil
  52. :init (setq evil-want-integration t
  53. evil-want-keybinding nil)
  54. :config (evil-mode 1))
  55. (use-package evil-collection
  56. :after evil
  57. :config (evil-collection-init))
  58. (use-package evil-nerd-commenter
  59. :bind ("M-;" . evilnc-comment-or-uncomment-lines))
  60. (dotfiles/leader
  61. "," '(switch-to-buffer :which-key "Buffer")
  62. "." '(find-file :which-key "File"))
  63. (dotfiles/leader
  64. "q" '(:ignore t :which-key "Quit")
  65. "qq" '(save-buffers-kill-emacs :which-key "Save")
  66. "qw" '(kill-emacs :which-key "Now"))
  67. (dotfiles/leader
  68. "w" '(:ignore t :which-key "Window")
  69. "ww" '(window-swap-states :which-key "Swap")
  70. "wk" '(kill-buffer-and-window :which-key "Kill")
  71. "wd" '(delete-window :which-key "Delete")
  72. "wh" '(windmove-left :which-key "Left")
  73. "wj" '(windmove-down :which-key "Down")
  74. "wk" '(windmove-up :which-key "Up")
  75. "wl" '(windmove-right :which-key "Right")
  76. "ws" '(:ignore t :which-key "Split")
  77. "wsj" '(split-window-below :which-key "Down")
  78. "wsl" '(split-window-right :which-key "Right"))
  79. (use-package linum-relative
  80. :init (setq linum-relative-backend
  81. 'display-line-numbers-mode)
  82. :config (linum-relative-global-mode))
  83. (use-package rainbow-delimiters
  84. :hook (prog-mode . rainbow-delimiters-mode))
  85. (use-package all-the-icons)
  86. (use-package all-the-icons-dired
  87. :hook (dired-mode . all-the-icons-dired-mode))
  88. (require 'dired-x)
  89. (dotfiles/leader
  90. "d" '(dired-jump :which-key "Dired"))
  91. (use-package eshell-prompt-extras
  92. :config (setq eshell-highlight-prompt nil
  93. eshell-prompt-function 'epe-theme-lambda))
  94. (dotfiles/leader
  95. "e" '(eshell :which-key "Shell"))
  96. (use-package doom-themes
  97. :init (load-theme 'doom-moonlight t))
  98. (use-package doom-modeline
  99. :init (doom-modeline-mode 1)
  100. :custom ((doom-modeline-height 16)))
  101. (use-package org
  102. :hook
  103. (org-mode . (lambda ()
  104. (org-indent-mode)
  105. (visual-line-mode 1)
  106. (variable-pitch-mode 1)))
  107. :config
  108. (setq org-ellipsis ""
  109. org-log-done 'time
  110. org-log-into-drawer t
  111. org-src-preserve-indentation t)
  112. (org-babel-do-load-languages
  113. 'org-babel-load-languages
  114. '((shell . t)
  115. (python . t)
  116. (emacs-lisp . t)))
  117. (require 'org-tempo)
  118. (add-to-list 'org-structure-template-alist '("s" . "src "))
  119. (add-to-list 'org-structure-template-alist '("q" . "quote"))
  120. (add-to-list 'org-structure-template-alist '("e" . "example"))
  121. (add-to-list 'org-structure-template-alist '("sh" . "src shell"))
  122. (add-to-list 'org-structure-template-alist '("py" . "src python"))
  123. (add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp")))
  124. (use-package org-superstar
  125. :hook (org-mode . org-superstar-mode))