This file contains hidden or 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
# diff | |
# side-by-side | |
alias diff-s 'diff -r -y -s --suppress-common-line -W $COLUMNS' # side-by-side, only diffs | |
alias diff-sf 'diff -r -y -s -W $COLUMNS' # like diff-s, but print whole files | |
alias diff-sw 'diff-s -w' # like diff-s, but ignore all white space | |
# line by line | |
alias diff-l 'diff -r -s --suppress-common-line -W $COLUMNS' # line-by-line, only diffs | |
alias diff-lf 'diff -r -s -W $COLUMNS' # like diff-l, but print whole files | |
alias diff-lw 'diff-l -w' # like diff-l, but ignore all white space |
This file contains hidden or 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 delete-line-or-region-or-buffer: | |
change | |
(kill-region (line-beginning-position) (line-end-position)) | |
to | |
(delete-region (line-beginning-position) (line-end-position)) | |
;; (bind-key* "C-c C-SPC" 'er/expand-region) │ | |
(bind-key* "C-c =" 'er/expand-region) | |
(bind-keys* |
This file contains hidden or 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
alias debl 'dpkg --contents' # list contents of deb package |
This file contains hidden or 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
/sudo:root@localhost: | |
to | |
/sudo:: |
This file contains hidden or 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 | |
MEM=$(ps -eo pid,cmd,%mem --sort=-%mem | sed '2q;d') | |
TOP_MEM_PID=$(echo $MEM | awk '{print $1}') | |
TOP_MEM=$(echo $MEM | awk '{print $2}') | |
TOP_MEM_P=$(echo $MEM | awk '{print $NF}') | |
CPU=$(ps -eo pid,cmd,%cpu --sort=-%cpu | sed '2q;d') | |
TOP_CPU_PID=$(echo $CPU | awk '{print $1}') | |
TOP_CPU=$(echo $CPU | awk '{print $2}') | |
TOP_CPU_P=$(echo $CPU | awk '{print $NF}') |
This file contains hidden or 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
(bind-keys :map emacs-lisp-mode-map | |
("C-x c" . emacs-lisp-byte-compile-and-load) | |
("C-c c" . eval-buffer) | |
("C-c C-r" . (lambda () (interactive) (load-file "~/.emacs.d/init.elc"))) | |
) | |
(bind-keys :map lisp-interaction-mode-map | |
("C-c C-e" . (lambda () (interactive) (find-file "~/.emacs.d/init.el"))) | |
("C-c C-r" . (lambda () (interactive) (load-file "~/.emacs.d/init.elc"))) | |
;; C-h e to switch to *Message* Buffer | |
) |
This file contains hidden or 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
https://github.com/emacs-mirror/emacs/blob/ff49d86b6419f88205ff9a5d8b1cc46fcda8371c/etc/NEWS#L493 | |
http://xuchengpeng.com/2018/03/30/emacs-show-line-numbers/ | |
;; M-x profiler-start and do your thing and M-x profiler-report to show the | |
;; performance report, the following improves the structure of the report | |
(setq profiler-report-cpu-line-format '((80 left) (24 right ((19 right) (5 right))))) | |
(setq profiler-report-memory-line-format '((80 left) (24 right ((19 right) (5 right))))) |
This file contains hidden or 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
https://realpython.com/emacs-the-best-python-editor/ | |
1. remove paradox since it will keep loading the list | |
2. remove python-mode configuration about company/anaconda since when you open python file, it will say | |
"comint-send-string: Process Python Internal(file.py) not running" | |
3. install elpy, py-autopep8 | |
;; Python Development Environment |
This file contains hidden or 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
https://github.com/company-mode/company-mode/issues/159#issuecomment-122598917 |
This file contains hidden or 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
(require 'xcscope) | |
(cscope-setup) | |
(setq cscope-option-use-inverted-index t) | |
(defadvice cscope-bury-buffer (after cscope-bury-buffer activate) | |
"Kill the *cscope* window after hitting q or Q instead of leaving it open." | |
(delete-window)) | |
(defun cscope-create-database (top-directory) | |
"Create cscope* files in one step containing, do this before using cscope: | |
1. C-c s L | |
2. C-c s I |