diff --git a/cursor/config/keybindings.json b/cursor/config/keybindings.json index a898bfa..6776f28 100644 --- a/cursor/config/keybindings.json +++ b/cursor/config/keybindings.json @@ -2,60 +2,60 @@ [ { "key": "alt+cmd+left", - "command": "workbench.action.navigateBack" + "command": "workbench.action.navigateBack", }, { "key": "alt+cmd+right", - "command": "workbench.action.navigateForward" + "command": "workbench.action.navigateForward", }, { "key": "alt+cmd+l", "command": "editor.action.formatSelection", - "when": "editorHasDocumentFormattingProvider && editorHasSelection && editorTextFocus && !editorReadonly" + "when": "editorHasDocumentFormattingProvider && editorHasSelection && editorTextFocus && !editorReadonly", }, { "key": "cmd+k m", "command": "-workbench.action.editor.changeLanguageMode", - "when": "!notebookEditorFocused" + "when": "!notebookEditorFocused", }, { "key": "ctrl+j", "command": "selectNextSuggestion", - "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus || suggestWidgetVisible && textInputFocus && !suggestWidgetHasFocusedSuggestion" + "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus || suggestWidgetVisible && textInputFocus && !suggestWidgetHasFocusedSuggestion", }, { "key": "ctrl+n", "command": "-selectNextSuggestion", - "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus || suggestWidgetVisible && textInputFocus && !suggestWidgetHasFocusedSuggestion" + "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus || suggestWidgetVisible && textInputFocus && !suggestWidgetHasFocusedSuggestion", }, { "key": "ctrl+k", "command": "-deleteAllRight", - "when": "textInputFocus && !editorReadonly" + "when": "textInputFocus && !editorReadonly", }, { "key": "ctrl+k", "command": "selectPrevSuggestion", - "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus || suggestWidgetVisible && textInputFocus && !suggestWidgetHasFocusedSuggestion" + "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus || suggestWidgetVisible && textInputFocus && !suggestWidgetHasFocusedSuggestion", }, { "key": "ctrl+p", "command": "-selectPrevSuggestion", - "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus || suggestWidgetVisible && textInputFocus && !suggestWidgetHasFocusedSuggestion" + "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus || suggestWidgetVisible && textInputFocus && !suggestWidgetHasFocusedSuggestion", }, { "key": "cmd+i", - "command": "composerMode.agent" + "command": "composerMode.agent", }, { "key": "space", "command": "vspacecode.space", - "when": "activeEditorGroupEmpty && focusedView == '' && !whichkeyActive && !inputFocus" + "when": "activeEditorGroupEmpty && focusedView == '' && !whichkeyActive && !inputFocus", }, { "key": "space", "command": "vspacecode.space", - "when": "sideBarFocus && !inputFocus && !whichkeyActive" + "when": "sideBarFocus && !inputFocus && !whichkeyActive", }, // { // "key": "tab", @@ -70,197 +70,222 @@ { "key": "x", "command": "magit.discard-at-point", - "when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/" + "when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/", }, { "key": "k", - "command": "-magit.discard-at-point" + "command": "-magit.discard-at-point", }, { "key": "-", "command": "magit.reverse-at-point", - "when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/" + "when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/", }, { "key": "v", - "command": "-magit.reverse-at-point" + "command": "-magit.reverse-at-point", }, { "key": "shift+-", "command": "magit.reverting", - "when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/" + "when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/", }, { "key": "shift+v", - "command": "-magit.reverting" + "command": "-magit.reverting", }, { "key": "shift+o", "command": "magit.resetting", - "when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/" + "when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/", }, { "key": "shift+x", - "command": "-magit.resetting" + "command": "-magit.resetting", }, { "key": "x", - "command": "-magit.reset-mixed" + "command": "-magit.reset-mixed", }, { "key": "ctrl+u x", - "command": "-magit.reset-hard" + "command": "-magit.reset-hard", }, { "key": "y", - "command": "-magit.show-refs" + "command": "-magit.show-refs", }, { "key": "y", "command": "vspacecode.showMagitRefMenu", - "when": "editorTextFocus && editorLangId == 'magit' && vim.mode == 'Normal'" + "when": "editorTextFocus && editorLangId == 'magit' && vim.mode == 'Normal'", }, { "key": "g", "command": "-magit.refresh", - "when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/" + "when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/", }, { "key": "g", "command": "vspacecode.showMagitRefreshMenu", - "when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/" + "when": "editorTextFocus && editorLangId == 'magit' && vim.mode =~ /^(?!SearchInProgressMode|CommandlineInProgress).*$/", }, { "key": "ctrl+j", "command": "workbench.action.quickOpenSelectNext", - "when": "inQuickOpen" + "when": "inQuickOpen", }, { "key": "ctrl+k", "command": "workbench.action.quickOpenSelectPrevious", - "when": "inQuickOpen" + "when": "inQuickOpen", }, { "key": "ctrl+j", "command": "selectNextSuggestion", - "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus" + "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus", }, { "key": "ctrl+k", "command": "selectPrevSuggestion", - "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus" + "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus", }, { "key": "ctrl+l", "command": "acceptSelectedSuggestion", - "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus" + "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus", }, { "key": "ctrl+j", "command": "showNextParameterHint", - "when": "editorFocus && parameterHintsMultipleSignatures && parameterHintsVisible" + "when": "editorFocus && parameterHintsMultipleSignatures && parameterHintsVisible", }, { "key": "ctrl+k", "command": "showPrevParameterHint", - "when": "editorFocus && parameterHintsMultipleSignatures && parameterHintsVisible" + "when": "editorFocus && parameterHintsMultipleSignatures && parameterHintsVisible", }, { "key": "ctrl+j", "command": "selectNextCodeAction", - "when": "codeActionMenuVisible" + "when": "codeActionMenuVisible", }, { "key": "ctrl+k", "command": "selectPrevCodeAction", - "when": "codeActionMenuVisible" + "when": "codeActionMenuVisible", }, { "key": "ctrl+l", "command": "acceptSelectedCodeAction", - "when": "codeActionMenuVisible" + "when": "codeActionMenuVisible", }, // Quick Navigation for file browser { "key": "ctrl+h", "command": "file-browser.stepOut", - "when": "inFileBrowser" + "when": "inFileBrowser", }, { "key": "ctrl+l", "command": "file-browser.stepIn", - "when": "inFileBrowser" + "when": "inFileBrowser", }, { "key": "ctrl+h", "command": "workbench.action.navigateLeft", - "when": "!inQuickOpen && !suggestWidgetVisible && !parameterHintsVisible && !isInDiffEditor" + "when": "!inQuickOpen && !suggestWidgetVisible && !parameterHintsVisible && !isInDiffEditor", }, { "key": "ctrl+j", "command": "workbench.action.navigateDown", - "when": "!codeActionMenuVisible && !inQuickOpen && !suggestWidgetVisible && !parameterHintsVisible" + "when": "!codeActionMenuVisible && !inQuickOpen && !suggestWidgetVisible && !parameterHintsVisible", }, { "key": "ctrl+k", "command": "workbench.action.navigateUp", - "when": "!codeActionMenuVisible && !inQuickOpen && !suggestWidgetVisible && !parameterHintsVisible" + "when": "!codeActionMenuVisible && !inQuickOpen && !suggestWidgetVisible && !parameterHintsVisible", }, { "key": "ctrl+l", "command": "workbench.action.navigateRight", - "when": "!codeActionMenuVisible && !inQuickOpen && !suggestWidgetVisible && !parameterHintsVisible && !isInDiffEditor" + "when": "!codeActionMenuVisible && !inQuickOpen && !suggestWidgetVisible && !parameterHintsVisible && !isInDiffEditor", }, // Quick Navigation for diff view { "key": "ctrl+h", "command": "workbench.action.compareEditor.focusSecondarySide", - "when": "isInDiffEditor && !isInDiffLeftEditor" + "when": "isInDiffEditor && !isInDiffLeftEditor", }, { "key": "ctrl+h", "command": "workbench.action.navigateLeft", - "when": "isInDiffEditor && isInDiffLeftEditor" + "when": "isInDiffEditor && isInDiffLeftEditor", }, { "key": "ctrl+l", "command": "workbench.action.compareEditor.focusPrimarySide", - "when": "isInDiffEditor && isInDiffLeftEditor" + "when": "isInDiffEditor && isInDiffLeftEditor", }, { "key": "ctrl+l", "command": "workbench.action.navigateRight", - "when": "isInDiffEditor && !isInDiffLeftEditor" + "when": "isInDiffEditor && !isInDiffLeftEditor", }, { "key": "ctrl+l", "command": "workbench.action.terminal.clear", - "when": "terminalFocus && terminalHasBeenCreated && !accessibilityModeEnabled || terminalFocus && terminalProcessSupported && !accessibilityModeEnabled || accessibilityModeEnabled && accessibleViewIsShown && terminalHasBeenCreated && accessibleViewCurrentProviderId == 'terminal' || accessibilityModeEnabled && accessibleViewIsShown && terminalProcessSupported && accessibleViewCurrentProviderId == 'terminal'" + "when": "terminalFocus && terminalHasBeenCreated && !accessibilityModeEnabled || terminalFocus && terminalProcessSupported && !accessibilityModeEnabled || accessibilityModeEnabled && accessibleViewIsShown && terminalHasBeenCreated && accessibleViewCurrentProviderId == 'terminal' || accessibilityModeEnabled && accessibleViewIsShown && terminalProcessSupported && accessibleViewCurrentProviderId == 'terminal'", }, { "key": "cmd+k", "command": "-workbench.action.terminal.clear", - "when": "terminalFocus && terminalHasBeenCreated && !accessibilityModeEnabled || terminalFocus && terminalProcessSupported && !accessibilityModeEnabled || accessibilityModeEnabled && accessibleViewIsShown && terminalHasBeenCreated && accessibleViewCurrentProviderId == 'terminal' || accessibilityModeEnabled && accessibleViewIsShown && terminalProcessSupported && accessibleViewCurrentProviderId == 'terminal'" + "when": "terminalFocus && terminalHasBeenCreated && !accessibilityModeEnabled || terminalFocus && terminalProcessSupported && !accessibilityModeEnabled || accessibilityModeEnabled && accessibleViewIsShown && terminalHasBeenCreated && accessibleViewCurrentProviderId == 'terminal' || accessibilityModeEnabled && accessibleViewIsShown && terminalProcessSupported && accessibleViewCurrentProviderId == 'terminal'", }, { "key": "space", "command": "vspacecode.space", - "when": "terminalFocus && terminalHasBeenCreated && !accessibilityModeEnabled || terminalFocus && terminalProcessSupported && !accessibilityModeEnabled || accessibilityModeEnabled && accessibleViewIsShown && terminalHasBeenCreated && accessibleViewCurrentProviderId == 'terminal' || accessibilityModeEnabled && accessibleViewIsShown && terminalProcessSupported && accessibleViewCurrentProviderId == 'terminal'" + "when": "terminalFocus && terminalHasBeenCreated && !accessibilityModeEnabled || terminalFocus && terminalProcessSupported && !accessibilityModeEnabled || accessibilityModeEnabled && accessibleViewIsShown && terminalHasBeenCreated && accessibleViewCurrentProviderId == 'terminal' || accessibilityModeEnabled && accessibleViewIsShown && terminalProcessSupported && accessibleViewCurrentProviderId == 'terminal'", }, { "key": "ctrl+o", "command": "workbench.action.navigateBack", - "when": "canNavigateBack" + "when": "canNavigateBack", }, { "key": "ctrl+-", "command": "-workbench.action.navigateBack", - "when": "canNavigateBack" + "when": "canNavigateBack", }, { "key": "ctrl+o", "command": "-lineBreakInsert", - "when": "textInputFocus && !editorReadonly" - } + "when": "textInputFocus && !editorReadonly", + }, + { + "key": "ctrl+\\", + "command": "-glass.openActionMenu", + "when": "isGlassAgentWorkspace && glassActiveTabKind == 'diff'", + }, + { + "key": "ctrl+\\", + "command": "-glass.openPlanBuildMenu", + "when": "isGlassAgentWorkspace && glassActiveTabKind == 'plan'", + }, + { + "key": "ctrl+cmd+i", + "command": "-workbench.panel.chat", + "when": "workbench.panel.chat.view.copilot.active", + }, + { + "key": "ctrl+\\", + "command": "workbench.action.toggleAgentsFromKeyboard", + "when": "!isAuxiliaryWindowFocusedContext && !isGlass", + }, + { + "key": "alt+cmd+j", + "command": "-workbench.action.toggleAgentsFromKeyboard", + "when": "!isAuxiliaryWindowFocusedContext && !isGlass", + }, ] diff --git a/cursor/config/settings.json b/cursor/config/settings.json index 1d23633..4b8ca9b 100644 --- a/cursor/config/settings.json +++ b/cursor/config/settings.json @@ -285,4 +285,5 @@ "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": 1, }, "claudeCode.preferredLocation": "panel", + "window.autoDetectColorScheme": false, } diff --git a/script/bigfiles.sh b/script/bigfiles.sh deleted file mode 100644 index 31f3661..0000000 --- a/script/bigfiles.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# 检查是否输入了目录参数,如果没有,默认使用当前目录 -TARGET_DIR=${1:-"."} - -echo "--- 正在扫描目录: $TARGET_DIR ---" -echo "--- 正在查找最大的 10 个文件/文件夹 ---" -echo "----------------------------------------" - -# 执行查找逻辑 -# -d 1: 只查看当前目录层级(不展开子目录的所有细碎文件) -# -h: 以人类可读格式显示 (K, M, G) -# sort -rh: 按人类可读的数字反向排序 (需要支持 -h 的 sort,Mac/Linux 通用) -# head -n 10: 取前 10 名 - -if [[ "$OSTYPE" == "darwin"* ]]; then - # Mac (BSD 版本的 du 略有不同) - du -sh "$TARGET_DIR"/* | sort -rh | head -n 10 -else - # Linux (GNU 版本) - du -sh "$TARGET_DIR"/* --max-depth=1 2>/dev/null | sort -rh | head -n 10 -fi - -echo "----------------------------------------" -echo "扫描完成。" diff --git a/script/dirsize.sh b/script/dirsize.sh new file mode 100755 index 0000000..73a59c1 --- /dev/null +++ b/script/dirsize.sh @@ -0,0 +1,77 @@ +#!/bin/bash + +set -euo pipefail + +usage() { + cat <<'EOF' +用法: dirsize [选项] [目录] + +查询目录大小,默认扫描当前目录的直接子目录。 + +选项: + -a, --all 递归显示所有子目录的大小 + -d, --depth N 指定递归深度 (默认 1) + -n, --top N 只显示前 N 名 (默认全部) + -r, --reverse 按从小到大排序 (默认从大到小) + -h, --help 显示帮助信息 + +示例: + dirsize 当前目录的直接子目录大小 + dirsize -n 10 当前目录的直接子目录,取前 10 名 + dirsize -a 递归显示所有子目录 + dirsize -d 2 -n 5 深度 2,取前 5 名 + dirsize -n 5 /var/log 查看 /var/log 的子目录,取前 5 名 +EOF + exit 0 +} + +DEPTH=1 +TOP=0 +REVERSE=false +ALL=false +TARGET_DIR="." + +while [[ $# -gt 0 ]]; do + case "$1" in + -a|--all) ALL=true; shift ;; + -d|--depth) DEPTH="$2"; shift 2 ;; + -n|--top) TOP="$2"; shift 2 ;; + -r|--reverse) REVERSE=true; shift ;; + -h|--help) usage ;; + -*) echo "未知选项: $1" >&2; usage ;; + *) TARGET_DIR="$1"; shift ;; + esac +done + +if [[ ! -d "$TARGET_DIR" ]]; then + echo "错误: '$TARGET_DIR' 不是有效目录" >&2 + exit 1 +fi + +TARGET_DIR="${TARGET_DIR%/}" + +if $ALL; then + DEPTH=999 +fi + +sort_flag="-rh" +if $REVERSE; then + sort_flag="-h" +fi + +if [[ "$OSTYPE" == "darwin"* ]]; then + result=$(du -h -d "$DEPTH" "$TARGET_DIR" 2>/dev/null | grep -v "^.*${TARGET_DIR}$" | sort $sort_flag) +else + result=$(du -h --max-depth="$DEPTH" "$TARGET_DIR" 2>/dev/null | grep -v "^.*${TARGET_DIR}$" | sort $sort_flag) +fi + +if [[ "$TOP" -gt 0 ]]; then + result=$(echo "$result" | head -n "$TOP") +fi + +if [[ -z "$result" ]]; then + echo "目录为空或无子目录" + exit 0 +fi + +echo "$result" diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index d27018e..5996ccf 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -54,6 +54,10 @@ set -g set-titles on #set-option -g set-titles-string "#{session_name} - #{host}" set -g set-titles-string "#{session_name}" +#允许终端程序通过转义序列设置通知 +set -s set-clipboard on +set -g allow-passthrough on + # List of plugins set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-sensible'