Compare commits
11 Commits
b776f8e933
...
7f504839cd
Author | SHA1 | Date |
---|---|---|
Jason Tian | 7f504839cd | |
Jason Tian | 02440a1790 | |
Jason TIAN | 412edd8e3a | |
Jason TIAN | d721427451 | |
Jason Tian | d2e1999fe3 | |
Jason Tian | 95cd5b59ee | |
Jason TIAN | 370453498c | |
Jason TIAN | f269336ae9 | |
Jason Tian | 1372adce4a | |
Jason Tian | ce48f33da9 | |
Jason Tian | eed8c68547 |
|
@ -20,6 +20,16 @@
|
|||
|
||||
(defvar my-install-deps
|
||||
'(
|
||||
;; example,
|
||||
;; (npm ; the executable binary name
|
||||
;; :darwin-command "brew install node" ; the installation command for macOS
|
||||
;; :linux-command "sudo pacman -S --noconfirm nodejs npm" ; the installation command for Linux
|
||||
;; :windows-command "scoop install nodejs" ; the installation command for Windows
|
||||
;; ...... ; if the darwin/linux/windows-command (above) is,
|
||||
;; ...... ; - empty value (like - linux-command: ""), then a reminding message will raise for manual installation
|
||||
;; ...... ; - not exist, then reminding message will show that xxx (executable binary name) is not considered to install on specific OS
|
||||
;; :message nil ; manual set reminding message
|
||||
;; :enabled t) ; to install or not
|
||||
(npm ; install npm first
|
||||
:darwin-command "brew install node"
|
||||
:linux-command "sudo pacman -S --noconfirm nodejs npm"
|
||||
|
@ -44,6 +54,14 @@
|
|||
:windows-command "npm install -g bash-language-server"
|
||||
:message nil
|
||||
:enabled t)
|
||||
(crow ; for dictionary-overlay package
|
||||
;; Chaotic-AUR repository should be set up before installing crow-translate, see,
|
||||
;; https://aur.chaotic.cx
|
||||
;; read more,
|
||||
;; https://github.com/jsntn/emacs.d/issues/21
|
||||
:linux-command "sudo pacman -S --noconfirm crow-translate" ; https://crow-translate.github.io
|
||||
:message nil
|
||||
:enabled t)
|
||||
(ctags
|
||||
:darwin-command "brew install universal-ctags"
|
||||
:linux-command "sudo pacman -S --noconfirm ctags"
|
||||
|
@ -62,7 +80,7 @@
|
|||
;; :windows-command ""
|
||||
:message nil
|
||||
:enabled t)
|
||||
(less
|
||||
(less ; Linux utility
|
||||
:darwin-command "brew install less"
|
||||
:linux-command "sudo pacman -S --noconfirm less"
|
||||
:windows-command "scoop install less"
|
||||
|
@ -136,6 +154,10 @@
|
|||
:windows-command "npm install -g prettier"
|
||||
:message nil ;; No message needed for prettier
|
||||
:enabled t)
|
||||
(unzip ; for nov.el package
|
||||
:linux-command "sudo pacman -S --noconfirm unzip"
|
||||
:message nil
|
||||
:enabled t)
|
||||
(yaml-language-server
|
||||
:darwin-command "npm install -g yaml-language-server"
|
||||
:linux-command "sudo npm install -g yaml-language-server"
|
||||
|
|
|
@ -86,7 +86,6 @@
|
|||
|
||||
(add-hook 'emacs-lisp-mode-hook 'show-paren-mode) ; highlight matching
|
||||
; parenthesis
|
||||
(global-hl-line-mode 1) ; highlight current line
|
||||
|
||||
(setq display-line-numbers-width-start t)
|
||||
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
;;; Code:
|
||||
|
||||
|
||||
;; highlight current line for all programming major modes
|
||||
(add-hook 'prog-mode-hook #'hl-line-mode)
|
||||
|
||||
(defun my/hs-hide-all ()
|
||||
(hs-minor-mode 1)
|
||||
(hs-hide-all)
|
||||
|
|
|
@ -78,13 +78,14 @@
|
|||
|
||||
(setq org-todo-keywords
|
||||
;; '((sequence "☛ TODO(t)" "➼ IN-PROGRESS" "⚑ WAIT(w@/!)" "|" "✔ DONE(d!)" "✘ CANCELED(c@)")
|
||||
'((sequence "TODO(t)" "IN-PROGRESS" "WAIT(w@/!)" "|" "DONE(d!)" "CANCELED(c@)")
|
||||
'((sequence "TODO(t)" "IN-PROGRESS" "WAIT(w@/!)" "|" "DONE(d!)" "CANCELED(c@)" "CLOSED")
|
||||
(sequence "REPORT(r)" "BUG(b)" "KNOWNCAUSE(k)" "IMPROVEMENT(m)" "ENHANCEMENT(e)" "FEATURE(a)" "|" "FIXED(f)")
|
||||
))
|
||||
|
||||
(setf org-todo-keyword-faces '(
|
||||
("CANCELED" . (:foreground "white" :background "#95A5A6"))
|
||||
("DONE" . (:foreground "white" :background "#2E8B57"))
|
||||
("CLOSED" . (:foreground "white" :background "#2E8B57"))
|
||||
("WAIT" . (:foreground "white" :background "#F9BC41"))
|
||||
("IN-PROGRESS" . (:foreground "white" :background "#3498DB"))
|
||||
("TODO" . (:foreground "white" :background "#5F87FF"))
|
||||
|
|
|
@ -238,6 +238,7 @@
|
|||
;; align with the org-todo-keyword-faces
|
||||
("TODO" :foreground "white" :background "#5F87FF")
|
||||
("DONE" :foreground "white" :background "#2E8B57")
|
||||
("CLOSED" :foreground "white" :background "#2E8B57")
|
||||
("CANCELED" :foreground "white" :background "#95A5A6")
|
||||
("WAIT" :foreground "white" :background "#F9BC41")
|
||||
("IN-PROGRESS" :foreground "white" :background "#3498DB")
|
||||
|
|
|
@ -9,6 +9,24 @@
|
|||
(defconst *is-win* (eq system-type 'windows-nt))
|
||||
(defconst *is-linux* (or (eq system-type 'gnu/linux) (eq system-type 'linux)) )
|
||||
|
||||
|
||||
|
||||
(defun my-require (feature)
|
||||
"Custom require function to prevent recursive loading."
|
||||
(unless (featurep feature)
|
||||
(require feature)))
|
||||
|
||||
(defun my-require-maybe (feature &optional file)
|
||||
"Try to require FEATURE, but don't signal an error if `require' fails."
|
||||
(require feature file 'noerror))
|
||||
|
||||
(defun my-when-available (func foo)
|
||||
"Do something if FUNCTION is available."
|
||||
(when (fboundp func) (funcall foo)))
|
||||
|
||||
|
||||
|
||||
|
||||
;; { -- START --
|
||||
;; check Linux distribution
|
||||
;; https://emacs.stackexchange.com/questions/18205/how-can-i-distinguish-between-linux-distributions-in-emacs
|
||||
|
|
|
@ -251,19 +251,21 @@ and the decrypted file will be securely deleted after opening in buffer."
|
|||
|
||||
|
||||
;; {{ START: my/check-orphaned-org-ids-in-directory
|
||||
(require 'org-element) ; this should be here before `org-add-link-type'
|
||||
(require 'cl-lib)
|
||||
(defun my-org-id-link-pre ()
|
||||
"The precondition config to my org id link settings"
|
||||
(my-require 'org-element) ; this should be here before `org-add-link-type'
|
||||
(my-require 'cl-lib)
|
||||
|
||||
;; From ChatGPT,
|
||||
;; The message "Created id link." is printed by the `org-add-link-type` function
|
||||
;; each time it is called.
|
||||
;; Since you have the line `(org-add-link-type "id" #'my-org-id-link-follow)` in
|
||||
;; your code, this function is called every time you load or reload your Emacs
|
||||
;; configuration. It registers a new link type called `"id"` that is handled by
|
||||
;; the `my-org-id-link-follow` function.
|
||||
;; From ChatGPT,
|
||||
;; The message "Created id link." is printed by the `org-add-link-type` function
|
||||
;; each time it is called.
|
||||
;; Since you have the line `(org-add-link-type "id" #'my-org-id-link-follow)` in
|
||||
;; your code, this function is called every time you load or reload your Emacs
|
||||
;; configuration. It registers a new link type called `"id"` that is handled by
|
||||
;; the `my-org-id-link-follow` function.
|
||||
|
||||
;; register new link type called "id"
|
||||
(org-add-link-type "id" #'my-org-id-link-follow)
|
||||
;; register new link type called "id"
|
||||
(org-add-link-type "id" #'my-org-id-link-follow))
|
||||
|
||||
(defun my-org-id-link-follow (id)
|
||||
"Follow an `id' link."
|
||||
|
@ -271,6 +273,7 @@ and the decrypted file will be securely deleted after opening in buffer."
|
|||
|
||||
(defun my-org-id-links-in-buffer ()
|
||||
"Return a list of Org ID links in the current buffer."
|
||||
(my-org-id-link-pre)
|
||||
(let (org-id-links) ; creates a local variable called `org-id-links` with an
|
||||
; initial value of `nil` that is only visible within the
|
||||
; `let` block
|
||||
|
@ -296,6 +299,7 @@ and the decrypted file will be securely deleted after opening in buffer."
|
|||
(defun my-list-org-ids-in-directory (directory)
|
||||
"List all org-ids in org-files in the given DIRECTORY and return them as a list."
|
||||
(interactive "DDirectory: ")
|
||||
(my-org-id-link-pre)
|
||||
(let ((org-files (directory-files-recursively directory "\\.org$"))
|
||||
(org-ids '()))
|
||||
(dolist (file org-files)
|
||||
|
|
Loading…
Reference in New Issue