chezmoi: windows migration dir

This commit is contained in:
js0ny 2025-10-20 03:58:34 +01:00
parent 52b70819bf
commit c24adf35d4
51 changed files with 3403 additions and 3840 deletions

View file

@ -19,6 +19,7 @@ scripts
.config/systemd
.config/user-dirs.dirs
.config/user-dirs.locale
.local/share/kio/
{{ end }}
{{ if eq .chezmoi.os "linux" }}
@ -53,4 +54,8 @@ Library
{{ if ne .chezmoi.os "windows" }}
.gitconfig
.glzr
.wslconfig
.wslgconfig
Appdata/
{{ end }}

View file

@ -1,3 +1,4 @@
# NOTE: FOR WSL ONLY
# https://github.com/microsoft/WSL/issues/11261
# ~/.config/systemd/user/symlink-wayland-socket.service
# Usage:

View file

@ -16,7 +16,7 @@ case "$(uname)" in
if grep -q Microsoft /proc/version || [[ -n "$WSL_DISTRO_NAME" ]]; then
# WSL-specific configuration
export IS_WSL=true
source $DOTFILES/platforms/wsl/winterop.zsh
source $DOTFILES/home/dot_config/zsh/winterop.zsh
else
# Native Linux configuration
if [ -n "$WAYLAND_DISPLAY" ]; then

File diff suppressed because it is too large Load diff

View file

@ -1,133 +1,133 @@
snippet mk "inline Math" iwA
$${1}$
endsnippet
snippet dmi "display Math" iwA
$ ${1} $
endsnippet
snippet dmm "display Math" iwA
$
${1}
$
endsnippet
snippet pp "parenthesis" iAm
(${1})
endsnippet
snippet lim "limit" iAm
lim_(${1:n} -> ${2:oo})
endsnippet
snippet derive "derive" iAm
derive(${1:f}, ${2:x})
endsnippet
snippet part "partial" iAm
(diff ${1:f})/(diff ${3:x})
endsnippet
snippet sb "subscript" iAm
_(${1:2})
endsnippet
snippet sr "square" iAm
^2
endsnippet
snippet pow "to the ... power" iAm
^(${1:3})
endsnippet
snippet veps "epsilon.alt" iAm
epsilon.alt
endsnippet
snippet ;; "\;" iAm
\;
endsnippet
snippet ,, "\," iAm
\,
endsnippet
snippet `([A-Za-z\)])(\d)` "auto subscript" iAm
`` rv = m[1] + "_" + m[2]``
endsnippet
snippet `([A-Za-z\)])_(\d{2})` "auto subscript" iAm
`` rv = m[1] + "_(" + m[2] + ")" ``
endsnippet
snippet `(?<![A-Za-z])([A-Za-hk-z])([acdijkmnpqrstABCDIJKMNPQRST])\2` "auto subscript" iAm
`` rv = m[1] + "_" + m[2] ``
endsnippet
# Custom: Add more greek letters
snippet `(\)|mu|alpha|sigma|rho|beta|gamma|delta|zeta|eta|varepsilon|epsilon|theta|iota|kappa|vartheta|lambda|nu|pi|rho|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)([acdijkmnpqrstABCDIJKMNPQRST])\2` "auto subscript for greek letter" iAm
`` rv = m[1] + "_" + m[2].substring(0, 1) ``
endsnippet
snippet `(?<![A-Za-z])([A-Za-hk-z01])(grave|acute|hat|tilde|macron|breve|dot|ddot|dddot|ddddot|diaer|circle|caron|vec|upright|italic|b|sans|frak|mono|bb|cal|ov)` "hat" iAm
``
const map = { "ddot": "dot.double", "dddot": "dot.triple", "ddddot": "dot.quad", "vec": "arrow", "b": "bold", "ov": "overline" }
rv = (map[m[2]] || m[2]) + "(" + m[1] + ")"
``
endsnippet
snippet `(mu|alpha|sigma|rho|beta|gamma|delta|zeta|eta|varepsilon|epsilon|theta|iota|kappa|vartheta|lambda|nu|pi|rho|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(grave|acute|hat|tilde|macron|breve|dot|ddot|dddot|ddddot|diaer|circle|caron|vec|upright|italic|b|sans|frak|mono|bb|cal|ov)` "hat" iAm
``
const map = { "ddot": "dot.double", "dddot": "dot.triple", "ddddot": "dot.quad", "vec": "arrow", "b": "bold", "ov": "overline" }
rv = (map[m[2]] || m[2]) + "(" + m[1] + ")"
``
endsnippet
snippet `((grave|acute|hat|tilde|macron|breve|dot|dot\.double|dot\.triple|dot\.quad|diaer|circle|acute\.double|caron|arrow|arrow\.l|upright|italic|bold|sans|frak|mono|bb|cal)\([a-zA-Z\d]+\))(grave|acute|hat|tilde|macron|breve|dot|ddot|dddot|ddddot|diaer|circle|caron|vec|upright|italic|b|sans|frak|mono|bb|cal|ov)` "hat" iAm
``
const map = { "ddot": "dot.double", "dddot": "dot.triple", "ddddot": "dot.quad", "vec": "arrow", "b": "bold", "ov": "overline" }
rv = (map[m[3]] || m[3]) + "(" + m[1] + ")"
``
endsnippet
snippet `(?<!\.)alt` "alt" iAm
.alt
endsnippet
snippet invs "inverse" iAm
^(-1)
endsnippet
snippet xl "vector" iAm
arrow(${1:x})
endsnippet
snippet @< "angle" iAm
angle.l ${1:x} angle.r
endsnippet
snippet HL "highlight" iA
#highlight[${VISUAL}]
endsnippet
snippet iiint "triple integral" iAm
integral.triple ${1}
endsnippet
snippet oint "closed line integral" iAm
integral.cont ${1}
endsnippet
snippet iint "double integral" iAm
integral.double ${1}
endsnippet
snippet int "integral" iAm
integral ${1}
endsnippet
snippet // "frac" iAm
frac(${1:1}, ${2:2})
snippet mk "inline Math" iwA
$${1}$
endsnippet
snippet dmi "display Math" iwA
$ ${1} $
endsnippet
snippet dmm "display Math" iwA
$
${1}
$
endsnippet
snippet pp "parenthesis" iAm
(${1})
endsnippet
snippet lim "limit" iAm
lim_(${1:n} -> ${2:oo})
endsnippet
snippet derive "derive" iAm
derive(${1:f}, ${2:x})
endsnippet
snippet part "partial" iAm
(diff ${1:f})/(diff ${3:x})
endsnippet
snippet sb "subscript" iAm
_(${1:2})
endsnippet
snippet sr "square" iAm
^2
endsnippet
snippet pow "to the ... power" iAm
^(${1:3})
endsnippet
snippet veps "epsilon.alt" iAm
epsilon.alt
endsnippet
snippet ;; "\;" iAm
\;
endsnippet
snippet ,, "\," iAm
\,
endsnippet
snippet `([A-Za-z\)])(\d)` "auto subscript" iAm
`` rv = m[1] + "_" + m[2]``
endsnippet
snippet `([A-Za-z\)])_(\d{2})` "auto subscript" iAm
`` rv = m[1] + "_(" + m[2] + ")" ``
endsnippet
snippet `(?<![A-Za-z])([A-Za-hk-z])([acdijkmnpqrstABCDIJKMNPQRST])\2` "auto subscript" iAm
`` rv = m[1] + "_" + m[2] ``
endsnippet
# Custom: Add more greek letters
snippet `(\)|mu|alpha|sigma|rho|beta|gamma|delta|zeta|eta|varepsilon|epsilon|theta|iota|kappa|vartheta|lambda|nu|pi|rho|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)([acdijkmnpqrstABCDIJKMNPQRST])\2` "auto subscript for greek letter" iAm
`` rv = m[1] + "_" + m[2].substring(0, 1) ``
endsnippet
snippet `(?<![A-Za-z])([A-Za-hk-z01])(grave|acute|hat|tilde|macron|breve|dot|ddot|dddot|ddddot|diaer|circle|caron|vec|upright|italic|b|sans|frak|mono|bb|cal|ov)` "hat" iAm
``
const map = { "ddot": "dot.double", "dddot": "dot.triple", "ddddot": "dot.quad", "vec": "arrow", "b": "bold", "ov": "overline" }
rv = (map[m[2]] || m[2]) + "(" + m[1] + ")"
``
endsnippet
snippet `(mu|alpha|sigma|rho|beta|gamma|delta|zeta|eta|varepsilon|epsilon|theta|iota|kappa|vartheta|lambda|nu|pi|rho|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(grave|acute|hat|tilde|macron|breve|dot|ddot|dddot|ddddot|diaer|circle|caron|vec|upright|italic|b|sans|frak|mono|bb|cal|ov)` "hat" iAm
``
const map = { "ddot": "dot.double", "dddot": "dot.triple", "ddddot": "dot.quad", "vec": "arrow", "b": "bold", "ov": "overline" }
rv = (map[m[2]] || m[2]) + "(" + m[1] + ")"
``
endsnippet
snippet `((grave|acute|hat|tilde|macron|breve|dot|dot\.double|dot\.triple|dot\.quad|diaer|circle|acute\.double|caron|arrow|arrow\.l|upright|italic|bold|sans|frak|mono|bb|cal)\([a-zA-Z\d]+\))(grave|acute|hat|tilde|macron|breve|dot|ddot|dddot|ddddot|diaer|circle|caron|vec|upright|italic|b|sans|frak|mono|bb|cal|ov)` "hat" iAm
``
const map = { "ddot": "dot.double", "dddot": "dot.triple", "ddddot": "dot.quad", "vec": "arrow", "b": "bold", "ov": "overline" }
rv = (map[m[3]] || m[3]) + "(" + m[1] + ")"
``
endsnippet
snippet `(?<!\.)alt` "alt" iAm
.alt
endsnippet
snippet invs "inverse" iAm
^(-1)
endsnippet
snippet xl "vector" iAm
arrow(${1:x})
endsnippet
snippet @< "angle" iAm
angle.l ${1:x} angle.r
endsnippet
snippet HL "highlight" iA
#highlight[${VISUAL}]
endsnippet
snippet iiint "triple integral" iAm
integral.triple ${1}
endsnippet
snippet oint "closed line integral" iAm
integral.cont ${1}
endsnippet
snippet iint "double integral" iAm
integral.double ${1}
endsnippet
snippet int "integral" iAm
integral ${1}
endsnippet
snippet // "frac" iAm
frac(${1:1}, ${2:2})
endsnippet

View file

@ -1,79 +1,79 @@
" ~/.config/vscode/vscode.vimrc
" New-Item -ItemType SymbolicLink -Path ~\.config\vscode\vscode.vimrc -Target ~\.dotfiles\vscode\vscode.vimrc
" ln -sf $DOTFILES/vscode/vscode.vimrc $XDG_CONFIG_HOME/vscode/vscode.vimrc
" And go to vscode vim setting:
"vim.vimrc.path": "$HOME/.config/vscode/vscode.vimrc",
" For all available options see
" https://github.com/VSCodeVim/Vim/blob/d41e286e9238b004f02b425d082d3b4181d83368/src/configuration/vimrc.ts#L120-L407
" Use VSpaceCode instead of <leader>
noremap <space> vspacecode.space
" Switch between tabs
nnoremap H :bprevious<CR>
nnoremap L :bnext<CR>
vnoremap H ^
xnoremap H ^
onoremap H ^
vnoremap L $
xnoremap L $
onoremap L $
noremap J 5j
noremap K 5k
" Similar position to i
" The `noremap` implements text-object-like behavior in VSCodeVim
" Y to yank to end of line
noremap Y y$
nnoremap <esc> removeSecondaryCursors
" lsp
noremap gi editor.action.goToImplementation
noremap gpi editor.action.peekImplementation
noremap gd editor.action.goToDefinition
noremap gpd editor.action.peekDefinition
noremap gt editor.action.goToTypeDefinition
noremap gpt editor.action.peekTypeDefinition
noremap gh editor.action.showDefinitionPreviewHover
noremap gr editor.action.goToReferences
noremap gpr editor.action.referenceSearch.trigger
noremap ga editor.action.quickFix
" Rename, or [c]hange [d]efinition
nnoremap cd editor.action.rename
" Requires matchit by redguardtoo
" nnoremap % extension.matchitJumpItems
noremap zR editor.foldAll
" keep selection after indent
vnoremap < editor.action.outdentLines
vnoremap > editor.action.indentLines
nnoremap [g editor.action.editor.previousChange
nnoremap ]g editor.action.editor.nextChange
" 分词版本的w和b支持中文需要插件
" 为了保证递归解析,而不是打断,使用 `nmap` 而不是 `nnoremap`
" Comment if you don't use cjk or the plugin
" This is buggy
"nmap w cjkWordHandler.cursorWordEndRight
"nmap b cjkWordHandler.cursorWordStartLeft
" <C-w> will be parsed by VSCode itself.
" noremap <C-w>n <C-w>j
" noremap <C-w>e <C-w>k
" noremap <C-w>i <C-w>l
" noremap <C-w>x workbench.action.toggleEditorGroupLayout
" " Use C-w C-w as original C-w
" noremap <C-w><C-w> workbench.action.closeActiveEditor
" noremap <C-w><A-n> workbench.action.togglePanel
" ~/.config/vscode/vscode.vimrc
" New-Item -ItemType SymbolicLink -Path ~\.config\vscode\vscode.vimrc -Target ~\.dotfiles\vscode\vscode.vimrc
" ln -sf $DOTFILES/vscode/vscode.vimrc $XDG_CONFIG_HOME/vscode/vscode.vimrc
" And go to vscode vim setting:
"vim.vimrc.path": "$HOME/.config/vscode/vscode.vimrc",
" For all available options see
" https://github.com/VSCodeVim/Vim/blob/d41e286e9238b004f02b425d082d3b4181d83368/src/configuration/vimrc.ts#L120-L407
" Use VSpaceCode instead of <leader>
noremap <space> vspacecode.space
" Switch between tabs
nnoremap H :bprevious<CR>
nnoremap L :bnext<CR>
vnoremap H ^
xnoremap H ^
onoremap H ^
vnoremap L $
xnoremap L $
onoremap L $
noremap J 5j
noremap K 5k
" Similar position to i
" The `noremap` implements text-object-like behavior in VSCodeVim
" Y to yank to end of line
noremap Y y$
nnoremap <esc> removeSecondaryCursors
" lsp
noremap gi editor.action.goToImplementation
noremap gpi editor.action.peekImplementation
noremap gd editor.action.goToDefinition
noremap gpd editor.action.peekDefinition
noremap gt editor.action.goToTypeDefinition
noremap gpt editor.action.peekTypeDefinition
noremap gh editor.action.showDefinitionPreviewHover
noremap gr editor.action.goToReferences
noremap gpr editor.action.referenceSearch.trigger
noremap ga editor.action.quickFix
" Rename, or [c]hange [d]efinition
nnoremap cd editor.action.rename
" Requires matchit by redguardtoo
" nnoremap % extension.matchitJumpItems
noremap zR editor.foldAll
" keep selection after indent
vnoremap < editor.action.outdentLines
vnoremap > editor.action.indentLines
nnoremap [g editor.action.editor.previousChange
nnoremap ]g editor.action.editor.nextChange
" 分词版本的w和b支持中文需要插件
" 为了保证递归解析,而不是打断,使用 `nmap` 而不是 `nnoremap`
" Comment if you don't use cjk or the plugin
" This is buggy
"nmap w cjkWordHandler.cursorWordEndRight
"nmap b cjkWordHandler.cursorWordStartLeft
" <C-w> will be parsed by VSCode itself.
" noremap <C-w>n <C-w>j
" noremap <C-w>e <C-w>k
" noremap <C-w>i <C-w>l
" noremap <C-w>x workbench.action.toggleEditorGroupLayout
" " Use C-w C-w as original C-w
" noremap <C-w><C-w> workbench.action.closeActiveEditor
" noremap <C-w><A-n> workbench.action.togglePanel

View file

@ -1,18 +1,18 @@
fork = false
frame = "full"
idle = true
maximized = false
no-multigrid = false
srgb = false
tabs = true
theme = "auto"
title-hidden = true
vsync = false
wsl = true
[font]
normal = [
"Iosevka Nerd Font",
"霞鹜文楷等宽",
] # Will use the bundled Fira Code Nerd Font by default
size = 14.0
fork = false
frame = "full"
idle = true
maximized = false
no-multigrid = false
srgb = false
tabs = true
theme = "auto"
title-hidden = true
vsync = false
wsl = true
[font]
normal = [
"Iosevka Nerd Font",
"霞鹜文楷等宽",
] # Will use the bundled Fira Code Nerd Font by default
size = 14.0

View file

@ -1,82 +1,82 @@
# Windows dotfiles
![Windows](../../_assets/windows-1.png)
- Terminal Emulator: [WezTerm](../../tools/wezterm/)
- Tiling Window Manager: [GlazeWM](./glzr/glazewm/config.yaml)
- Status Bar: [Zebar](./glzr/zebar/settings.json)
- Quake Terminal: [Windows Terminal](./WindowsTerminal.json)
- Shell: [PowerShell Core](../../tools/powershell/readme.md)
- WSL1: [Arch Linux](https://github.com/yuk7/ArchWSL)
- WSL2: kali-linux
By following the Windows Directory Standard, assign the following directories corresponding to `$XDG_CONFIG` in Unix, some of the software(like `wezterm`) will use these directories as the default configuration path:
| Windows Path | XDG-Equivalent | Default |
|------------|----------|----------|
| `%APPDATA%` | `$XDG_CONFIG_HOME` | `%USERPROFILE%\AppData\Roaming` |
| `%LOCALAPPDATA%` | `$XDG_DATA_HOME` | `%USERPROFILE%\AppData\Local` |
| `%LOCALAPPDATA%\Cache` | `$XDG_CACHE_HOME` | `%USERPROFILE%\AppData\Local\Cache` |
| `%LOCALAPPDATA%\State` | `$XDG_STATE_HOME` | `%USERPROFILE%\AppData\Local\State` |
An example bootstrap script is provided in [bootstrap/Windows.ps1](../../bootstrap/Windows.ps1), which will create necessary directories and link the files.
## PowerShell Profile
This is the *[PowerShell Core](https://github.com/PowerShell/PowerShell)* profile, not the legacy *Windows PowerShell* profile, which is faster(`powershell` vs `pwsh`, `pwsh` types 6 letters less lol), cross-platform and compatible with Unix.
By default, PowerShell profile is stored in `%UserProfile%\Documents\PowerShell\Microsoft.PowerShell_profile.ps1`.
It is convenient to use `$PROFILE` to locate the profile file.
```powershell
Test-Path $PROFILE
```
Just like Unix Shell, there are configs work for different sessions. To locate them, use `select *` followed by `$PROFILE`.
If you want to change the `AllUsers` scoped profile, do not install `pwsh` via `winget`, use `scoop` instead, since `winget` will install `pwsh` to `%ProgramFiles%\PowerShell\7\pwsh.exe`, which is read-only even with Administrator privileges.
```powershell
PS > $PROFILE | Select *
AllUsersAllHosts : C:\Users\jsony\scoop\apps\pwsh\current\profile.ps1
AllUsersCurrentHost : C:\Users\jsony\scoop\apps\pwsh\current\Microsoft.PowerShell_profile.ps1
CurrentUserAllHosts : C:\Users\jsony\Documents\PowerShell\profile.ps1
CurrentUserCurrentHost : C:\Users\jsony\Documents\PowerShell\Microsoft.PowerShell_profile.ps1
Length : 68
```
Note that the variable `$PROFILE.*` are constants, the only way to change it is to compile your own `pwsh`
To link the profile file:
```powershell
New-Item -ItemType SymbolicLink -Path $PROFILE -Target "$DOTFILES\win\Microsoft.PowerShell_profile.ps1" -Force
```
I use [starship](https://starship.rs/) to customize the prompt, which is located in [`tools/starship/starship_pwsh.toml`](../../tools/starship/starship_pwsh.toml). This prompt config is cross-platform for powershell core, since I use the prompt to identify the shell.
## `.wslconfig` - WSL2 Configuration
`.wslconfig` only supports `%UserProfile%\.wslconfig` as the configuration path
```powershell
New-Item -ItemType SymbolicLink -Path "$Env:UserProfile\.wslconfig" -Target "$DOTFILES\win\.wslconfig" -Force
```
<!--
## Windows Terminal
Use Hard Link to sync Windows Terminal Settings since it doesn't support symlink.
```powershell
New-Item -ItemType HardLink -Path "$Env:LocalAppData\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json" -Target "$DOTFILES\win\WindowsTerminal.json" -Force
```
-->
## Neovide
Neovide configuration is (only) stored in `%APPDATA%\neovide\config.toml`
```powershell
New-Item -ItemType SymbolicLink -Path "$Env:AppData\neovide\config.toml" -Target "$DOTFILES\win\neovide.toml" -Force
# Windows dotfiles
![Windows](../../_assets/windows-1.png)
- Terminal Emulator: [WezTerm](../../tools/wezterm/)
- Tiling Window Manager: [GlazeWM](./glzr/glazewm/config.yaml)
- Status Bar: [Zebar](./glzr/zebar/settings.json)
- Quake Terminal: [Windows Terminal](./WindowsTerminal.json)
- Shell: [PowerShell Core](../../tools/powershell/readme.md)
- WSL1: [Arch Linux](https://github.com/yuk7/ArchWSL)
- WSL2: kali-linux
By following the Windows Directory Standard, assign the following directories corresponding to `$XDG_CONFIG` in Unix, some of the software(like `wezterm`) will use these directories as the default configuration path:
| Windows Path | XDG-Equivalent | Default |
|------------|----------|----------|
| `%APPDATA%` | `$XDG_CONFIG_HOME` | `%USERPROFILE%\AppData\Roaming` |
| `%LOCALAPPDATA%` | `$XDG_DATA_HOME` | `%USERPROFILE%\AppData\Local` |
| `%LOCALAPPDATA%\Cache` | `$XDG_CACHE_HOME` | `%USERPROFILE%\AppData\Local\Cache` |
| `%LOCALAPPDATA%\State` | `$XDG_STATE_HOME` | `%USERPROFILE%\AppData\Local\State` |
An example bootstrap script is provided in [bootstrap/Windows.ps1](../../bootstrap/Windows.ps1), which will create necessary directories and link the files.
## PowerShell Profile
This is the *[PowerShell Core](https://github.com/PowerShell/PowerShell)* profile, not the legacy *Windows PowerShell* profile, which is faster(`powershell` vs `pwsh`, `pwsh` types 6 letters less lol), cross-platform and compatible with Unix.
By default, PowerShell profile is stored in `%UserProfile%\Documents\PowerShell\Microsoft.PowerShell_profile.ps1`.
It is convenient to use `$PROFILE` to locate the profile file.
```powershell
Test-Path $PROFILE
```
Just like Unix Shell, there are configs work for different sessions. To locate them, use `select *` followed by `$PROFILE`.
If you want to change the `AllUsers` scoped profile, do not install `pwsh` via `winget`, use `scoop` instead, since `winget` will install `pwsh` to `%ProgramFiles%\PowerShell\7\pwsh.exe`, which is read-only even with Administrator privileges.
```powershell
PS > $PROFILE | Select *
AllUsersAllHosts : C:\Users\jsony\scoop\apps\pwsh\current\profile.ps1
AllUsersCurrentHost : C:\Users\jsony\scoop\apps\pwsh\current\Microsoft.PowerShell_profile.ps1
CurrentUserAllHosts : C:\Users\jsony\Documents\PowerShell\profile.ps1
CurrentUserCurrentHost : C:\Users\jsony\Documents\PowerShell\Microsoft.PowerShell_profile.ps1
Length : 68
```
Note that the variable `$PROFILE.*` are constants, the only way to change it is to compile your own `pwsh`
To link the profile file:
```powershell
New-Item -ItemType SymbolicLink -Path $PROFILE -Target "$DOTFILES\win\Microsoft.PowerShell_profile.ps1" -Force
```
I use [starship](https://starship.rs/) to customize the prompt, which is located in [`tools/starship/starship_pwsh.toml`](../../tools/starship/starship_pwsh.toml). This prompt config is cross-platform for powershell core, since I use the prompt to identify the shell.
## `.wslconfig` - WSL2 Configuration
`.wslconfig` only supports `%UserProfile%\.wslconfig` as the configuration path
```powershell
New-Item -ItemType SymbolicLink -Path "$Env:UserProfile\.wslconfig" -Target "$DOTFILES\win\.wslconfig" -Force
```
<!--
## Windows Terminal
Use Hard Link to sync Windows Terminal Settings since it doesn't support symlink.
```powershell
New-Item -ItemType HardLink -Path "$Env:LocalAppData\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json" -Target "$DOTFILES\win\WindowsTerminal.json" -Force
```
-->
## Neovide
Neovide configuration is (only) stored in `%APPDATA%\neovide\config.toml`
```powershell
New-Item -ItemType SymbolicLink -Path "$Env:AppData\neovide\config.toml" -Target "$DOTFILES\win\neovide.toml" -Force
```

View file

@ -1,369 +0,0 @@
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command":
{
"action": "copy",
"singleLine": false
},
"id": "User.copy.644BA8F2",
"keys": "ctrl+c"
},
{
"command": "paste",
"id": "User.paste",
"keys": "ctrl+v"
},
{
"command": "find",
"id": "User.find",
"keys": "ctrl+shift+f"
},
{
"command":
{
"action": "splitPane",
"split": "auto",
"splitMode": "duplicate"
},
"id": "User.splitPane.A6751878",
"keys": "alt+shift+d"
}
],
"alwaysShowNotificationIcon": true,
"copyFormatting": "none",
"copyOnSelect": false,
"defaultInputScope": "alphanumericHalfWidth",
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"focusFollowMouse": false,
"language": "zh-Hans",
"minimizeToNotificationArea": false,
"newTabMenu":
[
{
"type": "remainingProfiles"
}
],
"profiles":
{
"defaults":
{
"adjustIndistinguishableColors": "always",
"antialiasingMode": "cleartype",
"autoMarkPrompts": true,
"backgroundImageOpacity": 0.3,
"colorScheme": "Catppuccin Mocha",
"compatibility.reloadEnvironmentVariables": false,
"experimental.retroTerminalEffect": false,
"font":
{
"colorGlyphs": true,
"face": "CaskaydiaCove Nerd Font",
"features":
{
"rlig": 1
}
},
"opacity": 40,
"scrollbarState": "visible",
"showMarksOnScrollbar": true,
"useAcrylic": true
},
"list":
[
{
"colorScheme": "Catppuccin Frappe",
"commandline": "\"C:\\Program Files\\WindowsApps\\Microsoft.PowerShell_7.4.6.0_x64__8wekyb3d8bbwe\\pwsh.exe\"",
"guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"hidden": false,
"name": "PowerShell",
"opacity": 50,
"source": "Windows.Terminal.PowershellCore",
"tabTitle": "PS"
},
{
"colorScheme": "Tokyo Night",
"commandline": "C:\\WINDOWS\\system32\\wsl.exe -d Arch",
"guid": "{a5a97cb8-8961-5535-816d-772efe0c6a3f}",
"hidden": false,
"icon": "D:\\Assets\\Icons\\arch.png",
"name": "Arch",
"source": "Windows.Terminal.Wsl"
},
{
"colorScheme": "Catppuccin Macchiato",
"commandline": "\"C:\\Program Files\\WindowsApps\\Microsoft.PowerShell_7.4.6.0_x64__8wekyb3d8bbwe\\pwsh.exe\"",
"elevate": true,
"guid": "{ed7f021f-014d-4ca8-b3f2-811f745950db}",
"hidden": false,
"icon": "ms-appx:///ProfileIcons/pwsh.png",
"name": "Admin",
"opacity": 100,
"startingDirectory": "%USERPROFILE%",
"tabTitle": "Root"
},
{
"colorScheme": "Ubuntu-ColorScheme",
"commandline": "C:\\WINDOWS\\system32\\wsl.exe -d Ubuntu-22.04",
"font":
{
"face": "CaskaydiaCove Nerd Font"
},
"guid": "{c1061641-0172-4aec-b52d-dfc2b991553a}",
"hidden": false,
"icon": "D:\\Assets\\Icons\\ubuntu.png",
"name": "Ubuntu",
"startingDirectory": "~"
},
{
"colorScheme": "Catppuccin Frappe",
"commandline": "C:\\Users\\citoy\\AppData\\Local\\Programs\\nu\\bin\\nu.exe",
"guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"hidden": false,
"name": "PowerShell",
"opacity": 50,
"source": "Windows.Terminal.PowershellCore",
"tabTitle": "PS"
},
{
"guid": "{2ece5bfe-50ed-5f3a-ab87-5cd4baafed2b}",
"hidden": false,
"name": "Git Bash",
"source": "Git"
},
{
"colorScheme": "Solarized Light",
"commandline": "\"C:\\Program Files\\WindowsApps\\Microsoft.PowerShell_7.4.6.0_x64__8wekyb3d8bbwe\\pwsh.exe\"",
"guid": "{39030c99-17fd-4feb-913f-c149a2826247}",
"hidden": false,
"icon": "ms-appx:///ProfileIcons/pwsh.png",
"name": "Light",
"opacity": 100,
"startingDirectory": "%USERPROFILE%",
"tabTitle": "PS",
"useAcrylic": true
}
]
},
"schemes":
[
{
"background": "#303446",
"black": "#51576D",
"blue": "#8CAAEE",
"brightBlack": "#626880",
"brightBlue": "#8CAAEE",
"brightCyan": "#81C8BE",
"brightGreen": "#A6D189",
"brightPurple": "#F4B8E4",
"brightRed": "#E78284",
"brightWhite": "#A5ADCE",
"brightYellow": "#E5C890",
"cursorColor": "#F2D5CF",
"cyan": "#81C8BE",
"foreground": "#C6D0F5",
"green": "#A6D189",
"name": "Catppuccin Frappe",
"purple": "#F4B8E4",
"red": "#E78284",
"selectionBackground": "#626880",
"white": "#B5BFE2",
"yellow": "#E5C890"
},
{
"background": "#EFF1F5",
"black": "#5C5F77",
"blue": "#1E66F5",
"brightBlack": "#ACB0BE",
"brightBlue": "#1E66F5",
"brightCyan": "#179299",
"brightGreen": "#40A02B",
"brightPurple": "#EA76CB",
"brightRed": "#D20F39",
"brightWhite": "#BCC0CC",
"brightYellow": "#DF8E1D",
"cursorColor": "#DC8A78",
"cyan": "#179299",
"foreground": "#4C4F69",
"green": "#40A02B",
"name": "Catppuccin Latte",
"purple": "#EA76CB",
"red": "#D20F39",
"selectionBackground": "#ACB0BE",
"white": "#ACB0BE",
"yellow": "#DF8E1D"
},
{
"background": "#24273A",
"black": "#494D64",
"blue": "#8AADF4",
"brightBlack": "#5B6078",
"brightBlue": "#8AADF4",
"brightCyan": "#8BD5CA",
"brightGreen": "#A6DA95",
"brightPurple": "#F5BDE6",
"brightRed": "#ED8796",
"brightWhite": "#A5ADCB",
"brightYellow": "#EED49F",
"cursorColor": "#F4DBD6",
"cyan": "#8BD5CA",
"foreground": "#CAD3F5",
"green": "#A6DA95",
"name": "Catppuccin Macchiato",
"purple": "#F5BDE6",
"red": "#ED8796",
"selectionBackground": "#5B6078",
"white": "#B8C0E0",
"yellow": "#EED49F"
},
{
"background": "#1E1E2E",
"black": "#45475A",
"blue": "#89B4FA",
"brightBlack": "#585B70",
"brightBlue": "#89B4FA",
"brightCyan": "#94E2D5",
"brightGreen": "#A6E3A1",
"brightPurple": "#F5C2E7",
"brightRed": "#F38BA8",
"brightWhite": "#A6ADC8",
"brightYellow": "#F9E2AF",
"cursorColor": "#F5E0DC",
"cyan": "#94E2D5",
"foreground": "#CDD6F4",
"green": "#A6E3A1",
"name": "Catppuccin Mocha",
"purple": "#F5C2E7",
"red": "#F38BA8",
"selectionBackground": "#585B70",
"white": "#BAC2DE",
"yellow": "#F9E2AF"
},
{
"background": "#1A1B2C",
"black": "#414868",
"blue": "#7AA2F7",
"brightBlack": "#414868",
"brightBlue": "#7AA2F7",
"brightCyan": "#7DCFFF",
"brightGreen": "#73DACA",
"brightPurple": "#BB9AF7",
"brightRed": "#F7768E",
"brightWhite": "#C0CAF5",
"brightYellow": "#E0AF68",
"cursorColor": "#C0CAF5",
"cyan": "#7DCFFF",
"foreground": "#A9B1DC",
"green": "#73DACA",
"name": "Tokyo Night",
"purple": "#BB9AF7",
"red": "#F7768E",
"selectionBackground": "#28344A",
"white": "#C0CAF5",
"yellow": "#E0AF68"
}
],
"showTabsInTitlebar": true,
"startOnUserLogin": true,
"tabWidthMode": "titleLength",
"theme": "Catppuccin Macchiato",
"themes":
[
{
"name": "Catppuccin Frappe",
"tab":
{
"background": "#303446FF",
"iconStyle": "default",
"showCloseButton": "always",
"unfocusedBackground": null
},
"tabRow":
{
"background": "#292C3CFF",
"unfocusedBackground": "#232634FF"
},
"window":
{
"applicationTheme": "dark",
"experimental.rainbowFrame": false,
"frame": null,
"unfocusedFrame": null,
"useMica": false
}
},
{
"name": "Catppuccin Latte",
"tab":
{
"background": "#EFF1F5FF",
"iconStyle": "default",
"showCloseButton": "always",
"unfocusedBackground": null
},
"tabRow":
{
"background": "#E6E9EFFF",
"unfocusedBackground": "#DCE0E8FF"
},
"window":
{
"applicationTheme": "light",
"experimental.rainbowFrame": false,
"frame": null,
"unfocusedFrame": null,
"useMica": false
}
},
{
"name": "Catppuccin Macchiato",
"tab":
{
"background": "#24273AFF",
"iconStyle": "default",
"showCloseButton": "always",
"unfocusedBackground": null
},
"tabRow":
{
"background": "#1E2030FF",
"unfocusedBackground": "#181926FF"
},
"window":
{
"applicationTheme": "dark",
"experimental.rainbowFrame": false,
"frame": null,
"unfocusedFrame": null,
"useMica": false
}
},
{
"name": "Catppuccin Mocha",
"tab":
{
"background": "#1E1E2EFF",
"iconStyle": "default",
"showCloseButton": "always",
"unfocusedBackground": null
},
"tabRow":
{
"background": "#181825FF",
"unfocusedBackground": "#11111BFF"
},
"window":
{
"applicationTheme": "dark",
"experimental.rainbowFrame": false,
"frame": null,
"unfocusedFrame": null,
"useMica": false
}
}
],
"useAcrylicInTabRow": true
}

View file

@ -1,16 +0,0 @@
# Append to original bashrc for minimal setup
# echo $DOTFILES/wsl/.bashrc >> ~/.bashrc
bind 'set show-mode-in-prompt on'
set -o vi
bind -m vi-command '"n": next-history'
bind -m vi-command '"e": previous-history'
bind -m vi-command '"l": vi-insertion-mode'
bind -m vi-command '"L": vi-insert-beg'
bind -m vi-command '"i": forward-char'
# bind -m vi-insert '"\C-r": reverse-search-history"'
# bind -m vi-insert '"\C-l": clear-screen'
bind -m vi-command '"j": vi-end-word'
bind -m vi-command '"J": vi-end-word'

View file

@ -1,9 +0,0 @@
# $DOTFILES/platforms/wsl/zshrc
# Date: 2024-12-01
# Author: js0ny
# Sourced by user's zshrc if is WSL 在用户的 zshrc 中被引用WSL 特定配置
# Entry point in $DOTFILES/tools/zsh/common.zshrc (入口点)
### Variables ###
export IS_WSL=true
source $DOTFILES/platforms/wsl/winterop.zsh

View file

@ -1,49 +0,0 @@
[ids]
*
[main]
# Maps capslock to escape when pressed and control when held. tab=overload(lt1, tab) # backspace=\
# \=backspace
# backspace=\
# capslock=overload(ctrl,esc)
capslock = overload(control, esc)
tab = overload(lt2, tab)
space = overload(lt1, space)
insert = S-insert
[lt1]
h = left
n = down
e = up
i = right
1 = f1
2 = f2
3 = f3
4 = f4
5 = f5
6 = f6
7 = f7
8 = f8
9 = f9
0 = f10
- = f11
= = f12
k = home
o = end
[ = pageup
] = pagedown
q = ~
w = |
f = &
p = ^
/ = ¿
[lt2]
space = playpause
h = previoussong
i = nextsong
n = volumedown
e = volumeup
k = mute