diff --git a/.gitignore b/.gitignore index 93c06d7..8090e0e 100644 --- a/.gitignore +++ b/.gitignore @@ -15,13 +15,6 @@ test.* # Utils xdg-ninja/ -# IPython config cache -tools/ipython/profile_default/db -tools/ipython/profile_default/log -tools/ipython/profile_default/pid -tools/ipython/profile_default/security -tools/ipython/profile_default/history.sqlite - # nvim config cache tools/nvim/tt.* tools/nvim/.tests diff --git a/.vscode/settings.json b/.vscode/settings.json index 1177b9b..a249144 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -13,10 +13,14 @@ "nvim/init.lua": "vim", "markdownlint.json": "markdownlint", ".wslconfig": "settings", - "*.hsnips": "" }, "material-icon-theme.folders.associations": { - "bootstrap": "admin" + "bootstrap": "admin", + "ipython": "jupyter", + "zsh": "command", + "starship": "ui", + "nvim": "config", + "wsl": "linux" }, "files.associations": { "ideavimrc": "Vimscript", diff --git a/bootstrap/win_setup.ps1 b/bootstrap/Windows.ps1 similarity index 100% rename from bootstrap/win_setup.ps1 rename to bootstrap/Windows.ps1 diff --git a/bootstrap/mac_setup.sh b/bootstrap/macOS.zsh similarity index 97% rename from bootstrap/mac_setup.sh rename to bootstrap/macOS.zsh index 62b9976..ef55894 100644 --- a/bootstrap/mac_setup.sh +++ b/bootstrap/macOS.zsh @@ -1,8 +1,7 @@ -#! /bin/sh -# This script is used to setup a new mac -# In a new mac (Sequoia) -# Enter the following command in the terminal -#! curl -fsSL https://raw.githubusercontent.com/js0ny/dotfiles/refs/heads/master/setup/mac_setup.sh | sh # Do not use this command +#! /bin/zsh +# $DOTFILES/bootstrap/macOS.zsh +# Run this script to set up macOS +# 运行此脚本以设置 macOS echo "Running the setup script" @@ -11,6 +10,9 @@ echo "[INFO] Installing Xcode Command Line Tools" echo "[ACTION] Request Human Takeover" xcode-select --install +# Press any key to continue (if Xcode Command Line Tools are installed) +read -n 1 -s -r -p "Press any key to continue when xcode CLI tools are installed" + # System Preferences # Installation Sources echo "[INFO] Setting Installation Sources" diff --git a/bootstrap/set_symblink_unix.bash b/bootstrap/set_symblink_unix.bash new file mode 100644 index 0000000..eef5d91 --- /dev/null +++ b/bootstrap/set_symblink_unix.bash @@ -0,0 +1,24 @@ +#! /bin/bash +mkdir -p $XDG_CONFIG_HOME/conda $XDG_CONFIG_HOME/git $XDG_CONFIG_HOME/ideavim $XDG_CONFIG_HOME/markdownlint $XDG_CONFIG_HOME/pip $XDG_CONFIG_HOME/neovide $XDG_CONFIG_HOME/powershell $XDG_CONFIG_HOME/vscode $XDG_CONFIG_HOME/NuGet $XDG_CONFIG_HOME/vim $XDG_CONFIG_HOME/tmux $XDG_CONFIG_HOME/npm $XDG_CONFIG_HOME/readline $XDG_CONFIG_HOME/ipython +mkdir -p ~/.config/zellij # Not support XDG_CONFIG_HOME but same directory +# mkdir -p $WAKATIME_HOME +# mkdir -p $XDG_STATE_HOME/vim/undo $XDG_STATE_HOME/vim/backup $XDG_STATE_HOME/vim/swap $XDG_STATE_HOME/vim/view +mkdir -p $HOME/Obsidian +# $DOTFILES/common +ln -sf $DOTFILES/common/condarc.yaml $XDG_CONFIG_HOME/conda/.condarc +ln -sf $DOTFILES/common/gitconfig $XDG_CONFIG_HOME/git/config +ln -sf $DOTFILES/common/glow.yaml ~/.config/glow/config.yml +ln -sf $DOTFILES/common/haskeline ~/.haskeline +ln -sf $DOTFILES/common/ideavimrc $XDG_CONFIG_HOME/ideavim/ideavimrc +ln -sf $DOTFILES/common/inputrc $XDG_CONFIG_HOME/readline/inputrc +ln -sf $DOTFILES/common/lesskey $XDG_CONFIG_HOME/lesskey +ln -sf $DOTFILES/common/npmrc $NPM_CONFIG_USERCONFIG +ln -sf $DOTFILES/common/NuGet.Config $XDG_CONFIG_HOME/NuGet/NuGet.Config +ln -sf $DOTFILES/common/obsidian.vimrc $HOME/Obsidian/.obsidian.vimrc +ln -sf $DOTFILES/common/pip.conf $XDG_CONFIG_HOME/pip/pip.conf +ln -sf $DOTFILES/common/tmux.conf $XDG_CONFIG_HOME/tmux/tmux.conf +ln -sf $DOTFILES/common/vimrc $XDG_CONFIG_HOME/vim/vimrc +ln -sf $DOTFILES/common/zellij.config.kdl ~/.config/zellij/config.kdl +# $DOTFILES/tools +ln -sf $DOTFILES/tools/ipython $XDG_CONFIG_HOME/ipython +ln -sf $DOTFILES/tools/nvim $XDG_CONFIG_HOME/nvim diff --git a/bootstrap/set_symblink_unix.sh b/bootstrap/set_symblink_unix.sh deleted file mode 100644 index b68006a..0000000 --- a/bootstrap/set_symblink_unix.sh +++ /dev/null @@ -1,22 +0,0 @@ -#! /bin/sh -mkdir -p $XDG_CONFIG_HOME/conda $XDG_CONFIG_HOME/git $XDG_CONFIG_HOME/ideavim $XDG_CONFIG_HOME/markdownlint $XDG_CONFIG_HOME/pip $XDG_CONFIG_HOME/neovide $XDG_CONFIG_HOME/powershell $XDG_CONFIG_HOME/vscode $XDG_CONFIG_HOME/NuGet $XDG_CONFIG_HOME/vim $XDG_CONFIG_HOME/tmux $XDG_CONFIG_HOME/npm -mkdir -p ~/.config/zellij # Not support XDG_CONFIG_HOME but same directory -mkdir -p $WAKATIME_HOME -mkdir -p $XDG_STATE_HOME/vim/undo $XDG_STATE_HOME/vim/backup $XDG_STATE_HOME/vim/swap $XDG_STATE_HOME/vim/view -# $DOTFILES/.config -ln -sf $DOTFILES/.config/conda/condarc.yaml $XDG_CONFIG_HOME/conda/.condarc -ln -sf $DOTFILES/.config/git/.gitconfig $XDG_CONFIG_HOME/git/config -ln -sf $DOTFILES/.config/ideavim/ideavimrc.vimrc $XDG_CONFIG_HOME/ideavim/ideavimrc -ln -sf $DOTFILES/.config/markdownlint/.markdownlint.json $XDG_CONFIG_HOME/markdownlint/markdownlint.json -ln -sf $DOTFILES/.config/npm/npmrc $NPM_CONFIG_USERCONFIG -ln -sf $DOTFILES/.config/NuGet/NuGet.Config $XDG_CONFIG_HOME/NuGet/NuGet.Config -ln -sf $DOTFILES/.config/nvim/ $XDG_CONFIG_HOME/nvim -ln -sf $DOTFILES/.config/pip/pip.conf $XDG_CONFIG_HOME/pip/pip.conf -ln -sf $DOTFILES/.config/tmux/tmux.conf $XDG_CONFIG_HOME/tmux/tmux.conf -ln -sf $DOTFILES/.config/vim/vimrc $XDG_CONFIG_HOME/vim/vimrc -ln -sf $DOTFILES/.config/zellij/config.kdl ~/.config/zellij/config.kdl -ln -sf $DOTFILES/.config/lesskey $XDG_CONFIG_HOME/lesskey -# $DOTFILES/vscode -ln -sf $DOTFILES/vscode/vscode.vimrc $XDG_CONFIG_HOME/vscode.vimrc -# $DOTFILES root -ln -sf $DOTFILES/.haskeline ~/.haskeline \ No newline at end of file diff --git a/scripts/update.zsh b/scripts/update.zsh index ce4e5fd..b110e81 100644 --- a/scripts/update.zsh +++ b/scripts/update.zsh @@ -1,3 +1,4 @@ +#!/bin/zsh # $DOTFILES/scripts/update.zsh # call by `update` alias defined in tools/zsh/alias.zsh # 使用别名 `update` 引用,别名定义于 tools/zsh/alias.zsh diff --git a/tools/ipython/.gitignore b/tools/ipython/.gitignore new file mode 100644 index 0000000..6b49931 --- /dev/null +++ b/tools/ipython/.gitignore @@ -0,0 +1,6 @@ +# IPython config cache +*/db/ +*/log/ +*/pid/ +*/security/ +*/history.sqlite diff --git a/tools/ipython/profile_default/startup/README b/tools/ipython/profile_default/startup/README new file mode 100644 index 0000000..61d4700 --- /dev/null +++ b/tools/ipython/profile_default/startup/README @@ -0,0 +1,11 @@ +This is the IPython startup directory + +.py and .ipy files in this directory will be run *prior* to any code or files specified +via the exec_lines or exec_files configurables whenever you load this profile. + +Files will be run in lexicographical order, so you can control the execution order of files +with a prefix, e.g.:: + + 00-first.py + 50-middle.py + 99-last.ipy diff --git a/tools/ipython/profile_default/starup/README b/tools/ipython/profile_default/starup/README new file mode 100644 index 0000000..61d4700 --- /dev/null +++ b/tools/ipython/profile_default/starup/README @@ -0,0 +1,11 @@ +This is the IPython startup directory + +.py and .ipy files in this directory will be run *prior* to any code or files specified +via the exec_lines or exec_files configurables whenever you load this profile. + +Files will be run in lexicographical order, so you can control the execution order of files +with a prefix, e.g.:: + + 00-first.py + 50-middle.py + 99-last.ipy diff --git a/tools/ipython/profile_default/starup/magic_ps.py b/tools/ipython/profile_default/starup/magic_ps.py index 8800f71..351e003 100644 --- a/tools/ipython/profile_default/starup/magic_ps.py +++ b/tools/ipython/profile_default/starup/magic_ps.py @@ -2,7 +2,7 @@ from IPython.core.magic import register_line_magic @register_line_magic def ps(cmd): - output = get_ipython().getoutput(f"powershell -Command {cmd}") + output = get_ipython().getoutput(f"pwsh -NoProfile -Command {cmd}") # If no variable is assigned to the output, print it if get_ipython().last_execution_result is None: print("\n".join(output)) diff --git a/tools/zsh/mod/env.zsh b/tools/zsh/mod/env.zsh new file mode 100644 index 0000000..bf0ef34 --- /dev/null +++ b/tools/zsh/mod/env.zsh @@ -0,0 +1,8 @@ +# $DOTFILES/tools/zsh/mod/env.zsh +# Sourced by user's zshrc 在用户的 zshrc 中被引用 + +# This file stores only environment variables that only called by +# interactive session. +# 这个文件只存储只在交互式会话中调用的环境变量。 + +export IPYTHONDIR="$XDG_CONFIG_HOME"/ipython