(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf
:
# 中西文切換鍵的默認設置寫在 default.yaml 裏面 | |
# 以下的 default.custom.yaml 在全局範圍重定義該組快速鍵 | |
# | |
# 可用的按鍵有 Caps_Lock, Shift_L, Shift_R, Control_L, control_R | |
# Mac 系統上的鼠鬚管不能區分左、右,因此只有對 Shift_L, Control_L 的設定起作用 | |
# | |
# 已輸入編碼時按切換鍵,可以進一步設定輸入法中西文切換的形式。 | |
# 可選的臨時切換策略有三: | |
# inline_ascii 在輸入法的臨時西文編輯區內輸入字母、數字、符號、空格等,回車上屏後自動復位到中文 | |
# commit_text 已輸入的候選文字上屏並切換至西文輸入模式 |
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list | |
# A list of available STUN server. | |
stun.l.google.com:19302 | |
stun1.l.google.com:19302 | |
stun2.l.google.com:19302 | |
stun3.l.google.com:19302 | |
stun4.l.google.com:19302 | |
stun01.sipphone.com | |
stun.ekiga.net |
-- Print contents of `tbl`, with indentation. | |
-- `indent` sets the initial level of indentation. | |
function tprint (tbl, indent) | |
if not indent then indent = 0 end | |
for k, v in pairs(tbl) do | |
formatting = string.rep(" ", indent) .. k .. ": " | |
if type(v) == "table" then | |
print(formatting) | |
tprint(v, indent+1) | |
elseif type(v) == 'boolean' then |
;; Make emacs open all files in last emacs session. | |
;; Taken from ergoemacs, credits go to ergoemacs authors. | |
;; This functionality is provided by desktop-save-mode | |
;; (“feature” name: “desktop”). | |
;; | |
;; The mode is not on by default in emacs 23.1, and has a lot options. | |
;; The following is init settings for the mode for ErgoEmacs. | |
;; Goal: have emacs always auto open the set of opened files in last session, | |
;; even if emacs crashed in last session or the OS crashed in last session. |
# put this in your .bash_profile | |
if [ $ITERM_SESSION_ID ]; then | |
export PROMPT_COMMAND='echo -ne "\033];${PWD##*/}\007"; ':"$PROMPT_COMMAND"; | |
fi | |
# Piece-by-Piece Explanation: | |
# the if condition makes sure we only screw with $PROMPT_COMMAND if we're in an iTerm environment | |
# iTerm happens to give each session a unique $ITERM_SESSION_ID we can use, $ITERM_PROFILE is an option too | |
# the $PROMPT_COMMAND environment variable is executed every time a command is run | |
# see: ss64.com/bash/syntax-prompt.html |
# There was a day where I have too many color schemes in iTerm2 and I want to remove them all. | |
# iTerm2 doesn't have "bulk remove" and it was literally painful to delete them one-by-one. | |
# iTerm2 save it's preference in ~/Library/Preferences/com.googlecode.iterm2.plist in a binary format | |
# What you need to do is basically copy that somewhere, convert to xml and remove color schemes in the xml files. | |
$ cd /tmp/ | |
$ cp ~/Library/Preferences/com.googlecode.iterm2.plist . | |
$ plutil -convert xml1 com.googlecode.iterm2.plist | |
$ vi com.googlecode.iterm2.plist |
Exporting password + one-time code data from iCloud Keychain is now officially supported in macOS Monterey and Safari 15 (for Monterey, Big Sur, and Catalina). You can access it in the Password Manager’s “gear” icon (System Preferences > Passwords on Monterey, and Safari > Passwords everywhere else), or via the File > Export > Passwords... menu item). You shouldn't need to hack up your own exporter anymore.
After my dad died, I wanted to be able to have access any of his online accounts going forward. My dad was a Safari user and used iCloud Keychain to sync his credentials across his devices. I don’t want to have to keep an OS X user account around just to access his accounts, so I wanted to export his credentials to a portable file.
(defun my-select-bottom-window () | |
(let ((bottom-window (selected-window)) | |
window-below) | |
(while (setq window-below (window-in-direction 'below bottom-window)) | |
(setq bottom-window window-below)) | |
(select-window bottom-window))) | |
(defun my-compilation-hook () | |
(when (not (get-buffer-window "*compilation*")) | |
(save-selected-window |