mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 08:43:00 +00:00
feat(zsh, ipython): New symblink scripts, IPython linked with directory
This commit is contained in:
parent
fdf460a547
commit
f69dc967e0
12 changed files with 75 additions and 37 deletions
7
.gitignore
vendored
7
.gitignore
vendored
|
|
@ -15,13 +15,6 @@ test.*
|
||||||
# Utils
|
# Utils
|
||||||
xdg-ninja/
|
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
|
# nvim config cache
|
||||||
tools/nvim/tt.*
|
tools/nvim/tt.*
|
||||||
tools/nvim/.tests
|
tools/nvim/.tests
|
||||||
|
|
|
||||||
8
.vscode/settings.json
vendored
8
.vscode/settings.json
vendored
|
|
@ -13,10 +13,14 @@
|
||||||
"nvim/init.lua": "vim",
|
"nvim/init.lua": "vim",
|
||||||
"markdownlint.json": "markdownlint",
|
"markdownlint.json": "markdownlint",
|
||||||
".wslconfig": "settings",
|
".wslconfig": "settings",
|
||||||
"*.hsnips": ""
|
|
||||||
},
|
},
|
||||||
"material-icon-theme.folders.associations": {
|
"material-icon-theme.folders.associations": {
|
||||||
"bootstrap": "admin"
|
"bootstrap": "admin",
|
||||||
|
"ipython": "jupyter",
|
||||||
|
"zsh": "command",
|
||||||
|
"starship": "ui",
|
||||||
|
"nvim": "config",
|
||||||
|
"wsl": "linux"
|
||||||
},
|
},
|
||||||
"files.associations": {
|
"files.associations": {
|
||||||
"ideavimrc": "Vimscript",
|
"ideavimrc": "Vimscript",
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
#! /bin/sh
|
#! /bin/zsh
|
||||||
# This script is used to setup a new mac
|
# $DOTFILES/bootstrap/macOS.zsh
|
||||||
# In a new mac (Sequoia)
|
# Run this script to set up macOS
|
||||||
# Enter the following command in the terminal
|
# 运行此脚本以设置 macOS
|
||||||
#! curl -fsSL https://raw.githubusercontent.com/js0ny/dotfiles/refs/heads/master/setup/mac_setup.sh | sh # Do not use this command
|
|
||||||
|
|
||||||
echo "Running the setup script"
|
echo "Running the setup script"
|
||||||
|
|
||||||
|
|
@ -11,6 +10,9 @@ echo "[INFO] Installing Xcode Command Line Tools"
|
||||||
echo "[ACTION] Request Human Takeover"
|
echo "[ACTION] Request Human Takeover"
|
||||||
xcode-select --install
|
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
|
# System Preferences
|
||||||
# Installation Sources
|
# Installation Sources
|
||||||
echo "[INFO] Setting Installation Sources"
|
echo "[INFO] Setting Installation Sources"
|
||||||
24
bootstrap/set_symblink_unix.bash
Normal file
24
bootstrap/set_symblink_unix.bash
Normal file
|
|
@ -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
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
#!/bin/zsh
|
||||||
# $DOTFILES/scripts/update.zsh
|
# $DOTFILES/scripts/update.zsh
|
||||||
# call by `update` alias defined in tools/zsh/alias.zsh
|
# call by `update` alias defined in tools/zsh/alias.zsh
|
||||||
# 使用别名 `update` 引用,别名定义于 tools/zsh/alias.zsh
|
# 使用别名 `update` 引用,别名定义于 tools/zsh/alias.zsh
|
||||||
|
|
|
||||||
6
tools/ipython/.gitignore
vendored
Normal file
6
tools/ipython/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
# IPython config cache
|
||||||
|
*/db/
|
||||||
|
*/log/
|
||||||
|
*/pid/
|
||||||
|
*/security/
|
||||||
|
*/history.sqlite
|
||||||
11
tools/ipython/profile_default/startup/README
Normal file
11
tools/ipython/profile_default/startup/README
Normal file
|
|
@ -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
|
||||||
11
tools/ipython/profile_default/starup/README
Normal file
11
tools/ipython/profile_default/starup/README
Normal file
|
|
@ -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
|
||||||
|
|
@ -2,7 +2,7 @@ from IPython.core.magic import register_line_magic
|
||||||
|
|
||||||
@register_line_magic
|
@register_line_magic
|
||||||
def ps(cmd):
|
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 no variable is assigned to the output, print it
|
||||||
if get_ipython().last_execution_result is None:
|
if get_ipython().last_execution_result is None:
|
||||||
print("\n".join(output))
|
print("\n".join(output))
|
||||||
|
|
|
||||||
8
tools/zsh/mod/env.zsh
Normal file
8
tools/zsh/mod/env.zsh
Normal file
|
|
@ -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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue