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.

155 lines
4.5 KiB

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