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.

161 lines
4.4 KiB

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