This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 用绿色高亮「申请人」、黄色高亮「被申请人」 | |
(defun my-highlight-some-text () | |
(hi-lock-set-pattern+ "被申请人" 0 'hi-yellow) | |
(hi-lock-set-pattern+ "[^被]\\(申请人\\)" 1 'hi-green)) | |
(add-hook 'org-mode-hook #'my-highlight-some-text) | |
(defun hi-lock-set-pattern+ (regexp group face) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; init.el ends here | |
(with-current-buffer " *load*" (goto-char (point-max))) | |
(the following does not matter nay more) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(helm :sources (helm-build-sync-source "Buffers" | |
:candidates (lambda () (helm-buffer-list)) | |
:filtered-candidate-transformer | |
'(helm-skip-boring-buffers | |
helm-buffers-sort-transformer) | |
:volatile t) | |
:buffer "*helm my buffers*") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun incf-at-point () | |
"Increment number at point by 1." | |
(interactive) | |
(let ((number (number-at-point)) | |
bounds beg end) | |
(if number | |
(progn | |
(setq bounds (bounds-of-thing-at-point 'sexp)) | |
(setq beg (car bounds) | |
end (cdr bounds)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(let* ((ev (read-event "Select a window with mouse: " nil)) | |
(pos (when (consp ev) (nth 1 ev))) | |
(wind (when pos (posn-window pos)))) | |
(message-box "%s - %s" (current-buffer) ev)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(let ((a 1) (b 2)) | |
(setq a (prog1 b (setq b a))) | |
(list a b)) | |
;; => (2 1) | |
(let ((con '(1 . 2))) | |
(setcar con (prog1 (cdr con) | |
(setcdr con (car con)))) | |
con) | |
;; => (2 . 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(setq helm-echo-input-in-header-line t) | |
;; Hide minibuffer when the above option is on. | |
(add-hook 'helm-minibuffer-set-up-hook | |
#'helm-hide-minibuffer-maybe) | |
;; Don't use helm's own displaying mode line function | |
(fset 'helm-display-mode-line #'ignore) | |
(add-hook 'helm-after-initialize-hook | |
(defun hide-mode-line-in-helm-buffer () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Put it in your .zshrc or .bashrc | |
function ef { sed -n 's/^ *"\(.*\)"/\1/p' ~/.emacs.d/recentf | pick | xargs $EDITOR } |