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.

157 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. (emacs-lisp . t))))
  47. (defun dotfiles/tangle (dir)
  48. "Recursively tangle the Org files within a directory."
  49. (interactive)
  50. (let ((org-files (directory-files-recursively dir "org")))
  51. (dolist (f org-files)
  52. (org-babel-tangle-file f))))
  53. (global-set-key (kbd "<escape>") 'keyboard-escape-quit)
  54. (use-package which-key
  55. :diminish which-key-mode
  56. :custom (which-key-idle-delay dotfiles/idle)
  57. :config (which-key-mode))
  58. (use-package general
  59. :config
  60. (general-create-definer dotfiles/leader
  61. :states '(normal motion)
  62. :keymaps 'override
  63. :prefix dotfiles/leader-key
  64. :global-prefix dotfiles/leader-key-global))
  65. (use-package hydra)
  66. (use-package evil
  67. :custom (evil-want-integration t) ;; Required for `evil-collection'.
  68. (evil-want-keybinding nil) ;; Same as above
  69. :config (evil-mode 1))
  70. (use-package evil-collection
  71. :after evil
  72. :config (evil-collection-init))
  73. (use-package evil-surround
  74. :config (global-evil-surround-mode 1))
  75. (use-package evil-nerd-commenter
  76. :bind ("M-;" . evilnc-comment-or-uncomment-lines))
  77. (dotfiles/leader
  78. "." '(find-file :which-key "Files")
  79. "," '(switch-to-buffer :which-key "Buffers")
  80. "c" '(kill-buffer-and-window :which-key "Close"))
  81. (dotfiles/leader
  82. "h" '(:ignore t :which-key "Help")
  83. "hp" '(describe-package :which-key "Package")
  84. "hv" '(describe-variable :which-key "Variable")
  85. "hf" '(describe-function :which-key "Function"))
  86. (dotfiles/leader
  87. "q" '(:ignore t :which-key "Quit")
  88. "qq" '(save-buffers-kill-emacs :which-key "Save")
  89. "qw" '(kill-emacs :which-key "Now")
  90. "qf" '(delete-frame :which-key "Frame"))
  91. (dotfiles/leader
  92. "w" '(:ignore t :which-key "Window")
  93. "ww" '(window-swap-states :which-key "Swap")
  94. "wc" '(delete-window :which-key "Close")
  95. "wh" '(windmove-left :which-key "Left")
  96. "wj" '(windmove-down :which-key "Down")
  97. "wk" '(windmove-up :which-key "Up")
  98. "wl" '(windmove-right :which-key "Right")
  99. "ws" '(:ignore t :which-key "Split")
  100. "wsj" '(split-window-below :which-key "Down")
  101. "wsl" '(split-window-right :which-key "Right"))
  102. (dotfiles/leader
  103. "t" '(:ignore t :which-key "Tweaks"))
  104. (use-package magit
  105. :custom (magit-display-buffer-function
  106. #'magit-display-buffer-same-window-except-diff-v1))
  107. (use-package forge)
  108. (dotfiles/leader
  109. "g" '(magit-status :which-key "Magit"))
  110. (use-package eshell-prompt-extras
  111. :custom (eshell-highlight-prompt nil)
  112. (eshell-prompt-function 'epe-theme-lambda))
  113. (dotfiles/leader
  114. "e" '(eshell :which-key "Shell"))
  115. (use-package all-the-icons)
  116. (use-package all-the-icons-dired
  117. :hook (dired-mode . all-the-icons-dired-mode))
  118. (require 'dired-x)
  119. (use-package dired-single
  120. :config (evil-collection-define-key 'normal 'dired-mode-map
  121. "h" 'dired-single-up-directory
  122. "l" 'dired-single-buffer))
  123. (dotfiles/leader
  124. "d" '(dired-jump :which-key "Dired"))