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.

166 lines
4.5 KiB

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