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
# copyfile 函数 | |
# Copies the contents of a given file to the system or X Windows clipboard | |
# Usage: copyfile <file> | |
function copyfile { | |
emulate -L zsh | |
if [[ -z "$1" ]]; then | |
echo "Usage: copyfile <file>" | |
return 1 | |
fi |
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
# copypath 函数 | |
# Copies the path of given directory or file to the system or X Windows clipboard. | |
# Copy current directory if no parameter. | |
function copypath { | |
# If no argument passed, use current directory | |
local file="${1:-.}" | |
# If argument is not an absolute path, prepend $PWD | |
[[ $file = /* ]] || file="$PWD/$file" |
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
# Vi-mode 配置 - 精简版 | |
# https://github.com/ohmyzsh/ohmyzsh/blob/master/plugins/vi-mode/vi-mode.plugin.zsh | |
# 在没有 oh-my-zsh 的情况下提供 vi 模式支持 | |
# 是否在模式切换时强制重绘提示符 | |
# 设置为 "true" 强制重绘(可能导致延迟),默认为自动检测 | |
typeset -g VI_MODE_RESET_PROMPT_ON_MODE_CHANGE | |
# 是否在模式切换时改变光标样式 | |
# 设置为 "true" 启用光标形状变化,可以直观显示当前模式 |
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
#!name= Redirect Apple Maps to 🇺🇸US | |
#!desc=只作用于Apple Maps,不修改定位服务和地区检测,可以通过搭配使用其他模块达成混合效果。 | |
[URL Rewrite] | |
# Redirect Apple Maps to US | |
(^https?:\/\/gspe\d*-ssl\.ls\.apple\.)(com|cn)(\/.*)(country_code=[A-Z]{2})(.*) $1$2$3country_code=US$5 header | |
(^https?:\/\/gspe\d*-ssl\.ls\.apple\.)(com|cn)(\/.*)(environment=[a-z/-]{4,})(.*) $1$2$3environment=prod$5 header | |
[MITM] | |
hostname = %APPEND% gspe35-ssl.ls.apple.com |