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
;; ;; omit the result to STDOUT after return when using emacs/emacsclient -e "expression" | |
;; (when (not (display-graphic-p)) | |
;; (define-advice server-eval-and-print (:filter-args (args) no-print) | |
;; (list (car args) nil))) | |
(setq org-agenda-custom-commands | |
'(("c" "Simple agenda view" | |
((tags "PRIORITY=\"A\"" | |
((org-agenda-skip-function '(org-agenda-skip-entry-if 'todo 'done)) | |
(org-agenda-overriding-header "High-priority unfinished tasks:"))) |
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
;; omit the result to STDOUT after return when using emacs/emacsclient -e "expression" | |
(when (not (display-graphic-p)) | |
(define-advice server-eval-and-print (:filter-args (args) no-print) | |
(list (car args) nil))) | |
(bind-keys :map prog-mode-map | |
("C-c a a" . align) | |
("C-c a r" . align-regexp)) | |
# Put this into org-mode-map |
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
function diffs -d "all kinds of diff features" | |
set -l options 'f' 'w' 'l' 'L' 'W' 'h' | |
argparse -n diffs $options -- $argv | |
or return | |
if set -q _flag_h | |
echo "diffs [-f/-w/-l/-L/-W/-h]" | |
echo " no option --> side by side, only diffs" | |
echo " -f --> like no argument, but print whole files" | |
echo " -w --> like no argument, but ignore all white spaces" |
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
change helm-moccur-map tp helm-occur-map since it is rewriten | |
;; use TAB to complete when using C-x C-f, use C-i for original TAB/C-i feature | |
(define-key helm-find-files-map "\t" 'helm-execute-persistent-action) | |
(setq helm-ff-auto-update-initial-value t) ;file name auto-expansion github-issue-1616 | |
(setq projectile-enable-caching nil) | |
(setq projectile-git-submodule-command nil) ; make projectile work for repo contains submodules | |
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
download helm-swoop.el from https://raw.githubusercontent.com/ashiklom/helm-swoop/master/helm-swoop.el | |
since it fixes the edit problem in helm-swoop | |
(bind-keys* | |
("C-x s" . helm-swoop) | |
("C-x S" . helm-multi-swoop)) | |
delete "C-x e" binding | |
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
remove emm and t functions in config.fish and just use them in ~/.local/bin/ | |
alias less 'less -x4 -RM -s +Gg' # -x4 to set the tabwidth to 4 instead default 8 |
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
#!/bin/bash | |
# 0. put this script into ~/.local/bin/ | |
# 1. Create a emacsclient.desktop in ~/.local/share/applications/emacsclient.desktop | |
# 1.1 if you installed Emacs using pkg manager instead of anaconda3, omit this step | |
# 1.2 if you are using non-GUI or launcher is unnecessary, omit this step including the next | |
# 1.3 if you are using an OS without systemctl installed, omit this step including the next | |
# | |
# emacsclient.desktop: | |
# |
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
#!/usr/bin/env bash | |
_runcommands() { | |
if [[ $DRYRUN == 1 ]] || [[ $VERBOSE -gt 1 ]]; then | |
echo "$@" | |
fi | |
if [[ $DRYRUN != 1 ]]; then | |
eval "$@" | |
fi | |
} |
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
(defalias 'eit-list 'benchmark-init/show-durations-tabulated) | |
;; (setq desktop-save 'ask) | |
;;desktop-save ask means always ask | |
;; (desktop-save-mode nil) | |
(setq confirm-kill-emacs 'y-or-n-p) | |
(defun ask-before-closing () | |
"Prompt for confirmation for emacsclient(not daemon) like confirm-kill-emacs for running Emacs without daemon." | |
(interactive) | |
(if (y-or-n-p (format "Really exit Emacs? ")) |
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
(if (daemonp) | |
;; for emacs --deamon, highlight-change doesn't work with daemon | |
(add-hook 'after-make-frame-functions | |
(lambda (frame) | |
(select-frame frame) | |
(bind-keys* | |
("C-h C-b" . diff-buffer-with-file) | |
("C-h C-v" . highlight-changes-visible-mode) | |
("M-<f1>" . highlight-changes-previous-change) | |
("M-<f2>" . highlight-changes-next-change)) |