Merge remote-tracking branch 'refs/remotes/origin/master'

This commit is contained in:
js0ny 2024-11-20 14:19:14 +00:00
commit 8bad9ebc9b
20 changed files with 588 additions and 239 deletions

View file

@ -0,0 +1,43 @@
c.TerminalIPythonApp.display_banner = True
c.TerminalInteractiveShell.editing_mode = 'vi'
c.TerminalInteractiveShell.confirm_exit = False
# Source: https://ipython.readthedocs.io/en/stable/config/details.html#keyboard-shortcuts
def custom_return(shell):
"""This function is required by the API. It takes a reference to
the shell, which is the same thing `get_ipython()` evaluates to.
This function must return a function that handles each keypress
event. That function, named `handle` here, references `shell`
by closure."""
def handle(event):
"""This function is called each time `Enter` is pressed,
and takes a reference to a Prompt Toolkit event object.
If the current input starts with a bang or modulo, then
the input is executed, otherwise a newline is entered,
followed by any spaces needed to auto-indent."""
# set up a few handy references to nested items...
buffer = event.current_buffer
document = buffer.document
text = document.text
if text.startswith('!') or text.startswith('%'): # execute the input...
buffer.accept_action.validate_and_handle(event.cli, buffer)
else: # insert a newline with auto-indentation...
if document.line_count > 1: text = text[:document.cursor_position]
indent = shell.check_complete(text)[1]
buffer.insert_text('\n' + indent)
# if you just wanted a plain newline without any indentation, you
# could use `buffer.insert_text('\n')` instead of the lines above
return handle
c.TerminalInteractiveShell.handle_return = custom_return

View file

@ -0,0 +1,69 @@
from prompt_toolkit.key_binding import KeyBindings
from prompt_toolkit.key_binding.vi_state import InputMode
from prompt_toolkit.filters import Condition
from IPython import get_ipython
ip = get_ipython()
key_bindings = KeyBindings()
@Condition
def in_navigation_mode():
return ip.pt_app.app.vi_state.input_mode == InputMode.NAVIGATION
# colemak keymap hnei
@key_bindings.add("n", filter=in_navigation_mode)
def _(event):
"Move cursor down by visual line"
event.current_buffer.auto_down(count=event.arg)
@key_bindings.add("e", filter=in_navigation_mode)
def _(event):
"Move cursor up by visual line"
event.current_buffer.auto_up(count=event.arg)
@key_bindings.add("i", filter=in_navigation_mode)
def _(event):
"Move cursor right"
event.current_buffer.cursor_right(count=event.arg)
# Insert with 'l' and 'L'
@key_bindings.add("l", filter=in_navigation_mode)
def _(event):
"Enter insert mode (similar position to 'i' in Colemak)"
event.app.vi_state.input_mode = InputMode.INSERT
@key_bindings.add("L", filter=in_navigation_mode)
def _(event):
"Enter insert mode at the beginning of the line"
event.current_buffer.cursor_position += event.current_buffer.document.get_start_of_line_position()
# Ne[k]st
@key_bindings.add("k", filter=in_navigation_mode)
def _(event):
"Find next match"
event.current_buffer.forward_search()
@key_bindings.add("K", filter=in_navigation_mode)
def _(event):
"Find previous match"
event.current_buffer.reverse_search()
# [J]ump
@key_bindings.add("j", filter=in_navigation_mode)
def _(event):
"Move to end of next word"
event.current_buffer.cursor_right_word()
@key_bindings.add("J", filter=in_navigation_mode)
def _(event):
"Move to end of next word with capital E"
event.current_buffer.cursor_right_word(end=True)
# Yank to end of line with 'Y'
@key_bindings.add("Y", filter=in_navigation_mode)
def _(event):
"Yank to the end of the line"
text_to_yank = event.current_buffer.document.text_after_cursor
event.app.clipboard.set_text(text_to_yank)
ip.pt_app.key_bindings = key_bindings

View file

@ -0,0 +1,10 @@
from IPython.core.magic import register_line_magic
@register_line_magic
def ps(cmd):
output = get_ipython().getoutput(f"powershell -Command {cmd}")
# If no variable is assigned to the output, print it
if get_ipython().last_execution_result is None:
print("\n".join(output))
else:
return "\n".join(output)

View file

@ -1,6 +1,6 @@
# $XDG_CONFIG_HOME/lesskey -- less options
# ln -sf $DOTFILES/.config/lesskey $XDG_CONFIG_HOME/lesskey
# Ne
# work for less -V > 582, for mac, use brew install less to override the system less
# Format: key action

View file

@ -1,4 +1,6 @@
# export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME"/npm/npmrc
# ===========================================================
# $XDG_CONFIG_HOME/npm/npmrc
# ln -s $DOTFILES/.config/npm/npmrc $NPM_CONFIG_USERCONFIG
# New-Item -ItemType SymbolicLink -Path $env:NPM_CONFIG_USERCONFIG -Value $env:DOTFILES/.config/npm/npmrc
# registry=https://registry.npmmirror.com

View file

@ -12,7 +12,7 @@ return {
opts = {
workspaces = {
{
name = "All",
name = "Obsidian",
path = "~/Obsidian",
},
},

View file

@ -1,8 +1,20 @@
# $XDG_CONFIG_HOME/tmux/tmux.conf
# ln -sf $DOTFILES/.config/tmux/tmux.conf $XDG_CONFIG_HOME/tmux/tmux.conf
# Prefix
# -----------------
set-option -g prefix C-x
set-option -g prefix C-a
unbind C-b
bind C-x send-prefix
bind C-a send-prefix
# Options
set-option -g mouse on
set-option -g default-terminal "screen-256color"
set-option -g allow-rename on
set-option -g alternate-screen on
set-option -g visual-activity on
set-option -g pane-border-style fg=colour244
set-option -g pane-activity-border-style fg=colour239
# Index
# -----------------
@ -15,7 +27,7 @@ set -g history-limit 4096
# Reload Config
# -----------------
bind r source-file ~/.tmux.conf \; display "Reloaded Config"
bind r source-file ~/.config/tmux/tmux.conf \; display "Reloaded Config"
# Vi Mode
# -----------------
@ -32,6 +44,18 @@ bind h select-pane -L
bind n select-pane -D
bind e select-pane -U
bind i select-pane -R
bind -r H resize-pane -L 5
bind -r N resize-pane -D 5
bind -r E resize-pane -U 5
bind -r I resize-pane -R 5
bind C-h select-window -t :-
bind C-l select-window -t :+
bind ` resize-pane -Z
# Status Bar
# -----------------
set -g status-position top
set-option -g status-bg black
set-option -g status-fg white
set-option -g status-left '#[fg=green][#S] '
setw -g window-status-current-format '#[fg=colour236,bg=colour39] #I #W '

View file

@ -34,6 +34,9 @@ set incsearch
set ignorecase
set smartcase
set number
set relativenumber
" XDG Directory Specifications
" Reference to https://jorenar.com/blog/vim-xdg

5
.gitignore vendored
View file

@ -1,6 +1,11 @@
.DS_Store
*private*
.private.env.*
.config/ipython/profile_default/db
.config/ipython/profile_default/log
.config/ipython/profile_default/pid
.config/ipython/profile_default/security
.config/ipython/profile_default/history.sqlite
.config/nvim/tt.*
.config/nvim/.tests
.config/nvim/doc/tags

View file

@ -2,12 +2,12 @@
# ln -sf $DOTFILES/mac/Microsoft.PowerShell_profile.ps1 $XDG_CONFIG_HOME/powershell/Microsoft.PowerShell_profile.ps1
### Variables ###
$DOTFILES = "$HOME\.dotfiles"
$DOTFILES = "$HOME/.dotfiles"
### Load Configs ###
Get-ChildItem -Path $DOTFILES\powershell -Filter *.ps1 | ForEach-Object {. $_}
Get-ChildItem -Path $DOTFILES\powershell_private -Filter *.ps1 | ForEach-Object {. $_}
Get-ChildItem -Path $DOTFILES/powershell -Filter *.ps1 | ForEach-Object {. $_}
Get-ChildItem -Path $DOTFILES/powershell_private -Filter *.ps1 | ForEach-Object {. $_}
## Aliases ###

7
powershell/Config.ps1 Normal file
View file

@ -0,0 +1,7 @@
# Use XDG Base Directory Specification and its similar structure for Windows
# wget
${function:wget} = {wget --hsts-file $XDG_CACHE_HOME/wget-hsts $args}
# yarn v1
${function:yarn} = {yarn --use-yarnrc $XDG_CONFIG_HOME/yarn/config.yaml $args}

View file

@ -1,8 +1,8 @@
#! /bin/zsh
#! /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/mac/mac_setup.sh | sh
#! 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"
@ -24,6 +24,7 @@ defaults write com.apple.finder AppleShowAllFiles -bool false # Don't show Hidde
defaults write com.apple.finder ShowPathbar -bool true # Show Path Bar
defaults write com.apple.finder ShowStatusBar -bool true # Show Status Bar
defaults write NSGlobalDomain AppleShowAllExtensions -bool true # Show All File Extensions
defaults write com.apple.finder AppleShowAllFiles -bool true # Show Hidden Files
defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}/Documents" # Open New Finder Windows in Documents
defaults write com.apple.finder _FXSortFoldersFirst -bool true
defaults write com.apple.finder FinderSpawnTab -bool true
@ -34,7 +35,11 @@ defaults write com.apple.finder ShowMountedServersOnDesktop -bool false
defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool false
# No DS_Store on Network
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
# Keyboard
# Disable Accent Menu
defaults write NSGlobalDomain ApplePressAndHoldEnabled -boolean false
killall Finder
killall Dock
## Dock
echo "[INFO] Setting Dock Preferences"
defaults write com.apple.dock persistent-apps -array
@ -55,74 +60,78 @@ defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool
echo "[INFO] Setting Up Dotfiles"
export DOTFILES="$HOME/.dotfiles"
git clone https://www.github.com/js0ny/dotfiles.git ~/.dotfiles
ln -sf $DOTFILES/zsh/.zshenv ~/.zshenv
echo "[INFO] 'source ~/.zshenv' to use XDG_CONFIG_HOME"
source ~/.zshenv
sudo cp ~/.dotfiles/zsh/.zshenv /etc/zshenv
echo "[INFO] 'source etc/zshenv' to use XDG_CONFIG_HOME"
source /etc/zshenv
# export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
# export ZDOTDIR="${XDG_CONFIG_HOME}/zsh"
echo "[INFO] Setting Up Zsh for Initial Use"
ln -sf $DOTFILES/zsh/.zshenv ~/.zshenv
ln -sf $DOTFILES/mac/.zshrc $XDG_CONFIG_HOME/zsh/.zshrc
source $XDG_CONFIG_HOME/zsh/.zshrc
mkdir -p $ZDOTDIR
ln -sf $DOTFILES/zsh/.zshenv $ZDOTDIR/.zshenv
ln -sf $DOTFILES/mac/.zshrc $ZDOTDIR/.zshrc
mv ~/.zprofile $ZDOTDIR/.zprofile
source $ZDOTDIR/.zshrc
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH/custom/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH/custom/plugins/zsh-syntax-highlighting
source $XDG_CONFIG_HOME/zsh/.zshrc
source /etc/zshenv
source $ZDOTDIR/.zshrc
rm -f ~/.zshrc ~/.zprofile ~/.zsh_history ~/.zshenv
rm -rf ~/.zsh_sessions
echo "[INFO] Setting Up dotfiles"
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
mkdir -p ~/.config/zellij # Not support XDG_CONFIG_HOME but same directory
# $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/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/zellij/config.kdl ~/.config/zellij/config.kdl
. $DOTFILES/setup/set_symblink_unix.sh
# $DOTFILES/mac
ln -sf $DOTFILES/mac/neovide.toml $XDG_CONFIG_HOME/neovide/config.toml
ln -sf $DOTFILES/mac/Microsoft.PowerShell_profile.ps1 $XDG_CONFIG_HOME/powershell/Microsoft.PowerShell_profile.ps1
# $DOTFILES/vscode
ln -sf $DOTFILES/vscode/vscode.vimrc $XDG_CONFIG_HOME/vscode.vimrc
# $DOTFILES root
ln -sf $DOTFILES/.haskeline ~/.haskeline
ln -sf $DOTFILES/.npmrc ~/.npmrc
ln -sf $DOTFILES/.tmux.conf ~/.tmux.conf
# Brew
echo "[INFO] Installing Homebrew"
echo "[ACTION] Request Human Input"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo "[INFO] Installing Softwares"
# Tap
brew tap daipeihust/tap # for `im-select`
brew tap homebrew/cask-fonts
brew install mas # Mac App Store CLI
# CLI
# brew install --formula cfiles # Not Available
# File Management
brew install --formula bat
brew install --formula fzf
brew install --formula glow # Markdown Preview
brew install --formula less # Pager, overwrites system less, no XDG support
brew install --formula ripgrep
brew install --formula tree
brew install --formula lsd
# Network
brew install --formula wget
brew install --formula wget2
brew install --formula speedtest-cli
# Development
brew install --formula cmake
brew install --formula lazygit
# Shell
brew install --formula starship # Shell Prompt
brew install --formula tmux
brew install --formula zellij
# System Info
brew install --formula fastfetch # 這輩子有了
# Utilities
brew install --formula ffmpeg
brew install --formula daipeihust/tap/im-select # IME Selector (for Vim modes)
brew install --formula pandoc
brew install --formula tldr
# File Management
brew install --cask keka # Archiver
brew install --cask google-drive # `sudo` # Cloud Storage
# CLI
# brew install --formula cfiles # Not Available
brew install --formula fastfetch # 這輩子有了
brew install --formula fzf
brew install --formula ffmpeg
brew install --formula im-select # Switch IME (For Vim)
brew install --formula lazygit
brew install --formula ripgrep
brew install --formula tmux
brew install --formula tree
brew install --formula pandoc
brew install --formula zellij # Better Tmux for me
brew install --formula wget
brew install --formula wget2
brew install --formula speedtest-cli
brew install --formula tldr # Simplified man pages
brew install --formula cmake
brew install --formula bat
brew install --formula lsd
# Editors
brew install --formula vim # Overwrite System Vim since no XDG support
brew install --cask visual-studio-code
brew install --formula neovim
brew install --formula neovide
@ -179,7 +188,6 @@ brew install --cask arc
brew install --cask firefox@nightly
# Fonts
brew tap homebrew/cask-fonts
brew install --cask font-caskaydia-cove-nerd-font
brew install --cask font-lxgw-wenkai
@ -270,3 +278,6 @@ duti -s com.jetbrains.rider .fsproj all
# Video -> IINA
duti -s com.colliderli.iina .mp4 all
duti -s com.colliderli.iina .mkv all
mkdir -p $DOTFILES/powershell_private
touch $ZDOTDIR/.private.env.sh

View file

@ -0,0 +1,22 @@
#! /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

263
setup/win_setup.ps1 Normal file
View file

@ -0,0 +1,263 @@
#!C:\Program Files\WindowsApps\Microsoft.PowerShell_7.4.6.0_x64__8wekyb3d8bbwe\pwsh.EXE
# Run with PowerShell 7
winget install -e --id Git.Git
git clone https://github.com/js0ny/dotfiles.git ~\.dotfiles
Set-Location -Path ~\.dotfiles
Remove-Item -Force $PROFILE
$DOTFILES = "$HOME\.dotfiles"
New-Item -ItemType SymbolicLink -Path $PROFILE -Target "$DOTFILES\win\Microsoft.PowerShell_profile.ps1"
. $PROFILE
# Install Scoop
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression
# Install Chocolatey
# Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
# Set Environment Variables
# Use %PATH_EXT% to prevent PATH from being too long
[System.Environment]::SetEnvironmentVariable("Path_EXT_0", "D:\bin", "User")
[System.Environment]::SetEnvironmentVariable("Path_EXT_1", "", "User")
[System.Environment]::SetEnvironmentVariable("Path_EXT_2", "", "User")
$currentPath = [System.Environment]::GetEnvironmentVariable("Path", "User")
if ($currentPath -notlike "*%PATH_EXT%*") {
$currentPath += ";%PATH_EXT_0%;%PATH_EXT_1%;%PATH_EXT_2%"
}
[System.Environment]::SetEnvironmentVariable("Path", $currentPath, "User")
[System.Environment]::SetEnvironmentVariable("PATH_EXT_0", "", [System.EnvironmentVariableTarget]::Machine)
[System.Environment]::SetEnvironmentVariable("PATH_EXT_1", "", [System.EnvironmentVariableTarget]::Machine)
[System.Environment]::SetEnvironmentVariable("PATH_EXT_2", "", [System.EnvironmentVariableTarget]::Machine)
$currentPath = [System.Environment]::GetEnvironmentVariable("Path", [System.EnvironmentVariableTarget]::Machine)
if ($currentPath -notlike "*%PATH_EXT%*") {
$currentPath += ";%PATH_EXT_0%;%PATH_EXT_1%;%PATH_EXT_2%"
}
[System.Environment]::SetEnvironmentVariable("Path", $currentPath, [System.EnvironmentVariableTarget]::Machine)
# Simulate XDG Base Directory Specification
$Env:XDG_CONFIG_HOME = "$Env:AppData"
$Env:XDG_DATA_HOME = "$Env:LocalAppData"
$Env:XDG_CACHE_HOME = "$Env:LocalAppData\cache"
$Env:XDG_STATE_HOME = "$Env:LocalAppData\state"
[System.Environment]::SetEnvironmentVariable("XDG_CONFIG_HOME", "$Env:XDG_CONFIG_HOME", "User")
[System.Environment]::SetEnvironmentVariable("XDG_DATA_HOME", "$Env:XDG_DATA_HOME", "User")
New-Item -ItemType Directory -Path "$Env:LocalAppData\cache" -Force
[System.Environment]::SetEnvironmentVariable("XDG_CACHE_HOME", "$Env:XDG_CACHE_HOME", "User")
New-Item -ItemType Directory -Path "$Env:LocalAppData\state" -Force
[System.Environment]::SetEnvironmentVariable("XDG_STATE_HOME", "$Env:XDG_STATE_HOME", "User")
# Add environment variables
[System.Environment]::SetEnvironmentVariable("DOTFILES", "$DOTFILES", "User")
# Set potential environment variables to prevent softwares put their configs in the wrong place
# eg. dotfiles in %UserProfile%
# ~\.aws -> %AppData%\aws :: AWS CLI
New-Item -ItemType Directory -Path "$Env:AppData\aws" -Force
[System.Environment]::SetEnvironmentVariable("AWS_CONFIG_FILE", "$Env:AppData\aws\config", "User")
[System.Environment]::SetEnvironmentVariable("AWS_SHARED_CREDENTIALS_FILE", "$Env:AppData\aws\credentials", "User")
# ~\.azure -> %LocalAppData%\Azure :: Azure CLIcargo install --list
[System.Environment]::SetEnvironmentVariable("AZURE_CONFIG_DIR", "$Env:LocalAppData\Azure", "User")
# ~\.cargo -> %LocalAppData%\Cargo :: Rust https://doc.rust-lang.org/cargo/guide/cargo-home.html
[System.Environment]::SetEnvironmentVariable("CARGO_HOME", "$Env:LocalAppData\Cargo", "User")
# ~\.docker -> %AppData%\dotDocker :: Docker (Docker takes %AppData%\Docker, use dotDocker instead)
[System.Environment]::SetEnvironmentVariable("DOCKER_CONFIG", "$Env:AppData\dotDocker", "User")
# ~\.dotnet -> %LocalAppData%\dotNET :: .NET Core
[System.Environment]::SetEnvironmentVariable("DOTNET_CLI_HOME", "$Env:LocalAppData\dotNET", "User")
# ~\.emacs.d -> %AppData%\.emacs.d :: Emacs (This is default)
# [System.Environment]::SetEnvironmentVariable("EMACS_HOME", "$Env:AppData\emacs.d", "User")
# ~\go -> %LocalAppData%\GO :: golang
[System.Environment]::SetEnvironmentVariable("GOPATH", "$Env:LocalAppData\GO", "User")
# ~\.ipython -> %AppData%\ipython :: IPython
# IPython won't check XDG on Windows https://github.com/ipython/ipython/blob/0615526f80691452f2e282c363bce197c0141561/IPython/utils/path.py#L200
[System.Environment]::SetEnvironmentVariable("IPYTHONDIR", "$Env:AppData\ipython", "User")
# ~\.julia -> %LocalAppData%\julia :: Julia
[System.Environment]::SetEnvironmentVariable("JULIA_DEPOT_PATH", "$Env:LocalAppData\julia", "User")
# ~\_lesshst -> %LocalAppData%\state\lesshst :: less
[System.Environment]::SetEnvironmentVariable("LESSHISTFILE", "$Env:XDG_STATE_HOME\lesshst", "User")
# %AppData%\less\lesskey :: less
New-Item -ItemType Directory -Path "$Env:AppData\less" -Force
[System.Environment]::SetEnvironmentVariable("LESSKEYIN", "$Env:AppData\less\lesskey", "User")
# ~\.matplotlib -> %LocalAppData%\matplotlib :: Matplotlib
[System.Environment]::SetEnvironmentVariable("MPLCONFIGDIR", "$Env:LocalAppData\matplotlib", "User")
# ~\.npmrc -> %AppData%\npm\npmrc :: npm
[System.Environment]::SetEnvironmentVariable("NPM_CONFIG_USERCONFIG", "$Env:AppData\npm\npmrc", "User")
# ~\.node_repl_history -> %LocalAppData%\state\node\repl_history :: Node.js
New-Item -ItemType Directory -Path "$Env:XDG_STATE_HOME\node" -Force
[System.Environment]::SetEnvironmentVariable("NODE_REPL_HISTORY", "$Env:XDG_STATE_HOME\node\repl_history", "User")
# ~\.ts_node_repl_history -> %LocalAppData%\state\node\ts_node_repl_history :: Node.js
[System.Environment]::SetEnvironmentVariable("TS_NODE_REPL_HISTORY", "$Env:XDG_STATE_HOME\node\ts_node_repl_history", "User")
# ~\.nuget\packages -> %LocalAppData%\cache\NuGet\packages :: NuGet
[System.Environment]::SetEnvironmentVariable("NUGET_PACKAGES", "$Env:XDG_CACHE_HOME\NuGet\packages", "User")
# ~\.omnisharp -> %AppData%\OmniSharp :: OmniSharp
[System.Environment]::SetEnvironmentVariable("OMNISHARPHOME", "$Env:AppData\OmniSharp", "User")
# ~\.python_history -> %LocalAppData%\state\python\python_history :: Python
# Only works for Python 3.13+ https://docs.python.org/3.13/using/cmdline.html#envvar-PYTHON_HISTORY
New-Item -ItemType Directory -Path "$Env:XDG_STATE_HOME\python" -Force
[System.Environment]::SetEnvironmentVariable("PYTHON_HISTORY", "$Env:XDG_STATE_HOME\python\python_history", "User")
# ~\.rustup -> %LocalAppData%\Rustup :: Rust
[System.Environment]::SetEnvironmentVariable("RUSTUP_HOME", "$Env:LocalAppData\Rustup", "User")
# ~\.vimrc -> %AppData%\Vim\_vimrc :: Vim
New-Item -ItemType Directory -Path "$Env:AppData\Vim" -Force
[System.Environment]::SetEnvironmentVariable("VIM", "$Env:AppData\Vim", "User")
# ~\.vuerc -> %AppData%\vue\.vuerc :: Vue CLI
# Currently, Vue CLI doesn't support file path configuration:https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli/lib/confifile
# [System.Environment]::SetEnvironmentVariable("VUE_CLI_CONFIG_PATH", "$Env:AppData\vue\.vuerc", "User")
# ~\.wget-hsts -> %LocalAppData%\cache\wget-hsts :: wget
# Use Alias, wget host file path is not configurable
# ~\.yarnrc -> %AppData%\yarn\config.yaml :: Yarn v1
# Use Alias, yarnrc path is not configurable
# Reload required here to make sure the environment variables are set
# Set Dotfiles
# $DOTFILES\.config
$folders = @("conda", "git", "ideavim", "ipython", "markdownlint", "npm", "NuGet", "nvim", "pip", "Vim")
foreach ($folder in $folders) {
New-Item -ItemType Directory -Path "$Env:XDG_CONFIG_HOME\$folder" -Force
}
New-Item -ItemType SymbolicLink -Path "$Env:XDG_CONFIG_HOME\conda\.condarc" -Target "$DOTFILES\.config\conda\condarc.yaml" -Force
New-Item -ItemType SymbolicLink -Path "$Env:XDG_CONFIG_HOME\git\config" -Target "$DOTFILES\.config\git\.gitconfig" -Force
New-Item -ItemType SymbolicLink -Path "~\.haskeline" -Target "$DOTFILES\.haskeline" -Force
New-Item -ItemType SymbolicLink -Path "$Env:XDG_CONFIG_HOME\ideavim\.ideavimrc" -Target "$DOTFILES\.config\ideavim\.ideavimrc" -Force
New-Item -ItemType SymbolicLink -Path "$Env:XDG_CONFIG_HOME\ipython" -Target "$DOTFILES\.config\ipython" -Force
# New-Item -ItemType SymbolicLink -Path "~\.markdownlint.json" -Target "$DOTFILES\.markdownlint.json" -Force
New-Item -ItemType SymbolicLink -Path "$Env:XDG_CONFIG_HOME\npm\npmrc" -Target "$DOTFILES\.config\npm\npmrc" -Force
New-Item -ItemType SymbolicLink -Path "$Env:AppData\NuGet\NuGet.Config" -Target "$DOTFILES\.config\NuGet\NuGet.Config" -Force
New-Item -ItemType SymbolicLink -Path "$Env:XDG_CONFIG_HOME\nvim" -Target "$DOTFILES\.config\nvim" -Force
New-Item -ItemType SymbolicLink -Path "$Env:AppData\pip\pip.ini" -Target "$DOTFILES\.config\pip\pip.conf" -Force
New-Item -ItemType SymbolicLink -Path "$Env:XDG_CONFIG_HOME\Vim\_vimrc" -Target "$DOTFILES\.config\vim\vimrc" -Force
New-Item -ItemType SymbolicLink -Path "~\.wslconfig" -Target "$DOTFILES\win\.wslconfig" -Force
New-Item -ItemType SymbolicLink -Path "$Env:AppData\neovide\config.toml" -Target "$DOTFILES\win\neovide.toml" -Force
# New-Item -ItemType SymbolicLink -Path "~\.vscode.vimrc" -Target "$DOTFILES\vscode\vscode.vimrc" Use Absolute Path
# Hide dotfiles
Get-ChildItem -Force -Filter .* -Path $HOME | ForEach-Object { $_.Attributes += "Hidden" }
@(
Join-Path $HOME '.config'
Join-Path $HOME '.dotfiles'
) | ForEach-Object {
$_.Attributes -band -bnot [System.IO.FileAttributes]::Hidden
}
Set-Location $HOME\Documents
# Match WindowsPowerShell and PowerShell
Get-ChildItem -Force -Filter *owerShell | ForEach-Object { $_.Attributes += "Hidden" }
# Windows Terminal
if (Get-Command wt -ErrorAction SilentlyContinue) {
Write-Output "Windows Terminal (wt) installed"
} else {
winget install -e --id Microsoft.WindowsTerminal
}
# Uninstall Windows Apps
Get-AppxPackage *solit* | Remove-AppxPackage # 纸牌
Get-AppxPackage *sound* | Remove-AppxPackage # 錄音機
Get-AppxPackage *camera* | Remove-AppxPackage # 相機
Get-AppxPackage *weather* | Remove-AppxPackage # 天氣
Get-AppxPackage *Map* | Remove-AppxPackage # 地圖
# Get-AppxPackage *clipchamp* | Remove-AppxPackage # 其實這個還行
# Added Packages
scoop bucket add main
scoop bucket add nerd-fonts
scoop bucket add extras
scoop bucket add nonportable
# CLI Tools
# winget install -e --id GnuWin32.Grep # Use Select-String instead
scoop install main/make
# winget install -e --id GnuWin32.Which # Use Get-Command instead
scoop install main/fzf
scoop install main/ripgrep
scoop install main/wget
scoop install main/wget2
scoop install main/cmake
scoop install main/bat
scoop install main/zoxide
scoop install main/dos2unix
# File Management
scoop install extras/everything
scoop install main/7zip
scoop install extras/bandizip
scoop install main/pandoc
scoop install extras/sumatrapdf
winget install -e --id Google.GoogleDrive
# System Enhancements
scoop install extras/fancontrol
scoop install extras/powertoys
scoop install extras/msiafterburner
winget install -e --id Yuanli.uTools
scoop install extras/geekuninstaller
scoop install extras/flow-launcher
# winget install -e --id AutoHotkey.AutoHotkey
scoop install extras/autohotkey
scoop install nonportable/mactype-np
scoop install extras/diskgenius
# winget install -e --id Nilesoft.Shell
# scoop install umi-ocr-paddle
# Editor
scoop install main/vim
scoop install main/neovim
scoop install extras/vscodium
scoop install extras/vscode
scoop install extras/neovide
# Security
scoop bucket add keyguard https://github.com/AChep/keyguard-repo-scoop
scoop install keyguard/keyguard
# PKM
scoop install extras/obsidian
winget install -e --id 9P7HPMXP73K4 # Siyuan
scoop install extras/typora
scoop install extras/zotero
scoop install extras/anki
# winget install -e --id Notion.Notion
# Browser
# Use Microsoft Edge directly
# winget install -e --id TheBrowserCompany.Arc
# winget install -e --id Mozilla.Firefox.Nightly # Not working
# Programming Languages
winget install -e --id Python.Python.3.13
winget install -e --id Anaconda.Miniconda3
winget install -e --id OpenJS.NodeJS
winget install -e --id Rustlang.Rustup
winget install -e --id Microsoft.DotNet.SDK.8
# Dev
scoop install extras/docker
scoop install extras/lazygit
# IDE
scoop install extras/rider
# Gaming
winget install -e --id Valve.Steam
# IME
winget install -e --id Rime.Weasel # 小狼毫 Rime
# Misc
winget install -e --id 9N5LW3JBCXKF --source msstore # MSIX Packaging Tool
winget install -e --id 9PKTQ5699M62 --source msstore # iCloud
winget install -e --id RazerInc.RazerInstaller # Razer Synapse
# Social
winget install -e --id 9N97ZCKPD60Q --source msstore # Unigram (Telegram client)
winget install -e --id Tencent.QQ.NT
winget install -e --id XPFCKBRNFZQ62G --source msstore # WeChat in Windows Store (MSIX)
# Others
winget install -e --id Appest.TickTick
winget install -e --id 9NBLGGH4Z1SP --source msstore # ShareX (screen capture)
# Fonts
scoop install FiraCode-NF
scoop install CascadiaCode-NF
scoop install LXGWWenKai # 霞鹜文楷
scoop install LXGWWenKaiMono # 霞鹜文楷Mono
# WSL
scoop install archwsl
wsl --set-version Arch 1

View file

@ -1,153 +0,0 @@
#!C:\Program Files\WindowsApps\Microsoft.PowerShell_7.4.6.0_x64__8wekyb3d8bbwe\pwsh.EXE
# Run with PowerShell 7
# Use PowerShell as Administrator
winget install -e --id Git.Git
git clone https://github.com/js0ny/dotfiles.git ~\.dotfiles
Set-Location -Path ~\.dotfiles
Remove-Item -Force $PROFILE
$DOTFILES = "$HOME\.dotfiles"
New-Item -ItemType SymbolicLink -Path $PROFILE -Target "$DOTFILES\win\Microsoft.PowerShell_profile.ps1"
. $PROFILE
# Install Scoop
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression
# Install Chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
# Set Dotfiles
New-Item -ItemType SymbolicLink -Path "$Env:XDG_CONFIG_HOME\conda\.condarc" -Target "$DOTFILES\.config\conda\condarc.yaml"
New-Item -ItemType SymbolicLink -Path "$Env:XDG_CONFIG_HOME\git\config" -Target "$DOTFILES\.config\git\.gitconfig"
New-Item -ItemType SymbolicLink -Path "~\.haskline" -Target "$DOTFILES\.haskline"
New-Item -ItemType SymbolicLink -Path "~\.ideavimrc" -Target "$DOTFILES\.ideavimrc"
New-Item -ItemType SymbolicLink -Path "~\.markdownlint.json" -Target "$DOTFILES\.markdownlint.json"
New-Item -ItemType SymbolicLink -Path "~\.npmrc" -Target "$DOTFILES\.npmrc"
New-Item -ItemType SymbolicLink -Path "~\.pip.conf" -Target "$DOTFILES\.pip.conf"
New-Item -ItemType SymbolicLink -Path "~\.wslconfig" -Target "$DOTFILES\win\.wslconfig"
New-Item -ItemType SymbolicLink -Path "~\.vscode.vimrc" -Target "$DOTFILES\vscode\vscode.vimrc"
# Hide dotfiles
Get-ChildItem -Force -Filter .* | ForEach-Object { $_.Attributes += "Hidden" }
# Windows Terminal
if (Get-Command wt -ErrorAction SilentlyContinue) {
Write-Output "Windows Terminal (wt) installed"
} else {
winget install -e --id Microsoft.WindowsTerminal
}
# Uninstall Windows Apps
Get-AppxPackage *solit* | Remove-AppxPackage # 纸牌
Get-AppxPackage *sound* | Remove-AppxPackage # 錄音機
Get-AppxPackage *camera* | Remove-AppxPackage # 相機
Get-AppxPackage *weather* | Remove-AppxPackage # 天氣
Get-AppxPackage *Map* | Remove-AppxPackage # 地圖
# Get-AppxPackage *clipchamp* | Remove-AppxPackage # 其實這個還行
# Added Packages
scoop bucket add main
scoop bucket add nerd-fonts
scoop bucket add extras
scoop bucket add nonportable
# CLI Tools
# winget install -e --id GnuWin32.Grep # Use Select-String instead
scoop install main/make
# winget install -e --id GnuWin32.Which # Use Get-Command instead
scoop install main/fzf
scoop install main/ripgrep
scoop install main/wget
scoop install main/wget2
scoop install main/cmake
scoop install main/bat
scoop install main/zoxide
scoop install main/dos2unix
# File Management
scoop install extras/everything
scoop install main/7zip
scoop install extras/bandizip
scoop install main/pandoc
scoop install extras/sumatrapdf
winget install -e --id Google.GoogleDrive
# System Enhancements
scoop install extras/fancontrol
scoop install extras/powertoys
scoop install extras/msiafterburner
winget install -e --id Yuanli.uTools
scoop install extras/geekuninstaller
scoop install extras/flow-launcher
# winget install -e --id AutoHotkey.AutoHotkey
scoop install extras/autohotkey
scoop install nonportable/mactype-np
scoop install extras/diskgenius
# winget install -e --id Nilesoft.Shell
# scoop install umi-ocr-paddle
# Editor
scoop install main/vim
scoop install main/neovim
scoop install extras/vscodium
scoop install extras/vscode
scoop install extras/neovide
# Security
scoop bucket add keyguard https://github.com/AChep/keyguard-repo-scoop
scoop install keyguard/keyguard
# PKM
scoop install extras/obsidian
winget install -e --id 9P7HPMXP73K4 # Siyuan
scoop install extras/typora
scoop install extras/zotero
scoop install extras/anki
# winget install -e --id Notion.Notion
# Browser
# Use Microsoft Edge directly
# winget install -e --id TheBrowserCompany.Arc
# winget install -e --id Mozilla.Firefox.Nightly # Not working
# Programming Languages
winget install -e --id Python.Python.3.13
winget install -e --id Anaconda.Miniconda3
winget install -e --id OpenJS.NodeJS
winget install -e --id Rustlang.Rustup
winget install -e --id Microsoft.DotNet.SDK.8
# Dev
scoop install extras/docker
scoop install extras/lazygit
# IDE
scoop install extras/rider
# Gaming
winget install -e --id Valve.Steam
# IME
winget install -e --id Rime.Weasel # 小狼毫 Rime
# Misc
winget install -e --id 9N5LW3JBCXKF --source msstore # MSIX Packaging Tool
winget install -e --id 9PKTQ5699M62 --source msstore # iCloud
winget install -e --id RazerInc.RazerInstaller # Razer Synapse
# Social
winget install -e --id 9N97ZCKPD60Q --source msstore # Unigram (Telegram client)
winget install -e --id Tencent.QQ.NT
winget install -e --id XPFCKBRNFZQ62G --source msstore # WeChat in Windows Store (MSIX)
# Others
winget install -e --id Appest.TickTick
winget install -e --id 9NBLGGH4Z1SP --source msstore # ShareX (screen capture)
# Fonts
scoop install FiraCode-NF
scoop install CascadiaCode-NF
scoop install LXGWWenKai # 霞鹜文楷
scoop install LXGWWenKaiMono # 霞鹜文楷Mono
# WSL
scoop install archwsl
wsl --set-version Arch 1

View file

@ -1,5 +1,5 @@
# ~/.zshenv
# ln -s $DOTFILES/zsh/.zshenv ~/.zshenv
# ln -s $DOTFILES/zsh/.zshenv $ZDOTDIR/.zshenv
# This file is sourced by all zsh sessions upon startup.
# Use XDG Base Directory Specification
@ -8,8 +8,13 @@ export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
export XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}"
export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
export XDG_RUNTIME_DIR="/run/user/$(id -u)"
# Disable shell sessions on macOS when using default terminal
SHELL_SESSIONS_DISABLE=1
# Zsh
export ZDOTDIR="${XDG_CONFIG_HOME}/zsh"
# Also put in /etc/zsh/zshenv
# or /etc/zshenv in macOS
# sudo cp $DOTFILES/zsh/.zshenv /etc/zsh/zshenv
# sudo cp $DOTFILES/zsh/.zshenv /etc/zshenv

View file

@ -1,6 +1,7 @@
# PowerShell Equivalent #
alias ni=touch
alias cls=clear
alias ii=open
# Dev #
alias g++='g++ -std=c++2b' # Set the default C++ standard to C++20
@ -9,10 +10,11 @@ alias cl='clang -std=c99'
alias clpp='clang++ -std=c++2b'
alias python=python3 # Set the default Python version to Python 3
alias py=python # Alias for Python
alias pip=pip3 # Alias for pip
alias bashcfg="nvim ~/.bashrc"
alias zshcfg="nvim ~/.zshrc"
alias shcfg=zshcfg
alias reload="source ~/.zshrc"
alias reload="source $ZDOTDIR/.zshrc"
alias nvimrc="nvim $XDG_CONFIG_HOME/nvim/"
alias ohmyzsh="code ~/.oh-my-zsh"
alias pulldots="cd $DOTFILES && git pull"
@ -27,6 +29,9 @@ alias pymkenv="conda create --name"
alias v=nvim
alias c=code
# lsd #
alias ls='lsd -a'
alias l='lsd -lah'
# Misc #
alias cf=cfiles

View file

@ -1,47 +1,67 @@
### ZSH Config ###
# ZSH Config #
export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH
export ZSH="$ZDOTDIR/ohmyzsh"
ZSH_THEME="avit"
# DISABLE_MAGIC_FUNCTIONS="true"
# DISABLE_LS_COLORS="true"
# DISABLE_AUTO_TITLE="true"
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# You can also set it to another string to have that shown instead of the default red dots.
# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
HIST_STAMPS="yyyy-mm-dd"
plugins=(git web-search jsontools z vi-mode zsh-syntax-highlighting zsh-autosuggestions)
source $ZSH/oh-my-zsh.sh
source .private.env.sh
# plugins=(git web-search jsontools z vi-mode zsh-syntax-highlighting zsh-autosuggestions)
# export MANPATH="/usr/local/man:$MANPATH"
# export LANG= "en_US.UTF-8"
# Plugins (Manually Managed) #
# $ZDOTDIR/plugins
# Use XDG Base Directory Specification
source $ZDOTDIR/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source $ZDOTDIR/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
source $ZDOTDIR/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh
# Tools Related Environment Variables #
PAGER="less"
EDITOR="nvim"
VISUAL="nvim"
# Use XDG Base Directory Specification #
# ~/.azure/ -> $XDG_DATA_HOME/azure/
export AZURE_CONFIG_DIR="$XDG_DATA_HOME"/azure
# ~/.cgdb/ -> $XDG_CONFIG_HOME/cgdb/
export CGDB_DIR="$XDG_CONFIG_HOME"/cgdb
# ~/.nv -> $XDG_CACHE_HOME/nv (CUDA)
# macOS does not have Cuda; Check if CUDA is installed
if [ "$(uname)" != "Darwin" ] && [ -d "/usr/local/cuda" ]; then
export CUDA_CACHE_PATH="$XDG_CACHE_HOME"/nv
fi
# ~/.docker -> $XDG_CONFIG_HOME/docker
export DOCKER_CONFIG="$XDG_CONFIG_HOME"/docker
# ~/.dotnet -> $XDG_DATA_HOME/dotnet
export DOTNET_CLI_HOME="$XDG_DATA_HOME"/dotnet
# ~/.gnupg -> $XDG_CONFIG_HOME/gnupg
export GNUPGHOME="$XDG_DATA_HOME"/gnupg
# ~/go -> $XDG_DATA_HOME/go
export GOPATH="$XDG_DATA_HOME"/go
# ~/.juliaup/ -> $XDG_DATA_HOME/julia/
export JULIA_DEPOT_PATH="$XDG_DATA_HOME/julia:$JULIA_DEPOT_PATH"
# Check if node is installed
if command -v node > /dev/null; then
# ~/.node_repl_history -> $XDG_STATE_HOME/node/repl_history
export NODE_REPL_HISTORY="$XDG_STATE_HOME"/node/repl_history
# ~/.ts_node_repl_history -> $XDG_STATE_HOME/node/ts_node_repl_history
export TS_NODE_REPL_HISTORY="$XDG_STATE_HOME"/node/ts_node_repl_history
# ~/.npmrc -> $XDG_CONFIG_HOME/npm/npmrc
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME"/npm/npmrc
# ~/.npm -> $XDG_CACHE_HOME/npm
export NPM_CONFIG_INIT_MODULE="$XDG_CONFIG_HOME"/npm/config/npm-init.js
export NPM_CONFIG_CACHE="$XDG_CACHE_HOME"/npm
export NPM_CONFIG_TMP="$XDG_RUNTIME_DIR"/npm
fi
# ~/.python_history -> $XDG_DATA_HOME/python/history
# Works only with Python 3.13.0a3 and later
export PYTHON_HISTORY="$XDG_DATA_HOME"/python/history
# ~/.tldrc/ -> $XDG_CACHE_HOME/tldr
export TLDR_CACHE_DIR="$XDG_CACHE_HOME"/tldr
# ~/.w3m -> $XDG_DATA_HOME/w3m
export W3M_DIR="$XDG_DATA_HOME"/w3m
# ~/.wakatime.cfg -> $XDG_CONFIG_HOME/wakatime.cfg
# ~/.wakatime/ -> $XDG_CONFIG_HOME/wakatime/
export WAKATIME_HOME="$XDG_CONFIG_HOME/wakatime"
# ~/.wget-hsts -> $XDG_DATA_HOME/wget-hsts
alias wget='wget --hsts-file="$XDG_DATA_HOME/wget-hsts"'
alias wget='wget --hsts-file="$XDG_CACHE_HOME/wget-hsts"'
# ~/.z -> $XDG_DATA_HOME/z
export _Z_DATA="$XDG_DATA_HOME/z"
# ~/.zcompdump* -> $XDG_CACHE_HOME/zsh/zcompdump*

13
zsh/update.sh Normal file
View file

@ -0,0 +1,13 @@
# $DOTFILES/zsh/update.sh
# This file won't be sourced by zsh by default
# Use `source` to run this file for updating plugins
# Plugins #
# Auto `git pull` on $ZDOTDIR/plugins
for plugin in $ZDOTDIR/plugins/*; do
if [ -d "$plugin" ]; then
cd $plugin
git pull --quiet --no-edit
fi
done