把 Caps Lock 變成智慧的 Control 以及 Escape :
- 單獨輕按一下就是 Escape 。
- 若按下時同時按著其他鍵,就會是 Control 。
這應該是 Vim 和 Emacs 的最佳解了!(Emacs? Bash 的快捷鍵就是 Emacs 系列的)
- Send Escape if you tap Caps Lock alone.
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- Produced by Beyond Compare 4 from Scooter Software --> | |
<!-- | |
This is an extension of the work done by Nate Finch: | |
https://npf.io/2014/05/diffing-go-with-beyond-compare/ | |
The regular expressions for identifiers have been updated | |
to match on lowercase and allow numbers to be included anywhere | |
after the first character of the word. | |
;; based on http://emacsredux.com/blog/2013/04/03/delete-file-and-buffer/ | |
(defun delete-file-and-buffer () | |
"Kill the current buffer and deletes the file it is visiting." | |
(interactive) | |
(let ((filename (buffer-file-name))) | |
(if filename | |
(if (y-or-n-p (concat "Do you really want to delete file " filename " ?")) | |
(progn | |
(delete-file filename) | |
(message "Deleted file %s." filename) |
--- Actions --- | |
$Copy <M-C> | |
$Cut <M-X> <S-Del> | |
$Delete <Del> <BS> <M-BS> | |
$LRU | |
$Paste <M-V> | |
$Redo <M-S-Z> <A-S-BS> | |
$SearchWeb <A-S-G> | |
$SelectAll <M-A> | |
$Undo <M-Z> |
Add this to Info.plist
in /System/Library/Spotlight/RichText.mdimporter/Contents/
and Spotlight will search for source code files.
<string>public.c-header</string>
<string>public.c-plus-plus-header</string>
<string>public.c-source</string>
<string>public.objective-c-source</string>
public.c-plus-plus-source
git config --global https.proxy http://127.0.0.1:1080 | |
git config --global https.proxy https://127.0.0.1:1080 | |
git config --global --unset http.proxy | |
git config --global --unset https.proxy | |
npm config delete proxy |
public class Peterson { | |
public volatile boolean[] flag = new boolean[2]; | |
public volatile int victim; | |
public void lock() { | |
int i = Integer.parseInt(Thread.currentThread().getName().substring(7)) - 1; | |
int j = 1 - i; | |
flag[j] = true; | |
victim = i; | |
while (flag[j] && victim == i) {}; // wait | |
} |
;; Needs terminal-notifier (brew install terminal-notifier) | |
(defun notify-osx (title message) | |
(call-process "terminal-notifier" | |
nil 0 nil | |
"-group" "Emacs" | |
"-title" title | |
"-sender" "org.gnu.Emacs" | |
"-message" message)) | |
;; org-pomodoro mode hooks |
;\aleph | ℵ | |
---|---|---|
;\forall | ∀ | |
;\hbar | ℏ | |
;\emptyset | ∅ | |
;\exists | ∃ | |
;\imath | ı | |
;\nabla | ∇ | |
;\neg | ¬ | |
;\surd | √ | |
;\flat | ♭ |