diff --git a/.gitignore b/.gitignore index 5ce13dd..0723236 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ _set_env.sh log cn.sh __pycache__ +Makefile diff --git a/cursor/install-remote.sh b/cursor/install-remote.sh new file mode 100644 index 0000000..0ac3d46 --- /dev/null +++ b/cursor/install-remote.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +set -e +set -x + +# 设置环境变量 +export CURSOR_VERSION= +export CURSOR_COMMIT= +export REMOTE_ARCH="x64" # or arm64 +export REMOTE_OS="linux" + +# 创建目录结构 +mkdir -p ${HOME}/.cursor-server/cli/servers/Stable-${CURSOR_COMMIT}/server/ + +# 下载并解压第一个压缩包 (cli-alpine) +CLI_URL="https://cursor.blob.core.windows.net/remote-releases/${CURSOR_COMMIT}/cli-alpine-${REMOTE_ARCH}.tar.gz" +curl -L "${CLI_URL}" -o ${HOME}/.cursor-server/cursor-cli.tar.gz +tar -xzf ${HOME}/.cursor-server/cursor-cli.tar.gz -C ${HOME}/.cursor-server/ +mv ${HOME}/.cursor-server/cursor ${HOME}/.cursor-server/cursor-$CURSOR_COMMIT + +# 下载并解压第二个压缩包 (vscode-reh) +VSCODE_URL="https://cursor.blob.core.windows.net/remote-releases/${CURSOR_VERSION}-${CURSOR_COMMIT}/vscode-reh-${REMOTE_OS}-${REMOTE_ARCH}.tar.gz" +curl -L "${VSCODE_URL}" -o ${HOME}/.cursor-server/cursor-vscode-server.tar.gz +tar -xzf ${HOME}/.cursor-server/cursor-vscode-server.tar.gz -C ${HOME}/.cursor-server/cli/servers/Stable-${CURSOR_COMMIT}/server/ --strip-components=1 + +echo "Cursor server installation completed!" \ No newline at end of file diff --git a/fish/completions/ff.fish b/fish/completions/ff.fish index fd252c8..7d26901 100644 --- a/fish/completions/ff.fish +++ b/fish/completions/ff.fish @@ -1,13 +1,14 @@ # Completions for ff command complete -c ff -f -set -l ff_subcommands reload edit cd pon poff pst make script help +set -l ff_subcommands reload edit pon poff pst make script help complete -c ff -n "not __fish_seen_subcommand_from $ff_subcommands" -a "reload" -d "Reload fish configuration" complete -c ff -n "not __fish_seen_subcommand_from $ff_subcommands" -a "edit" -d "Edit custom fish configuration" -complete -c ff -n "not __fish_seen_subcommand_from $ff_subcommands" -a "cd" -d "Change to fish config directory" +complete -c ff -n "not __fish_seen_subcommand_from $ff_subcommands" -a "fish" -d "Change to fish config directory" +complete -c ff -n "not __fish_seen_subcommand_from $ff_subcommands" -a "dotfile" -d "Change to dotfile directory" complete -c ff -n "not __fish_seen_subcommand_from $ff_subcommands" -a "pon" -d "Enable proxy (proxy on)" complete -c ff -n "not __fish_seen_subcommand_from $ff_subcommands" -a "poff" -d "Disable proxy (proxy off)" complete -c ff -n "not __fish_seen_subcommand_from $ff_subcommands" -a "pst" -d "Show proxy status" -complete -c ff -n "not __fish_seen_subcommand_from $ff_subcommands" -a "make" -d "Run dotfile Makefile commands" +# complete -c ff -n "not __fish_seen_subcommand_from $ff_subcommands" -a "make" -d "Run dotfile Makefile commands" complete -c ff -n "not __fish_seen_subcommand_from $ff_subcommands" -a "script" -d "Run script from script directory" complete -c ff -n "not __fish_seen_subcommand_from $ff_subcommands" -a "help" -d "Show this help message" @@ -32,13 +33,6 @@ complete -c ff -n "not __fish_seen_subcommand_from $ff_subcommands" -a "help" -d # complete -c ff -n "__fish_seen_subcommand_from make" -a "cursor-init" -d "Initialize Cursor config" # complete -c ff -n "__fish_seen_subcommand_from make" -a "init-default-user" -d "Initialize default user (sudo)" -# Clean scripts -complete -c ff -n "__fish_seen_subcommand_from make" -a "brew-clean" -d "Clean Homebrew cache" -complete -c ff -n "__fish_seen_subcommand_from make" -a "docker-clean" -d "Clean Docker resources" - -# Utils -complete -c ff -n "__fish_seen_subcommand_from make" -a "croncheck" -d "Check cron status" - # script 子命令的补全 - 动态列出 script 目录下的脚本 function __ff_list_scripts set -l script_dir ~/.dotfile/script diff --git a/fish/config.fish b/fish/config.fish index 9022cba..c38ad4b 100644 --- a/fish/config.fish +++ b/fish/config.fish @@ -59,12 +59,12 @@ set -gx HOMEBREW_BOTTLE_DOMAIN "https://mirrors.ustc.edu.cn/homebrew-bottles" set -gx GOPATH $HOME/go:$HOME/workrepo/go set -gx GOPROXY "goproxy.cn,direct" set -gx GOSUMDB "sum.golang.google.cn" +set -gx EDITOR vim add_to_path $HOME/go/bin add_to_path $HOME/.yarn/bin $HOME/.config/yarn/global/node_modules/.bin - -################################################################# -# node -add_to_path /usr/local/node/bin +function gtr + go test -gcflags=all=-l -v -run=$argv +end ################################################################# # python @@ -77,11 +77,22 @@ end add_to_path $PYENV_ROOT/bin ################################################################# -# nvim -add_to_path usr/local/nvim/bin /usr/local/osx-64/nvim/bin -set -gx EDITOR vim -function gtr - go test -gcflags=all=-l -v -run=$argv +# node +# add_to_path /usr/local/node/bin +# add_to_path usr/local/nvim/bin /usr/local/osx-64/nvim/bin + +# fnm +set FNM_PATH "$HOME/.local/share/fnm" +if [ -d "$FNM_PATH" ] + set PATH "$FNM_PATH" $PATH + alias nvm="fnm" + fnm env --use-on-cd --shell fish | source +end + +# pnpm +set -gx PNPM_HOME $HOME/.pnpm +if not string match -q -- $PNPM_HOME $PATH + set -gx PATH "$PNPM_HOME" $PATH end ################################################################# @@ -166,17 +177,3 @@ end # Added by OrbStack: command-line tools and integration # This won't be added again if you remove it. source ~/.orbstack/shell/init2.fish 2>/dev/null || : - -# pnpm -set -gx PNPM_HOME $HOME/.pnpm -if not string match -q -- $PNPM_HOME $PATH - set -gx PATH "$PNPM_HOME" $PATH -end -# pnpm end - - -############################################################ -if is_command_exists fnm - alias nvm="fnm" - fnm env --use-on-cd --shell fish | source -end diff --git a/script/mihomo-install.sh b/script/mihomo-install.sh index 218ab42..acb3769 100644 --- a/script/mihomo-install.sh +++ b/script/mihomo-install.sh @@ -1,5 +1,5 @@ #!/bin/bash -source ./script/common/os-arch.sh +source $HOME/.dotfile/script/common/os-arch.sh # 检查并安装 gunzip function check_gunzip() { @@ -23,13 +23,6 @@ function install_mihomo() { local base_url="https://oss-default.yumee.top/bin/mihomo" local url="" - # 根据不同平台设置下载 URL - # 支持的平台示例: - # darwin-amd64: https://oss-default.yumee.top/bin/mihomo/mihomo-darwin-amd64.gz - # darwin-arm64: https://oss-default.yumee.top/bin/mihomo/mihomo-darwin-arm64.gz - # linux-amd64: https://oss-default.yumee.top/bin/mihomo/mihomo-linux-amd64.gz - # linux-arm64: https://oss-default.yumee.top/bin/mihomo/mihomo-linux-arm64.gz - case $os_arch in "darwin-amd64"|"darwin-arm64"|"linux-amd64"|"linux-arm64") url="${base_url}/mihomo-${os_arch}.gz" diff --git a/script/nvm-install.sh b/script/nvm-install.sh index f90de09..4bf7cd0 100644 --- a/script/nvm-install.sh +++ b/script/nvm-install.sh @@ -1,4 +1,9 @@ #!/bin/bash # https://github.com/Schniz/fnm -curl -fsSL https://fnm.vercel.app/install | bash \ No newline at end of file +curl -fsSL https://fnm.vercel.app/install | bash + +ff reload + +# after install node +# corepack enable pnpm \ No newline at end of file diff --git a/vscode/settings.json b/vscode/settings.json index 3bee7bb..89de09e 100644 --- a/vscode/settings.json +++ b/vscode/settings.json @@ -160,7 +160,8 @@ "remote.SSH.useLocalServer": false, "remote.SSH.connectTimeout": 30, "remote.SSH.remotePlatform": { - "box1": "linux" + "box1": "linux", + "hx80": "linux" }, "editor.formatOnSave": true, "pylint.enabled": false, @@ -267,5 +268,6 @@ "git.confirmSync": false, "editor.dropIntoEditor.preferences": [], "whichkey.bindingOverrides": [], - "cursor.general.disableHttp2": true + "cursor.general.disableHttp2": true, + "remote.SSH.localServerDownload": "always" }