sync: from Windows

This commit is contained in:
js0ny 2024-11-30 03:38:53 +00:00
parent 16d9d1348b
commit fd3ecfd674
15 changed files with 2581 additions and 29 deletions

41
.config/.vsvimrc Normal file
View file

@ -0,0 +1,41 @@
" This is the `vimrc` config for VSVim (Visual Studio Vim Emulator)
" Put it in %Vim%\.vsvimrc
" Colemak Keys
" Arrow remap
noremap n j
noremap e k
noremap i l
noremap H 0
noremap N 5j
noremap E 5k
noremap I $
" Similar position to i
noremap l i
noremap L I
" ne[k]st
noremap k n
noremap K N
" [j]ump
noremap j e
noremap J E
" Normal minimal setup
noremap Y y$
set expandtab
set tabstop=4
set shiftwidth=4
set autoindent
set smartindent
set wrap
set scrolloff=3
set hlsearch
set incsearch
set ignorecase
set smartcase
set number
set relativenumber

View file

@ -0,0 +1,62 @@
// ~\.config\fastfetch\config.jsonc
{
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
"logo": {
// "type": "auto",
"source": "Windows 7",
"padding": {
"top": 2,
"left": 1,
"right": 2
}
},
"general": {
"multithreading": true
},
"display": {
"separator": " ",
"key": {
"width": 10,
"paddingLeft": 2,
"type": "icon"
}
},
"modules": [
{
"type": "title",
"format": "{#1}───────────── {#}{user-name-colored}@{host-name-colored}"
},
{
"type": "colors",
"symbol": "diamond",
"paddingLeft": 15
},
"os",
"host",
"kernel",
"uptime",
{
"type": "packages"
},
"shell",
"display",
"de",
"wm",
"wmtheme",
"theme",
"icons",
"font",
"cursor",
"terminal",
"terminalfont",
"cpu",
"gpu",
"memory",
"swap",
"disk",
"localip",
"battery",
"poweradapter",
"locale"
]
}

View file

@ -8,6 +8,7 @@
[core] [core]
editor = nvim editor = nvim
pager = delta pager = delta
autocrlf = input
[interactive] [interactive]
diffFilter = delta --color-only diffFilter = delta --color-only
[delta] [delta]
@ -18,5 +19,3 @@
smudge = git-lfs smudge -- %f smudge = git-lfs smudge -- %f
process = git-lfs filter-process process = git-lfs filter-process
required = true required = true
[safe]
directory = %(prefix)///wsl.localhost/Arch/home/js0ny/inf2c/coursework-2-mips-simulator-js0ny

View file

@ -5,9 +5,8 @@
let mapleader = " " " set <leader> to <space> let mapleader = " " " set <leader> to <space>
""" Colemak """ """ Colemak """
" Word wrap noremap n j
noremap n gj noremap e k
noremap e gk
noremap i l noremap i l
" Similar position to i " Similar position to i

View file

@ -20,3 +20,8 @@ indent_size = 2
[*.{json,toml,js,lua,yaml,yml}] [*.{json,toml,js,lua,yaml,yml}]
indent_size = 2 indent_size = 2
indent_style = space indent_style = space
[*.{bat}]
# Empty ruleset to skip global settings
# charset = gbk # Not available
# end_of_line = crlf

View file

@ -23,3 +23,6 @@ Set-PSReadLineKeyHandler -Chord "N" -Function ViJoinLines -ViMode Command
Set-PSReadLineKeyHandler -Chord "Control+Oem4" -Function ViCommandMode -ViMode Insert # ^[ to Escape Set-PSReadLineKeyHandler -Chord "Control+Oem4" -Function ViCommandMode -ViMode Insert # ^[ to Escape
Set-PSReadLineKeyHandler -Chord "Ctrl+a" -Function BeginningOfLine Set-PSReadLineKeyHandler -Chord "Ctrl+a" -Function BeginningOfLine
Set-PSReadLineKeyHandler -Chord "Ctrl+e" -Function EndOfLine Set-PSReadLineKeyHandler -Chord "Ctrl+e" -Function EndOfLine
## Use <Tab> to Invoke MenuComplete
Set-PSReadLineKeyHandler -Key Tab -Function MenuComplete

View file

@ -82,7 +82,8 @@ New-Item -ItemType Directory -Path "$Env:AppData\less" -Force
New-Item -ItemType Directory -Path "$Env:XDG_STATE_HOME\node" -Force 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") [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 # ~\.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") # NOTE: ts-node doesn't support this yet
# [System.Environment]::SetEnvironmentVariable("TS_NODE_REPL_HISTORY", "$Env:XDG_STATE_HOME\node\ts_node_repl_history", "User")
# ~\.nuget\packages -> %LocalAppData%\cache\NuGet\packages :: NuGet # ~\.nuget\packages -> %LocalAppData%\cache\NuGet\packages :: NuGet
[System.Environment]::SetEnvironmentVariable("NUGET_PACKAGES", "$Env:XDG_CACHE_HOME\NuGet\packages", "User") [System.Environment]::SetEnvironmentVariable("NUGET_PACKAGES", "$Env:XDG_CACHE_HOME\NuGet\packages", "User")
# ~\.omnisharp -> %AppData%\OmniSharp :: OmniSharp # ~\.omnisharp -> %AppData%\OmniSharp :: OmniSharp
@ -96,6 +97,7 @@ New-Item -ItemType Directory -Path "$Env:XDG_STATE_HOME\python" -Force
# ~\.vimrc -> %AppData%\Vim\_vimrc :: Vim # ~\.vimrc -> %AppData%\Vim\_vimrc :: Vim
New-Item -ItemType Directory -Path "$Env:AppData\Vim" -Force New-Item -ItemType Directory -Path "$Env:AppData\Vim" -Force
[System.Environment]::SetEnvironmentVariable("VIM", "$Env:AppData\Vim", "User") [System.Environment]::SetEnvironmentVariable("VIM", "$Env:AppData\Vim", "User")
[System.Environment]::SetEnvironmentVariable("KOMOREBI_CONFIG_HOME", "$Env:AppData\komorebi", "User")
# ~\.vuerc -> %AppData%\vue\.vuerc :: Vue CLI # ~\.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 # 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") # [System.Environment]::SetEnvironmentVariable("VUE_CLI_CONFIG_PATH", "$Env:AppData\vue\.vuerc", "User")

View file

@ -7,7 +7,7 @@ Get-ChildItem -Path $DOTFILES\powershell_private -Filter *.ps1 | ForEach-Object
# Shell Equivalents # # Shell Equivalents #
Set-Alias "grep" "Select-String" Set-Alias "grep" "Select-String"
${function:which} = { (Get-Command $args[0]).Path } ${function:which} = { (Get-Command $args[0]) }
# Shell Configurations # # Shell Configurations #
${function:shcfg} = { code $PROFILE } ${function:shcfg} = { code $PROFILE }
@ -15,12 +15,6 @@ ${function:reload} = { & $PROFILE }
${function:pulldots} = { Set-Location -Path $DOTFILES && git pull } ${function:pulldots} = { Set-Location -Path $DOTFILES && git pull }
Set-Alias "pwshcfg" "shcfg" Set-Alias "pwshcfg" "shcfg"
# C & C++ #
# Set-Alias "cl" "clang"
# Set-Alias "clpp" "clang++"
# ${function:clang} = { clang -std=c99 $args[0] }
# ${function:clang++} = { clang -std=c++2b $args[0] }
# WSL # # WSL #
${function:wsl1} = {wsl.exe --distribution Arch} ${function:wsl1} = {wsl.exe --distribution Arch}
${function:wsl2} = {wsl.exe --distribution Ubuntu-22.04} ${function:wsl2} = {wsl.exe --distribution Ubuntu-22.04}
@ -51,19 +45,7 @@ function Get-AppPackageListLocal {
} }
# Toggle Theme # # Toggle Theme #
function Set-SystemTheme { Set-Alias "dark-mode" "$DOTFILES/win/cmd/dark-mode.bat" # Consistent with macOS (`dark-mode`)
$regPath = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize"
$currentMode = Get-ItemProperty -Path $regPath -Name "AppsUseLightTheme"
if ($currentMode.AppsUseLightTheme -eq 1) {
Set-ItemProperty -Path $regPath -Name "AppsUseLightTheme" -Value 0
Write-Host "已切换到深色模式"
}
else {
Set-ItemProperty -Path $regPath -Name "AppsUseLightTheme" -Value 1
Write-Host "已切换到浅色模式"
}
}
Set-Alias "dark-mode" "Set-SystemTheme" # Consistent with macOS (`dark-mode`)
# Miscs # # Miscs #

32
win/ahk/main.ahk Normal file
View file

@ -0,0 +1,32 @@
; TODO: Update to AHK v2
#[::
Run, C:\Users\citoy\AppData\Local\Programs\Microsoft VS Code\Code.exe
return
#]::
Run, C:\Program Files\Neovide\neovide.exe
return
#b::
Run, C:\Program Files\Zotero\zotero.exe
return
#f::
Run, C:\Program Files\GPSoftware\Directory Opus\dopus.exe
return
#q::
Send !{F4}
return
#r::
Run, C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.21.3231.0_x64__8wekyb3d8bbwe\wt.exe
return
#h::
Send {Left}
return
#n::
Send {Down}
return
#e::
Send {Up}
return
#i::
Send {Right}
return

12
win/cmd/dark-mode.bat Normal file
View file

@ -0,0 +1,12 @@
@REM encoding: GBK
@echo off
set regPath="HKCU\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize"
for /f "usebackq tokens=2*" %%a in (`reg query %regPath% /v AppsUseLightTheme ^| find "REG_DWORD"`) do set currentMode=%%b
if "%currentMode%"=="0x1" (
reg add %regPath% /v AppsUseLightTheme /t REG_DWORD /d 0 /f >nul
echo 已切换到深色模式
) else (
reg add %regPath% /v AppsUseLightTheme /t REG_DWORD /d 1 /f >nul
echo 已切换到浅色模式
)

File diff suppressed because it is too large Load diff

72
win/komorebi/komorebi.ahk Normal file
View file

@ -0,0 +1,72 @@
; Use %KOMOREBI_CONFIG_HOME% Environment Variable to set the path to the config file
#Requires AutoHotkey v2.0.2
#SingleInstance Force
Komorebic(cmd) {
RunWait(format("komorebic.exe {}", cmd), , "Hide")
}
!q:: Komorebic("close")
!m:: Komorebic("minimize")
; Focus windows
#+h:: Komorebic("focus left")
#+n:: Komorebic("focus down")
#+e:: Komorebic("focus up")
#+i:: Komorebic("focus right")
!+[:: Komorebic("cycle-focus previous")
!+]:: Komorebic("cycle-focus next")
; Move windows
!+h:: Komorebic("move left")
!+j:: Komorebic("move down")
!+k:: Komorebic("move up")
!+l:: Komorebic("move right")
; Stack windows
!Left:: Komorebic("stack left")
!Down:: Komorebic("stack down")
!Up:: Komorebic("stack up")
!Right:: Komorebic("stack right")
!;:: Komorebic("unstack")
![:: Komorebic("cycle-stack previous")
!]:: Komorebic("cycle-stack next")
; Resize
!=:: Komorebic("resize-axis horizontal increase")
!-:: Komorebic("resize-axis horizontal decrease")
!+=:: Komorebic("resize-axis vertical increase")
!+_:: Komorebic("resize-axis vertical decrease")
; Manipulate windows
!t:: Komorebic("toggle-float")
!f:: Komorebic("toggle-monocle")
; Window manager options
!+r:: Komorebic("retile")
!p:: Komorebic("toggle-pause")
; Layouts
!x:: Komorebic("flip-layout horizontal")
!y:: Komorebic("flip-layout vertical")
; Workspaces
!1:: Komorebic("focus-workspace 0")
!2:: Komorebic("focus-workspace 1")
!3:: Komorebic("focus-workspace 2")
!4:: Komorebic("focus-workspace 3")
!5:: Komorebic("focus-workspace 4")
!6:: Komorebic("focus-workspace 5")
!7:: Komorebic("focus-workspace 6")
!8:: Komorebic("focus-workspace 7")
; Move windows across workspaces
!+1:: Komorebic("move-to-workspace 0")
!+2:: Komorebic("move-to-workspace 1")
!+3:: Komorebic("move-to-workspace 2")
!+4:: Komorebic("move-to-workspace 3")
!+5:: Komorebic("move-to-workspace 4")
!+6:: Komorebic("move-to-workspace 5")
!+7:: Komorebic("move-to-workspace 6")
!+8:: Komorebic("move-to-workspace 7")

View file

@ -0,0 +1,76 @@
{
"$schema": "https://raw.githubusercontent.com/LGUG2Z/komorebi/v0.1.30/schema.bar.json",
"monitor": {
"index": 0,
"work_area_offset": {
"left": 0,
"top": 40,
"right": 0,
"bottom": 40
}
},
"font_family": "JetBrains Mono",
"theme": {
"palette": "Base16",
"name": "Ashes",
"accent": "Base0D"
},
"left_widgets": [
{
"Komorebi": {
"workspaces": {
"enable": true,
"hide_empty_workspaces": false
},
"layout": {
"enable": true
},
"focused_window": {
"enable": true,
"show_icon": true
}
}
}
],
"right_widgets": [
{
"Media": {
"enable": true
}
},
{
"Storage": {
"enable": true
}
},
{
"Memory": {
"enable": true
}
},
{
"Network": {
"enable": true,
"show_total_data_transmitted": true,
"show_network_activity": true
}
},
{
"Date": {
"enable": true,
"format": "DayDateMonthYear"
}
},
{
"Time": {
"enable": true,
"format": "TwentyFourHour"
}
},
{
"Battery": {
"enable": true
}
}
]
}

View file

@ -0,0 +1,58 @@
{
"$schema": "https://raw.githubusercontent.com/LGUG2Z/komorebi/v0.1.30/schema.json",
"app_specific_configuration_path": "$Env:USERPROFILE/applications.json",
"window_hiding_behaviour": "Cloak",
"cross_monitor_move_behaviour": "Insert",
"default_workspace_padding": 20,
"default_container_padding": 20,
"border": true,
"border_width": 8,
"border_offset": -1,
"theme": {
"palette": "Base16",
"name": "Ashes",
"unfocused_border": "Base03",
"bar_accent": "Base0D"
},
"stackbar": {
"height": 40,
"mode": "OnStack",
"tabs": {
"width": 300
}
},
"monitors": [
{
"workspaces": [
{
"name": "I",
"layout": "BSP"
},
{
"name": "II",
"layout": "VerticalStack"
},
{
"name": "III",
"layout": "HorizontalStack"
},
{
"name": "IV",
"layout": "UltrawideVerticalStack"
},
{
"name": "V",
"layout": "Rows"
},
{
"name": "VI",
"layout": "Grid"
},
{
"name": "VII",
"layout": "RightMainVerticalStack"
}
]
}
]
}

View file

@ -11,5 +11,5 @@ vsync = false
wsl = true wsl = true
[font] [font]
normal = ["CaskaydiaCove Nerd Font"] # Will use the bundled Fira Code Nerd Font by default normal = ["CaskaydiaCove Nerd Font", "霞鹜文楷等宽"] # Will use the bundled Fira Code Nerd Font by default
size = 14.0 size = 14.0