aboutsummaryrefslogtreecommitdiffstats
path: root/dotfiles
diff options
context:
space:
mode:
Diffstat (limited to 'dotfiles')
-rw-r--r--dotfiles/bash/.bashrc5
-rw-r--r--dotfiles/cargo/.cargo/config.toml10
-rw-r--r--dotfiles/git/.gitconfig4
-rw-r--r--dotfiles/mpv/.config/haruna/custom-commands.conf7
-rw-r--r--dotfiles/mpv/.config/mpv/scripts/embedded-lyrics.lua28
5 files changed, 54 insertions, 0 deletions
diff --git a/dotfiles/bash/.bashrc b/dotfiles/bash/.bashrc
index 0826f83..c34e43a 100644
--- a/dotfiles/bash/.bashrc
+++ b/dotfiles/bash/.bashrc
@@ -17,6 +17,11 @@ export RUSTUP_DIST_SERVER=https://mirror.nju.edu.cn/rustup
eval "$(fnm env --use-on-cd)"
+bind '"\e[A": history-search-backward'
+bind '"\e[B": history-search-forward'
+bind '"\eOA": history-search-backward'
+bind '"\eOB": history-search-forward'
+
# # pnpm
# export PNPM_HOME='/home/shu/.local/share/pnpm'
# case ":$PATH:" in
diff --git a/dotfiles/cargo/.cargo/config.toml b/dotfiles/cargo/.cargo/config.toml
new file mode 100644
index 0000000..a6f0783
--- /dev/null
+++ b/dotfiles/cargo/.cargo/config.toml
@@ -0,0 +1,10 @@
+[source.crates-io]
+replace-with = 'mirror'
+
+[source.mirror]
+registry = "sparse+https://mirrors.cernet.edu.cn/crates.io-index/"
+
+[registries.mirror]
+index = "sparse+https://mirrors.cernet.edu.cn/crates.io-index/"
+
+# 参考 https://help.mirrors.cernet.edu.cn/crates.io-index/ \ No newline at end of file
diff --git a/dotfiles/git/.gitconfig b/dotfiles/git/.gitconfig
index a675a80..4d36f82 100644
--- a/dotfiles/git/.gitconfig
+++ b/dotfiles/git/.gitconfig
@@ -14,3 +14,7 @@
conflictStyle = zdiff3
[alias]
l = log --oneline
+[pull]
+ rebase = true
+[http "https://github.com"]
+ proxy = socks5h://127.0.0.1:1080
diff --git a/dotfiles/mpv/.config/haruna/custom-commands.conf b/dotfiles/mpv/.config/haruna/custom-commands.conf
new file mode 100644
index 0000000..bc4890d
--- /dev/null
+++ b/dotfiles/mpv/.config/haruna/custom-commands.conf
@@ -0,0 +1,7 @@
+Counter=1
+
+[Command_0]
+Command=load-script "~/.config/mpv/scripts/embedded-lyrics.lua"
+Order=0
+OsdMessage=
+Type=startup
diff --git a/dotfiles/mpv/.config/mpv/scripts/embedded-lyrics.lua b/dotfiles/mpv/.config/mpv/scripts/embedded-lyrics.lua
new file mode 100644
index 0000000..9b9a705
--- /dev/null
+++ b/dotfiles/mpv/.config/mpv/scripts/embedded-lyrics.lua
@@ -0,0 +1,28 @@
+-- embedded-lyrics.lua
+-- 尝试将音频文件内嵌的 LYRICS 标签作为字幕加载
+
+local function load_embedded_lyrics()
+ local lyrics = mp.get_property("metadata/by-key/LYRICS")
+
+ if not lyrics or lyrics == "" then
+ mp.msg.warn("未找到内嵌的 LYRICS 标签")
+ return
+ end
+
+ -- 创建一个临时文件来存放歌词
+ local tmp_path = os.tmpname() .. ".lrc"
+ local file = io.open(tmp_path, "w")
+ if not file then
+ mp.msg.error("无法创建临时文件")
+ return
+ end
+ file:write(lyrics)
+ file:close()
+
+ -- 加载为字幕
+ mp.commandv("sub-add", tmp_path, "select")
+ mp.msg.info("已从元数据加载内嵌歌词")
+end
+
+-- 当文件加载完成时触发
+mp.register_event("file-loaded", load_embedded_lyrics)