mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 16:53:00 +00:00
Merge branch 'master' of github.com:js0ny/dotfiles
This commit is contained in:
commit
a7dfb2272c
27 changed files with 523 additions and 160 deletions
|
|
@ -1,9 +1,17 @@
|
||||||
echo "[INFO] Installing Rime"
|
echo "[INFO] Installing Rime"
|
||||||
|
|
||||||
git clone --depth 1 https://github.com/js0ny/rime_wanxiang_pro.git ~/Library/Rime
|
case "$(uname)" in
|
||||||
|
Linux)
|
||||||
|
RIMEDIR="${RIMEDIR:-$HOME/.local/share/fcitx5/rime}"
|
||||||
|
;;
|
||||||
|
Darwin)
|
||||||
|
RIMEDIR="${RIMEDIR:-$HOME/Library/Rime}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
git clone --depth 1 https://github.com/js0ny/rime_wanxiang_pro.git "$RIMEDIR"
|
||||||
cd ~/Library/Rime || exit
|
cd ~/Library/Rime || exit
|
||||||
|
|
||||||
just init
|
just init
|
||||||
# just install_rime
|
# just install_rime
|
||||||
## Rime is installed via Brewfile
|
|
||||||
just clone_plum
|
just clone_plum
|
||||||
|
|
|
||||||
|
|
@ -27,11 +27,24 @@ IS_WSL=0
|
||||||
WINDOWS_USER=""
|
WINDOWS_USER=""
|
||||||
PACKAGE_MANAGER=""
|
PACKAGE_MANAGER=""
|
||||||
|
|
||||||
|
# WSL detection
|
||||||
# NOTE: This is NOT a POSIX-compliant way, for POSIX-compliant way, use case/esac
|
# NOTE: This is NOT a POSIX-compliant way, for POSIX-compliant way, use case/esac
|
||||||
if [[ "$(uname -r)" = *Microsoft* ]]; then
|
if [[ "$(uname -r)" = *icrosoft* ]]; then
|
||||||
echo "[INFO] Running on WSL1 Skipping GUI setup"
|
echo "[INFO] Running on WSL"
|
||||||
IS_WSL=1
|
|
||||||
WINDOWS_USER="$(cmd.exe /c "echo %USERNAME%" | tr -d '\r')"
|
WINDOWS_USER="$(cmd.exe /c "echo %USERNAME%" | tr -d '\r')"
|
||||||
|
IS_WSL=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$IS_WSL" -eq 1 ]; then
|
||||||
|
if [[ "$(uname -r)" = *Microsoft* ]]; then
|
||||||
|
IS_WSL=1
|
||||||
|
elif [[ "$(uname -r)" = *microsoft* ]]; then
|
||||||
|
IS_WSL=2
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$IS_WSL" -eq 1 ]; then
|
||||||
|
echo "[INFO] Running on WSL1 Skipping GUI setup"
|
||||||
else
|
else
|
||||||
read -p "[ACTION] Do you want to setup Linux GUI? (y/N) " -r choice
|
read -p "[ACTION] Do you want to setup Linux GUI? (y/N) " -r choice
|
||||||
case "$choice" in
|
case "$choice" in
|
||||||
|
|
@ -60,7 +73,16 @@ if [ "$WHEEL" -eq 1 ]; then
|
||||||
PACKAGE_MANAGER="pacman"
|
PACKAGE_MANAGER="pacman"
|
||||||
else
|
else
|
||||||
echo "[ERROR] Unsupported package manager"
|
echo "[ERROR] Unsupported package manager"
|
||||||
|
read -p "[ACTION] Do you still want to continue? (y/N) " -r choice
|
||||||
|
case "$choice" in
|
||||||
|
y | Y)
|
||||||
|
:
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "[ERROR] Exiting"
|
||||||
exit 1
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -94,6 +116,8 @@ echo "[INFO] Setting up symbolic links"
|
||||||
|
|
||||||
source "$DOTFILES"/bootstrap/linux/symlinks.bash
|
source "$DOTFILES"/bootstrap/linux/symlinks.bash
|
||||||
|
|
||||||
|
set +x
|
||||||
|
|
||||||
if [ "$WHEEL" -eq 1 ]; then
|
if [ "$WHEEL" -eq 1 ]; then
|
||||||
source "$DOTFILES"/tools/bash/xdg-compact.sh
|
source "$DOTFILES"/tools/bash/xdg-compact.sh
|
||||||
source "$DOTFILES"/tools/bash/global.bashrc
|
source "$DOTFILES"/tools/bash/global.bashrc
|
||||||
|
|
@ -102,6 +126,8 @@ source "$DOTFILES"/tools/bash/profile
|
||||||
source "$DOTFILES"/tools/bash/bashrc
|
source "$DOTFILES"/tools/bash/bashrc
|
||||||
source "$DOTFILES"/tools/bash/bash_aliases
|
source "$DOTFILES"/tools/bash/bash_aliases
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
if command -v zsh >/dev/null 2>&1; then
|
if command -v zsh >/dev/null 2>&1; then
|
||||||
|
|
||||||
read -p "[ACTION] Do you want to setup zsh? (Y/n) " -r choice
|
read -p "[ACTION] Do you want to setup zsh? (Y/n) " -r choice
|
||||||
|
|
@ -135,7 +161,6 @@ echo "[INFO] Installing Doom Emacs"
|
||||||
|
|
||||||
source "$DOTFILES"/bootstrap/components/emacs.sh
|
source "$DOTFILES"/bootstrap/components/emacs.sh
|
||||||
|
|
||||||
# TODO: Untestest
|
|
||||||
if [ "$IS_WSL" -eq 1 ]; then
|
if [ "$IS_WSL" -eq 1 ]; then
|
||||||
ln -sf "/mnt/c/Users/$WINDOWS_USER" "$HOME/winhome"
|
ln -sf "/mnt/c/Users/$WINDOWS_USER" "$HOME/winhome"
|
||||||
ln -sf "/mnt/c/Users/$WINDOWS_USER/Downloads" "$HOME/Downloads"
|
ln -sf "/mnt/c/Users/$WINDOWS_USER/Downloads" "$HOME/Downloads"
|
||||||
|
|
@ -159,7 +184,6 @@ source "$DOTFILES"/bootstrap/linux/chromium-flags.bash
|
||||||
|
|
||||||
source "$DOTFILES"/bootstrap/components/rime.sh
|
source "$DOTFILES"/bootstrap/components/rime.sh
|
||||||
|
|
||||||
# TODO: Rewrite the script(mocha_port.fish) in bash/zsh or POSIX-compliant shell
|
|
||||||
echo "[INFO] Installing Color Scheme (Catppuccin Mocha)"
|
echo "[INFO] Installing Color Scheme (Catppuccin Mocha)"
|
||||||
|
|
||||||
# fish $DOTFILES/bootstrap/temp/mocha_port.fish
|
# fish $DOTFILES/bootstrap/temp/mocha_port.fish
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,49 @@
|
||||||
|
#Requires -RunAsAdministrator
|
||||||
|
# TODO: This file is under development
|
||||||
|
exit 1
|
||||||
|
|
||||||
|
$DOTFILES = if ($Env:DOTFILES) { $Env:DOTFILES } else { Join-Path "$Env:USERPROFILE" "dotfiles" }
|
||||||
|
|
||||||
|
|
||||||
|
New-Item -ItemType Directory -Path (Join-Path $Env:UserProfile "Temp") -Force
|
||||||
|
|
||||||
|
winget install -e --id Git.Git
|
||||||
|
|
||||||
|
if (Get-Command git -ErrorAction SilentlyContinue) {
|
||||||
|
git clone https://github.com/js0ny/dotfiles.git "$DOTFILES" --depth 1
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Write-Output "[ERROR] Git is not installed"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Install scoop
|
||||||
|
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
|
||||||
|
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression
|
||||||
|
|
||||||
|
# Inline `sudo`
|
||||||
|
sudo sudo config --enable normal
|
||||||
|
|
||||||
|
$BOOTSTRAP = Join-Path $DOTFILES "bootstrap" "win"
|
||||||
|
|
||||||
|
. (Join-Path $BOOTSTRAP "Environment.ps1")
|
||||||
|
. (Join-Path $BOOTSTRAP "Registry.ps1")
|
||||||
|
. (Join-Path $BOOTSTRAP "Symlinks.ps1")
|
||||||
|
|
||||||
|
scoop import (Join-Path $BOOTSTRAP "Scoopfile.json")
|
||||||
|
|
||||||
|
# Rime
|
||||||
|
|
||||||
|
$RIMEDIR = Join-Path $Env:AppData "Rime"
|
||||||
|
git clone --depth 1 https://github.com/js0ny/rime_wanxiang_pro.git $RIMEDIR
|
||||||
|
|
||||||
|
Set-Location $RIMEDIR
|
||||||
|
just init
|
||||||
|
just clone_plum
|
||||||
|
|
||||||
|
# The section below not done yet
|
||||||
|
exit 1
|
||||||
|
|
||||||
#!C:\Program Files\WindowsApps\Microsoft.PowerShell_7.4.6.0_x64__8wekyb3d8bbwe\pwsh.EXE
|
#!C:\Program Files\WindowsApps\Microsoft.PowerShell_7.4.6.0_x64__8wekyb3d8bbwe\pwsh.EXE
|
||||||
# Run with PowerShell 7
|
# Run with PowerShell 7
|
||||||
winget install -e --id Git.Git
|
winget install -e --id Git.Git
|
||||||
|
|
@ -13,101 +59,6 @@ Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression
|
||||||
# Install Chocolatey
|
# 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-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_0", "C:\Users\jsony\AppData\Local\Cargo\bin", "User")
|
|
||||||
[System.Environment]::SetEnvironmentVariable("Path_EXT_1", "C:\Users\jsony\AppData\Local\Go\bin", "User")
|
|
||||||
[System.Environment]::SetEnvironmentVariable("Path_EXT_2", "C:\Users\jsony\AppData\Local\Cargo\bin", "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
|
|
||||||
# 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
|
|
||||||
[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")
|
|
||||||
[System.Environment]::SetEnvironmentVariable("KOMOREBI_CONFIG_HOME", "$Env:AppData\komorebi", "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
|
# Set Dotfiles
|
||||||
# $DOTFILES\.config
|
# $DOTFILES\.config
|
||||||
$folders = @("conda", "git", "ideavim", "ipython", "markdownlint", "npm", "NuGet", "nvim", "pip", "Vim")
|
$folders = @("conda", "git", "ideavim", "ipython", "markdownlint", "npm", "NuGet", "nvim", "pip", "Vim")
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
# Run as Administrator
|
#Requires -RunAsAdministrator
|
||||||
|
|
||||||
Set-MpPreference -EnableControlledFolderAccess 1
|
Set-MpPreference -EnableControlledFolderAccess 1
|
||||||
|
|
||||||
|
|
|
||||||
93
bootstrap/win/Environments.ps1
Normal file
93
bootstrap/win/Environments.ps1
Normal file
|
|
@ -0,0 +1,93 @@
|
||||||
|
# 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_0", "C:\Users\jsony\AppData\Local\Cargo\bin", "User")
|
||||||
|
[System.Environment]::SetEnvironmentVariable("Path_EXT_1", "C:\Users\jsony\AppData\Local\Go\bin", "User")
|
||||||
|
[System.Environment]::SetEnvironmentVariable("Path_EXT_2", "C:\Users\jsony\AppData\Local\Cargo\bin", "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
|
||||||
|
# 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
|
||||||
|
[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")
|
||||||
|
[System.Environment]::SetEnvironmentVariable("KOMOREBI_CONFIG_HOME", "$Env:AppData\komorebi", "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
|
||||||
6
bootstrap/win/Registry.ps1
Normal file
6
bootstrap/win/Registry.ps1
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
|
||||||
|
# Disable StickyKeys
|
||||||
|
REG ADD "HKEY_CURRENT_USER\Control Panel\Accessibility\StickyKeys" /v "Flags" /t REG_SZ /d "506" /f
|
||||||
|
|
||||||
|
# Disable Hyper+Keys to open Office apps
|
||||||
|
REG ADD HKCU\Software\Classes\ms-officeapp\Shell\Open\Command /t REG_SZ /d rundll32
|
||||||
21
bootstrap/win/Tasks.ps1
Normal file
21
bootstrap/win/Tasks.ps1
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
#Requires -RunAsAdministrator
|
||||||
|
|
||||||
|
Write-Output "[INFO] Setting up KMonad Tasks"
|
||||||
|
|
||||||
|
# PowerShell Path, use 7 if available
|
||||||
|
if (Get-Command "pwsh" -ErrorAction SilentlyContinue) {
|
||||||
|
$PowerShellPath = (Get-Command "pwsh").Source
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$PowerShellPath = (Get-Command "powershell").Source
|
||||||
|
}
|
||||||
|
|
||||||
|
$DotStartUpPath = "$Env:DOTFILES\platforms\win\start"
|
||||||
|
|
||||||
|
$KMonadRunnerPath = Join-Path $DotStartUpPath "KMonad.ps1"
|
||||||
|
$Action = New-ScheduledTaskAction -Execute $PowerShellPath -Argument "-NoProfile -ExecutionPolicy Bypass -File $KMonadRunnerPath"
|
||||||
|
$Trigger = New-ScheduledTaskTrigger -AtLogOn
|
||||||
|
$Principal = New-ScheduledTaskPrincipal -UserId "$env:USERNAME" -LogonType Interactive -RunLevel Highest
|
||||||
|
$Settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -DontStopOnIdleEnd -Hidden
|
||||||
|
|
||||||
|
Register-ScheduledTask -TaskName "Start Kmonad" -Action $Action -Trigger $Trigger -Principal $Principal -Settings $Settings -TaskPath "\Personal"
|
||||||
3
common/agenda-view.el
Normal file
3
common/agenda-view.el
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
|
||||||
|
(setq org-directory "~/OrgFiles/")
|
||||||
|
(setq org-agenda-files (list (concat org-directory "tasks/")))
|
||||||
|
|
@ -61,3 +61,8 @@ set directory=$XDG_STATE_HOME/vim/swap
|
||||||
set undodir=$XDG_STATE_HOME/vim/undo
|
set undodir=$XDG_STATE_HOME/vim/undo
|
||||||
set viewdir=$XDG_STATE_HOME/vim/view
|
set viewdir=$XDG_STATE_HOME/vim/view
|
||||||
" set shada+=n$XDG_STATE_HOME/vim/shada
|
" set shada+=n$XDG_STATE_HOME/vim/shada
|
||||||
|
" Leader
|
||||||
|
let mapleader = "\<Space>"
|
||||||
|
nnoremap <leader><leader> :FZF<CR>
|
||||||
|
" Misc
|
||||||
|
syntax on
|
||||||
|
|
|
||||||
43
platforms/win/ahk/spcl.ahk
Normal file
43
platforms/win/ahk/spcl.ahk
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
#Requires AutoHotkey v2.0
|
||||||
|
#SingleInstance Force
|
||||||
|
|
||||||
|
Space Up:: Send '{Space ' (A_PriorKey = 'Space' ? 1 : times) '}'
|
||||||
|
Space:: global times := ''
|
||||||
|
|
||||||
|
#HotIf GetKeyState('Space', 'P')
|
||||||
|
h::Left
|
||||||
|
n::Down
|
||||||
|
e::Up
|
||||||
|
i::Right
|
||||||
|
k::Home
|
||||||
|
o::End
|
||||||
|
[::PgUp
|
||||||
|
]::PgDn
|
||||||
|
1::F1
|
||||||
|
2::F2
|
||||||
|
3::F3
|
||||||
|
4::F4
|
||||||
|
5::F5
|
||||||
|
6::F6
|
||||||
|
7::F7
|
||||||
|
8::F8
|
||||||
|
9::F9
|
||||||
|
0::F10
|
||||||
|
-::F11
|
||||||
|
=::F12
|
||||||
|
+:: global times .= ThisHotkey
|
||||||
|
#HotIf
|
||||||
|
|
||||||
|
Enter Up:: Send '{Enter ' (A_PriorKey = 'Enter' ? 1 : times) '}'
|
||||||
|
Enter:: global times := ''
|
||||||
|
|
||||||
|
#HotIf GetKeyState('Enter', 'P')
|
||||||
|
b:: {
|
||||||
|
Run("vivaldi.exe")
|
||||||
|
}
|
||||||
|
t:: {
|
||||||
|
Run("wezterm-gui.exe")
|
||||||
|
}
|
||||||
|
c:: {
|
||||||
|
Run("code.exe")
|
||||||
|
}
|
||||||
10
platforms/win/start/KMonad.ps1
Normal file
10
platforms/win/start/KMonad.ps1
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
if (Get-Command "kmonad" -ErrorAction SilentlyContinue) {
|
||||||
|
$KMonadPath = (Get-Command "kmonad").Source
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$KMonadPath = "D:\bin\kmonad.exe"
|
||||||
|
}
|
||||||
|
|
||||||
|
$KMonadConfig = "$Env:DOTFILES\tools\kmonad\windows.kbd"
|
||||||
|
|
||||||
|
Start-Process -FilePath $KMonadPath -ArgumentList $KMonadConfig -WindowStyle Hidden
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
;; vim:ft=kmonad
|
|
||||||
;; Linux kmonad.kbd
|
;; Linux kmonad.kbd
|
||||||
|
|
||||||
(defcfg
|
(defcfg
|
||||||
77
tools/KMonad/windows.kbd
Normal file
77
tools/KMonad/windows.kbd
Normal file
|
|
@ -0,0 +1,77 @@
|
||||||
|
;; Windows kmonad.kbd
|
||||||
|
;; Detailed comments can be found at ./linux.kbd
|
||||||
|
|
||||||
|
(defcfg
|
||||||
|
input (low-level-hook)
|
||||||
|
output (send-event-sink)
|
||||||
|
fallthrough true
|
||||||
|
allow-cmd true
|
||||||
|
cmp-seq ralt
|
||||||
|
cmp-seq-delay 0
|
||||||
|
implicit-around around
|
||||||
|
)
|
||||||
|
|
||||||
|
;; Razer BlackWidow V3 Mini - 65% ANSI layout
|
||||||
|
;; (defsrc
|
||||||
|
;; esc 1 2 3 4 5 6 7 8 9 0 - = bspc del
|
||||||
|
;; tab q w e r t y u i o p [ ] \ pgup
|
||||||
|
;; caps a s d f g h j k l ; ' ret pgdn
|
||||||
|
;; lsft z x c v b n m , . / rsft up ins
|
||||||
|
;; lctl lmet lalt spc ralt rctl left down right
|
||||||
|
;; )
|
||||||
|
|
||||||
|
(defsrc
|
||||||
|
grv 1 2 3 4 5 6 7 8 9 0 - = \ del
|
||||||
|
tab q w f p g j l u y ; [ ] bspc pgup
|
||||||
|
caps a r s t d h n e i o ' ret pgdn
|
||||||
|
lsft z x c v b k m , . / rsft up ins
|
||||||
|
lctl lmet lalt spc ralt rctl left down right
|
||||||
|
)
|
||||||
|
|
||||||
|
;; (deflayer name
|
||||||
|
;; _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||||
|
;; _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||||
|
;; _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||||
|
;; _ _ _ _ _ _ _ _ _ _ _ _ _ _
|
||||||
|
;; _ _ _ _ _ _ _ _ _
|
||||||
|
;; )
|
||||||
|
|
||||||
|
;; CapsLock -> Esc when tapped, Ctrl when held
|
||||||
|
(defalias mo1 (tap-next-release esc lctl))
|
||||||
|
(defalias spctl (tap-next-release spc (layer-toggle spcl)))
|
||||||
|
|
||||||
|
|
||||||
|
;; Colemak
|
||||||
|
(deflayer colemak
|
||||||
|
grv 1 2 3 4 5 6 7 8 9 0 - = \ del
|
||||||
|
tab q w f p g j l u y ; [ ] bspc pgup
|
||||||
|
@mo1 a r s t d h n e i o ' ret pgdn
|
||||||
|
lsft z x c v b k m , . / rsft up ins
|
||||||
|
lctl lmet lalt @spctl ralt rctl left down right
|
||||||
|
)
|
||||||
|
|
||||||
|
(deflayer qwerty
|
||||||
|
esc 1 2 3 4 5 6 7 8 9 0 - = bspc del
|
||||||
|
tab q w e r t y u i o p [ ] \ pgup
|
||||||
|
@mo1 a s d f g h j k l ; ' ret pgdn
|
||||||
|
lsft z x c v b n m , . / rsft up ins
|
||||||
|
lctl lmet lalt @spctl ralt rctl left down right
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
;; SPACE Layer
|
||||||
|
(deflayer spcl
|
||||||
|
grv f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 \ del
|
||||||
|
tab q w f p g j l u y ; pgup pgdn bspc pgup
|
||||||
|
@mo1 a r s t d left down up right end ' ret pgdn
|
||||||
|
lsft z x c v b home m , . / rsft up ins
|
||||||
|
lctl lmet lalt spc ralt rctl left down right
|
||||||
|
)
|
||||||
|
|
||||||
|
;; (deflayer spcl
|
||||||
|
;; esc 1 2 3 4 5 6 7 8 9 0 - = bspc del
|
||||||
|
;; tab q w e r t y u i o p [ ] \ pgup
|
||||||
|
;; @mo1 a s d f g left down up right ; ' ret pgdn
|
||||||
|
;; lsft z x c v b n m , . / rsft up ins
|
||||||
|
;; lctl lmet lalt spc ralt rctl left down right
|
||||||
|
;; )
|
||||||
|
|
@ -30,7 +30,6 @@ else
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
alias ni=touch
|
alias ni=touch
|
||||||
alias cls=clear
|
alias cls=clear
|
||||||
alias ii=open
|
alias ii=open
|
||||||
|
|
@ -54,6 +53,7 @@ alias ipy=ipython
|
||||||
|
|
||||||
alias g=lazygit
|
alias g=lazygit
|
||||||
|
|
||||||
|
alias doomd="emacsclient -t ~/.config/doom/"
|
||||||
|
|
||||||
# lsd - modern ls
|
# lsd - modern ls
|
||||||
if command -v lsd >/dev/null; then
|
if command -v lsd >/dev/null; then
|
||||||
|
|
@ -68,7 +68,6 @@ else
|
||||||
alias ll='ls -l'
|
alias ll='ls -l'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Functions #
|
# Functions #
|
||||||
mkcd() {
|
mkcd() {
|
||||||
mkdir -p $1 && cd $1
|
mkdir -p $1 && cd $1
|
||||||
|
|
@ -89,7 +88,6 @@ mtv(){
|
||||||
mkdir -p $(dirname $1) && touch $1 && nvim $1
|
mkdir -p $(dirname $1) && touch $1 && nvim $1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
alias update="source $DOTFILES/scripts/update.zsh"
|
alias update="source $DOTFILES/scripts/update.zsh"
|
||||||
|
|
||||||
if command -v pacman >/dev/null; then
|
if command -v pacman >/dev/null; then
|
||||||
|
|
@ -124,8 +122,6 @@ if command -v brew > /dev/null; then
|
||||||
alias brewl="brew list"
|
alias brewl="brew list"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# TODO: Does not work
|
# TODO: Does not work
|
||||||
if [ "$TERM" = "xterm-ghostty" ] || [ "$TERM" = "xterm-kitty" ]; then
|
if [ "$TERM" = "xterm-ghostty" ] || [ "$TERM" = "xterm-kitty" ]; then
|
||||||
alias icat="kitten icat"
|
alias icat="kitten icat"
|
||||||
|
|
|
||||||
|
|
@ -297,6 +297,7 @@ const searchAliases = [
|
||||||
["gh", "GitHub", "https://github.com/search?type=repositories&q="],
|
["gh", "GitHub", "https://github.com/search?type=repositories&q="],
|
||||||
["gg", "Google", "https://www.google.com/search?q="],
|
["gg", "Google", "https://www.google.com/search?q="],
|
||||||
["mc", "Metacritic", "https://www.metacritic.com/search/"],
|
["mc", "Metacritic", "https://www.metacritic.com/search/"],
|
||||||
|
["nx", "NixPackages", "https://search.nixos.org/packages?query="],
|
||||||
["ng", "NuGet", "https://www.nuget.org/packages?q="],
|
["ng", "NuGet", "https://www.nuget.org/packages?q="],
|
||||||
["np", "npm", "https://www.npmjs.com/search?q="],
|
["np", "npm", "https://www.npmjs.com/search?q="],
|
||||||
["pa", "Pacman", "https://archlinux.org/packages/?q="],
|
["pa", "Pacman", "https://archlinux.org/packages/?q="],
|
||||||
|
|
@ -324,6 +325,8 @@ const searchAliases = [
|
||||||
["yt", "YouTube", "https://www.youtube.com/results?search_query="],
|
["yt", "YouTube", "https://www.youtube.com/results?search_query="],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
api.unmap("on")
|
||||||
|
|
||||||
// Add all search aliases
|
// Add all search aliases
|
||||||
searchAliases.forEach(([alias, name, url]) => {
|
searchAliases.forEach(([alias, name, url]) => {
|
||||||
_addSearchAlias(alias, name, url);
|
_addSearchAlias(alias, name, url);
|
||||||
|
|
@ -1003,4 +1006,3 @@ addVimMapKey(
|
||||||
// #region Hints
|
// #region Hints
|
||||||
api.Hints.setCharacters("qwfpgarstdcv"); // Left-hand keys
|
api.Hints.setCharacters("qwfpgarstdcv"); // Left-hand keys
|
||||||
// #endregion
|
// #endregion
|
||||||
//
|
|
||||||
|
|
|
||||||
|
|
@ -121,3 +121,6 @@
|
||||||
)
|
)
|
||||||
|
|
||||||
(load! "calendar.el")
|
(load! "calendar.el")
|
||||||
|
|
||||||
|
|
||||||
|
(load! "telega.el")
|
||||||
|
|
|
||||||
|
|
@ -72,12 +72,13 @@
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
;;; org-agenda
|
||||||
|
|
||||||
(after! org-agenda
|
(after! org-agenda
|
||||||
;; (setq org-agenda-files (directory-files-recursively "~/OrgFiles/tasks/" "\\.org$"))
|
;; (setq org-agenda-files (directory-files-recursively "~/OrgFiles/tasks/" "\\.org$"))
|
||||||
(setq org-agenda-files (list (concat org-directory "tasks/")))
|
(setq org-agenda-files (list (concat org-directory "tasks/")))
|
||||||
)
|
)
|
||||||
|
|
||||||
(map! :leader :desc "Org Agenda" "A" #'org-agenda)
|
|
||||||
|
|
||||||
(map! :after org-agenda
|
(map! :after org-agenda
|
||||||
:map evil-org-agenda-mode-map
|
:map evil-org-agenda-mode-map
|
||||||
|
|
@ -87,8 +88,16 @@
|
||||||
:m "ge" #'org-agenda-previous-item
|
:m "ge" #'org-agenda-previous-item
|
||||||
:m "N" #'org-agenda-priority-up
|
:m "N" #'org-agenda-priority-up
|
||||||
:m "E" #'org-agenda-priority-down
|
:m "E" #'org-agenda-priority-down
|
||||||
:m "i" #'evil-forward-char)
|
:m "i" #'evil-forward-char
|
||||||
|
:leader :desc "Org Agenda" "A" #'org-agenda)
|
||||||
|
|
||||||
|
;; org-agenda-clockreport
|
||||||
|
|
||||||
|
(setq org-agenda-clockreport-parameter-plist '(:link t :maxlevel 3 :fileskip0 t :compact t :narrow 80))
|
||||||
|
|
||||||
|
;;; org-clock
|
||||||
|
|
||||||
|
;; org-pomodoro
|
||||||
|
|
||||||
(after! org-pomodoro
|
(after! org-pomodoro
|
||||||
(setq org-pomodoro-format "🍅~%s")
|
(setq org-pomodoro-format "🍅~%s")
|
||||||
|
|
@ -96,9 +105,18 @@
|
||||||
(setq org-pomodoro-long-break-format "猛摸~%s")
|
(setq org-pomodoro-long-break-format "猛摸~%s")
|
||||||
)
|
)
|
||||||
|
|
||||||
;; Org-Babel
|
|
||||||
|
;;; org-babel
|
||||||
|
|
||||||
(if (bound-and-true-p ISMAC)
|
(if (bound-and-true-p ISMAC)
|
||||||
(setq org-babel-C-compiler "clang"))
|
(setq org-babel-C-compiler "clang"))
|
||||||
|
|
||||||
(load! "+pomodoro-telegram.el")
|
(load! "+pomodoro-telegram.el")
|
||||||
|
|
||||||
|
;;; org-export
|
||||||
|
|
||||||
|
;; icalendar
|
||||||
|
|
||||||
|
(setq org-icalendar-use-scheduled '(event-if-todo event-if-not-todo))
|
||||||
|
(setq org-icalendar-use-deadline '(event-if-todo event-if-not-todo))
|
||||||
|
(setq org-icalendar-combined-agenda-file "~/Dropbox/org.ics")
|
||||||
|
|
|
||||||
|
|
@ -55,3 +55,7 @@
|
||||||
(package! rime)
|
(package! rime)
|
||||||
(package! ox-typst)
|
(package! ox-typst)
|
||||||
(package! cal-china-x)
|
(package! cal-china-x)
|
||||||
|
|
||||||
|
(package! telega :recipe (:files (:defaults "contrib/*.el" "etc" "server" "Makefile")))
|
||||||
|
|
||||||
|
(package! org-super-agenda)
|
||||||
|
|
|
||||||
72
tools/doom/telega.el
Normal file
72
tools/doom/telega.el
Normal file
|
|
@ -0,0 +1,72 @@
|
||||||
|
;; -*- lexical-binding: t; -*-
|
||||||
|
;; telegram client for emacs
|
||||||
|
(use-package! telega
|
||||||
|
:init
|
||||||
|
(setq telega-server-libs-prefix "/usr")
|
||||||
|
(setq telega-directory (expand-file-name "~/.local/share/telega"))
|
||||||
|
|
||||||
|
|
||||||
|
(prefix-key global-map (kbd "C-c t") telega-prefix-map)
|
||||||
|
(unless (display-graphic-p) (setq telega-use-images nil))
|
||||||
|
(when (modulep! :editor evil)
|
||||||
|
(cl-pushnew 'telega +evil-collection-disabled-list :test #'equal)
|
||||||
|
(setq evil-collection-mode-list (remove 'telega evil-collection-mode-list))
|
||||||
|
(set-evil-initial-state! '(telega-root-mode telega-chat-mode) 'emacs))
|
||||||
|
|
||||||
|
:hook
|
||||||
|
(telega-load . telega-mode-line-mode)
|
||||||
|
(telega-load . global-telega-url-shorten-mode)
|
||||||
|
(telega-load . global-telega-mnz-mode)
|
||||||
|
(telega-load . telega-autoplay-mode)
|
||||||
|
(telega-load . telega-transient-mode)
|
||||||
|
(telega-load . telega-adblock-mode)
|
||||||
|
(telega-chat-mode . (lambda ()
|
||||||
|
(setq-local visual-fill-column-extra-text-width
|
||||||
|
'(0 . 2))))
|
||||||
|
|
||||||
|
:config
|
||||||
|
(add-hook 'telega-msg-ignore-predicates
|
||||||
|
(telega-match-gen-predicate 'msg '(sender is-blocked)))
|
||||||
|
(setq telega-chat-show-deleted-messages-for '(me-is-owner OR-ADMIN)
|
||||||
|
;; telega-use-tracking-for '(or mention (and unread unmuted))
|
||||||
|
telega-open-file-function 'org-open-file
|
||||||
|
;; telega-open-message-as-file '(video video-note)
|
||||||
|
telega-translate-to-language-by-default "zh"
|
||||||
|
telega-avatar-workaround-gaps-for `(return t)
|
||||||
|
telega-mode-line-string-format (remove
|
||||||
|
'(:eval (telega-mode-line-icon))
|
||||||
|
telega-mode-line-string-format))
|
||||||
|
|
||||||
|
(map! (:prefix "C-c"
|
||||||
|
:desc "Telega all chats"
|
||||||
|
"c" #'telega-chat-with
|
||||||
|
:desc "Telega important chats"
|
||||||
|
"v" #'telega-switch-important-chat
|
||||||
|
:desc "Telega next important chat"
|
||||||
|
"SPC" (cmd! (let ((current-prefix-arg '(4)))
|
||||||
|
(call-interactively #'telega-switch-important-chat))))
|
||||||
|
(:map telega-chat-mode-map
|
||||||
|
(:prefix ("C-t" . "Telega chat topic")
|
||||||
|
:desc "Telega filter by chat topic"
|
||||||
|
"C-t" #'telega-chatbuf-filter-by-topic
|
||||||
|
:desc "Telega clear chat topic"
|
||||||
|
"C-c" #'telega-chatbuf-thread-cancel)))
|
||||||
|
|
||||||
|
; (load! "+telega-auto-input-method")
|
||||||
|
|
||||||
|
(set-popup-rule! (regexp-quote telega-root-buffer-name)
|
||||||
|
:slot 10 :vslot 10 :side 'right :size 90 :ttl nil :quit 'current :modeline t)
|
||||||
|
(set-popup-rule! "^◀[^◀\[]*[\[({<].+[\])}>]"
|
||||||
|
:slot 10 :vslot 10 :side 'right :size 90 :ttl 10 :quit 'current :modeline t)
|
||||||
|
(set-popup-rule! (regexp-quote "*Telega User*")
|
||||||
|
:slot 20 :vslot 10 :side 'right :height .5 :ttl 10 :quit t :modeline nil :select t)
|
||||||
|
(set-popup-rule! (regexp-quote "*Telegram Chat Info*")
|
||||||
|
:slot 20 :vslot 10 :side 'right :height .5 :ttl 10 :quit t :modeline nil :select t))
|
||||||
|
|
||||||
|
;; (load! "+telega-addition")
|
||||||
|
|
||||||
|
(use-package! telega-dired-dwim
|
||||||
|
:after telega dired)
|
||||||
|
|
||||||
|
(use-package! telega-bridge-bot
|
||||||
|
:after telega)
|
||||||
|
|
@ -60,6 +60,9 @@ abbr --add ipy ipython
|
||||||
|
|
||||||
abbr --add g lazygit
|
abbr --add g lazygit
|
||||||
|
|
||||||
|
|
||||||
|
abbr --add doomrc "emacsclient -t ~/.config/doom/"
|
||||||
|
|
||||||
# lsd - modern ls
|
# lsd - modern ls
|
||||||
if command -v lsd > /dev/null
|
if command -v lsd > /dev/null
|
||||||
alias ls='lsd'
|
alias ls='lsd'
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ return {
|
||||||
},
|
},
|
||||||
{ import = "plugins.mod.nvim-tree" },
|
{ import = "plugins.mod.nvim-tree" },
|
||||||
{ import = "plugins.mod.telescope" },
|
{ import = "plugins.mod.telescope" },
|
||||||
|
-- { import = "plugins.mod.fzf" },
|
||||||
{
|
{
|
||||||
"ahmedkhalf/project.nvim",
|
"ahmedkhalf/project.nvim",
|
||||||
opts = {
|
opts = {
|
||||||
|
|
|
||||||
|
|
@ -33,4 +33,21 @@ return {
|
||||||
{ import = "plugins.mod.which-keys-nvim" },
|
{ import = "plugins.mod.which-keys-nvim" },
|
||||||
{ import = "plugins.mod.copilot-lua" },
|
{ import = "plugins.mod.copilot-lua" },
|
||||||
{ import = "plugins.mod.avante-nvim" },
|
{ import = "plugins.mod.avante-nvim" },
|
||||||
|
{
|
||||||
|
"kawre/leetcode.nvim",
|
||||||
|
build = ":TSUpdate html", -- if you have `nvim-treesitter` installed
|
||||||
|
dependencies = {
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
-- "ibhagwan/fzf-lua",
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"MunifTanjim/nui.nvim",
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
-- configuration goes here
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"3rd/image.nvim",
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ return {
|
||||||
provider = "openai",
|
provider = "openai",
|
||||||
openai = {
|
openai = {
|
||||||
endpoint = "https://yunwu.ai/v1",
|
endpoint = "https://yunwu.ai/v1",
|
||||||
model = "claude-3-5-sonnet-latest", -- your desired model (or use gpt-4o, etc.)
|
model = "claude-3-7-sonnet-20250219", -- your desired model (or use gpt-4o, etc.)
|
||||||
timeout = 30000, -- timeout in milliseconds
|
timeout = 30000, -- timeout in milliseconds
|
||||||
temperature = 0, -- adjust if needed
|
temperature = 0, -- adjust if needed
|
||||||
max_tokens = 4096,
|
max_tokens = 4096,
|
||||||
|
|
|
||||||
6
tools/nvim/lua/plugins/mod/fzf.lua
Normal file
6
tools/nvim/lua/plugins/mod/fzf.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
return {
|
||||||
|
"ibhagwan/fzf-lua",
|
||||||
|
-- optional for icon support
|
||||||
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
|
opts = {},
|
||||||
|
}
|
||||||
|
|
@ -7,7 +7,8 @@ return {
|
||||||
file_types = { "markdown", "Avante" },
|
file_types = { "markdown", "Avante" },
|
||||||
render_modes = { "n", "c", "t" },
|
render_modes = { "n", "c", "t" },
|
||||||
latex = {
|
latex = {
|
||||||
enabled = true,
|
-- enabled = true,
|
||||||
|
enabled = false,
|
||||||
converter = "latex2text",
|
converter = "latex2text",
|
||||||
highlight = "RenderMarkdownMath",
|
highlight = "RenderMarkdownMath",
|
||||||
top_pad = 0,
|
top_pad = 0,
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,7 @@ return {
|
||||||
"folke/which-key.nvim",
|
"folke/which-key.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
opts = {
|
opts = {
|
||||||
-- your configuration comes here
|
preset = "modern",
|
||||||
-- or leave it empty to use the default settings
|
|
||||||
-- refer to the configuration section below
|
|
||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,8 @@ alias ipy=ipython
|
||||||
|
|
||||||
alias g=lazygit
|
alias g=lazygit
|
||||||
|
|
||||||
|
alias doomrc="emacsclient -t ~/.config/doom/"
|
||||||
|
|
||||||
# lsd - modern ls
|
# lsd - modern ls
|
||||||
if command -v lsd >/dev/null 2>&1; then
|
if command -v lsd >/dev/null 2>&1; then
|
||||||
alias ls='lsd'
|
alias ls='lsd'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue