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.

160 lines
4.3 KiB

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