mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 16:53:00 +00:00
feat(emacs-org): Add basic org configs
* LaTeX Preview * Remove custom.el from VCS
This commit is contained in:
parent
e6b1e1b595
commit
e6037c3471
6 changed files with 97 additions and 2 deletions
3
tools/emacs.d/.gitignore
vendored
3
tools/emacs.d/.gitignore
vendored
|
|
@ -16,4 +16,5 @@ tutorial
|
|||
auto-save-list
|
||||
tramp
|
||||
|
||||
recentf
|
||||
recentf
|
||||
custom.el
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
;; Your init file should contain only one such instance.
|
||||
;; If there is more than one, they won't work right.
|
||||
'(package-selected-packages
|
||||
'(marginalia vertico doom-modeline wakatime-mode evil-surround all-the-icons dired-single gnu-elpa-keyring-update--keyring gnu-elpa-keyring-update lsp-mode catppuccin-theme use-package evil company)))
|
||||
'(ob-csharp org-bullets org-superstar marginalia vertico doom-modeline wakatime-mode evil-surround all-the-icons dired-single gnu-elpa-keyring-update--keyring gnu-elpa-keyring-update lsp-mode catppuccin-theme use-package evil company)))
|
||||
(custom-set-faces
|
||||
;; custom-set-faces was added by Custom.
|
||||
;; If you edit it by hand, you could mess it up, so be careful.
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@
|
|||
(require 'init-keymaps)
|
||||
(require 'init-evil)
|
||||
(require 'init-file)
|
||||
(require 'init-edit)
|
||||
(require 'init-org)
|
||||
;; (require 'init-lsp) ; FIXME: See .emacs.d/lisp/init-lsp.el
|
||||
|
||||
;; Load `custom` file
|
||||
|
|
|
|||
|
|
@ -20,3 +20,35 @@
|
|||
(use-package marginalia
|
||||
:init
|
||||
(marginalia-mode))
|
||||
|
||||
|
||||
;;; 设置语言环境为 UTF-8
|
||||
;(set-language-environment "UTF-8")
|
||||
;
|
||||
;;; 强制使用 UTF-8
|
||||
;(prefer-coding-system 'utf-8)
|
||||
;(set-default-coding-systems 'utf-8)
|
||||
;(set-terminal-coding-system 'utf-8)
|
||||
;(set-keyboard-coding-system 'utf-8)
|
||||
;
|
||||
;;; Windows 系统特殊设置
|
||||
;(when (eq system-type 'windows-nt)
|
||||
; (set-file-name-coding-system 'gbk) ;; 文件名使用 GBK
|
||||
; (set-clipboard-coding-system 'utf-16le)) ;; 剪贴板使用 UTF-16LE
|
||||
;
|
||||
;(setq-default buffer-file-coding-system 'utf-8-unix)
|
||||
;
|
||||
;;; 设置行尾为 Unix 风格
|
||||
;(add-hook 'find-file-hook 'find-file-check-line-endings)
|
||||
;
|
||||
;(defun dos-file-endings-p ()
|
||||
; (string-match "dos" (symbol-name buffer-file-coding-system)))
|
||||
;
|
||||
;(defun find-file-check-line-endings ()
|
||||
; (when (dos-file-endings-p)
|
||||
; (set-buffer-file-coding-system 'undecided-unix)
|
||||
; (set-buffer-modified-p nil)))
|
||||
|
||||
(setq-default buffer-file-coding-system 'utf-8-unix)
|
||||
|
||||
(provide 'init-edit)
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
(evil-mode 1)
|
||||
; Colemak Vim Arrow
|
||||
(evil-define-key '(normal visual operator) 'global
|
||||
;; To see the keybindings, use <C-h> k then type the key
|
||||
"n" 'evil-next-line
|
||||
"e" 'evil-previous-line
|
||||
"i" 'evil-forward-char
|
||||
|
|
@ -20,6 +21,8 @@
|
|||
"J" 'evil-forward-WORD-end
|
||||
"N" '(lambda () (interactive) (evil-next-line 5)) ; 5n
|
||||
"E" '(lambda () (interactive) (evil-previous-line 5)) ; 5e
|
||||
"H" 'switch-to-prev-buffer
|
||||
"I" 'switch-to-next-buffer
|
||||
))
|
||||
|
||||
;; Text Objects Keymap - Use `l` for inner (swap i and l)
|
||||
|
|
|
|||
57
tools/emacs.d/lisp/init-org.el
Normal file
57
tools/emacs.d/lisp/init-org.el
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
;;; init-org.el
|
||||
|
||||
(use-package org
|
||||
:ensure nil ;; Use Emacs built-in Org Mode
|
||||
:config
|
||||
(setq org-log-done 'time)
|
||||
(setq org-startup-indented nil)
|
||||
;; Use inline image
|
||||
(setq org-startup-with-inline-images t)
|
||||
;; Use LaTeX rendering
|
||||
(setq org-startup-with-latex-preview t)
|
||||
(setq org-image-actual-width 600)
|
||||
;; Conceal on markup markers
|
||||
(setq org-hide-emphasis-markers t)
|
||||
(setq org-directory "~/OrgFiles")
|
||||
(setq org-agenda-files '("~/OrgFiles"))
|
||||
(setq org-pretty-entities t)
|
||||
(setq org-src-fontify-natively t)
|
||||
(setq org-src-tab-acts-natively t) ; Use TAB to indent inside source block
|
||||
(setq org-src-preserve-indentation t) ; Prevent from auto-indent
|
||||
(with-eval-after-load 'org
|
||||
(define-key org-mode-map (kbd "C-j") 'org-return-indent)
|
||||
(evil-define-key 'normal org-mode-map (kbd "TAB") 'org-cycle))
|
||||
(evil-define-key 'normal org-mode-map (kbd "SPC a") 'org-agenda-list) ; TODO: Here Simulates the leader
|
||||
)
|
||||
|
||||
(use-package org-bullets
|
||||
:after org
|
||||
:hook (org-mode . org-bullets-mode))
|
||||
|
||||
(use-package org-fragtog
|
||||
:after org
|
||||
:hook (org-mode . org-fragtog-mode))
|
||||
|
||||
;; Run source block with C-c C-c
|
||||
;; Add supports for non-elisp langs
|
||||
(use-package ob-python
|
||||
:ensure nil ; Part of Org Mode
|
||||
:after org)
|
||||
|
||||
(use-package ob-C ;; C++ support is integrated in ob-C
|
||||
:ensure nil ; Part of Org Mode
|
||||
:after org)
|
||||
|
||||
(org-babel-do-load-languages
|
||||
'org-babel-load-languages
|
||||
'(
|
||||
(python . t) ; No need to declare C/C++/emacs-lisp since is integrated
|
||||
))
|
||||
;; Use clang as default C/C++ Compiler (Easier to install and configure in Windows)
|
||||
(setq org-babel-C-compiler "clang")
|
||||
(setq org-babel-C++-compiler "clang++")
|
||||
;; Don't ask me again when running source block
|
||||
(setq org-confirm-babel-evaluate nil)
|
||||
|
||||
|
||||
(provide 'init-org)
|
||||
Loading…
Add table
Add a link
Reference in a new issue