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.

158 lines
4.6 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. (when (< emacs-major-version 27)
  23. (scroll-bar-mode -1))
  24. (menu-bar-mode -1)
  25. (tool-bar-mode -1)
  26. (tooltip-mode -1)
  27. (use-package org
  28. :hook (org-mode .
  29. (lambda ()
  30. (org-indent-mode)
  31. (visual-line-mode 1)
  32. (variable-pitch-mode 1)))
  33. :custom (org-ellipsis "")
  34. (org-log-done 'time)
  35. (org-log-into-drawer t)
  36. (org-image-actual-width nil)
  37. (org-directory dotfiles/home)
  38. (org-src-preserve-indentation t)
  39. :config (require 'org-tempo)
  40. (add-to-list 'org-structure-template-alist '("s" . "src"))
  41. (add-to-list 'org-structure-template-alist '("q" . "quote"))
  42. (add-to-list 'org-structure-template-alist '("e" . "example"))
  43. (add-to-list 'org-structure-template-alist '("sh" . "src shell"))
  44. (add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp"))
  45. (org-babel-do-load-languages 'org-babel-load-languages '((shell . t)
  46. (python . t)
  47. (emacs-lisp . t))))
  48. (defun dotfiles/tangle (dir)
  49. "Recursively tangle the Org files within a directory."
  50. (interactive)
  51. (let ((org-files (directory-files-recursively dir "org")))
  52. (dolist (f org-files)
  53. (org-babel-tangle-file f))))
  54. (global-set-key (kbd "<escape>") 'keyboard-escape-quit)
  55. (use-package which-key
  56. :diminish which-key-mode
  57. :custom (which-key-idle-delay dotfiles/idle)
  58. :config (which-key-mode))
  59. (use-package general
  60. :config
  61. (general-create-definer dotfiles/leader
  62. :states '(normal motion)
  63. :keymaps 'override
  64. :prefix dotfiles/leader-key
  65. :global-prefix dotfiles/leader-key-global))
  66. (use-package hydra)
  67. (use-package evil
  68. :custom (evil-want-integration t) ;; Required for `evil-collection'.
  69. (evil-want-keybinding nil) ;; Same as above
  70. :config (evil-mode 1))
  71. (use-package evil-collection
  72. :after evil
  73. :config (evil-collection-init))
  74. (use-package evil-surround
  75. :config (global-evil-surround-mode 1))
  76. (use-package evil-nerd-commenter
  77. :bind ("M-;" . evilnc-comment-or-uncomment-lines))
  78. (dotfiles/leader
  79. "." '(find-file :which-key "Files")
  80. "," '(switch-to-buffer :which-key "Buffers")
  81. "c" '(kill-buffer-and-window :which-key "Close"))
  82. (dotfiles/leader
  83. "h" '(:ignore t :which-key "Help")
  84. "hp" '(describe-package :which-key "Package")
  85. "hv" '(describe-variable :which-key "Variable")
  86. "hf" '(describe-function :which-key "Function"))
  87. (dotfiles/leader
  88. "q" '(:ignore t :which-key "Quit")
  89. "qq" '(save-buffers-kill-emacs :which-key "Save")
  90. "qw" '(kill-emacs :which-key "Now")
  91. "qf" '(delete-frame :which-key "Frame"))
  92. (dotfiles/leader
  93. "w" '(:ignore t :which-key "Window")
  94. "ww" '(window-swap-states :which-key "Swap")
  95. "wc" '(delete-window :which-key "Close")
  96. "wh" '(windmove-left :which-key "Left")
  97. "wj" '(windmove-down :which-key "Down")
  98. "wk" '(windmove-up :which-key "Up")
  99. "wl" '(windmove-right :which-key "Right")
  100. "ws" '(:ignore t :which-key "Split")
  101. "wsj" '(split-window-below :which-key "Down")
  102. "wsl" '(split-window-right :which-key "Right"))
  103. (dotfiles/leader
  104. "t" '(:ignore t :which-key "Tweaks"))
  105. (use-package magit
  106. :custom (magit-display-buffer-function
  107. #'magit-display-buffer-same-window-except-diff-v1))
  108. (use-package forge)
  109. (dotfiles/leader
  110. "g" '(magit-status :which-key "Magit"))
  111. (use-package eshell-prompt-extras
  112. :custom (eshell-highlight-prompt nil)
  113. (eshell-prompt-function 'epe-theme-lambda))
  114. (dotfiles/leader
  115. "e" '(eshell :which-key "Shell"))
  116. (use-package all-the-icons)
  117. (use-package all-the-icons-dired
  118. :hook (dired-mode . all-the-icons-dired-mode))
  119. (require 'dired-x)
  120. (use-package dired-single
  121. :config (evil-collection-define-key 'normal 'dired-mode-map
  122. "h" 'dired-single-up-directory
  123. "l" 'dired-single-buffer))
  124. (dotfiles/leader
  125. "d" '(dired-jump :which-key "Dired"))