feat(zsh, ipython): New symblink scripts, IPython linked with directory

This commit is contained in:
js0ny 2024-11-30 02:03:30 +00:00
parent fdf460a547
commit f69dc967e0
12 changed files with 75 additions and 37 deletions

6
tools/ipython/.gitignore vendored Normal file
View file

@ -0,0 +1,6 @@
# IPython config cache
*/db/
*/log/
*/pid/
*/security/
*/history.sqlite

View 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

View 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

View file

@ -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))

8
tools/zsh/mod/env.zsh Normal file
View 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