diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..69f643d Binary files /dev/null and b/.DS_Store differ diff --git a/.gitignore b/.gitignore index 4e339fd..da3a2f8 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ nvim/.repro nvim/foo.* nvim/*.log nvim/data +test/ \ No newline at end of file diff --git a/.ideavimrc b/.ideavimrc index 9a59316..ee6a258 100644 --- a/.ideavimrc +++ b/.ideavimrc @@ -36,6 +36,7 @@ Plug 'tpope/vim-surround' Plug 'tpope/vim-commentary' Plug 'terryma/vim-multiple-cursors' Plug 'machakann/vim-highlightedyank' +Plug 'easymotion/vim-easymotion' """ Keybindings """ @@ -46,18 +47,27 @@ nnoremap vr :source ~/.ideavimrc "" NERDTree "" nnoremap e :NERDTreeToggle +"" EasyMotion "" +nmap s (easymotion-f) +nmap S (easymotion-F) + +"" Sneak "" +nmap f (sneak-s) +nmap F (sneak-S) + "" Miscs "" nnoremap : :action GotoAction "" AI Related a + "" nnoremap ac :action copilot.chat.show -nnoremap ad :action copilot.disabelCopilot -nnoremap ae :action copilot.enabelCopilot +nnoremap ad :action copilot.disableCopilot +nnoremap ae :action copilot.enableCopilot nnoremap ai :action copilot.openCopilot "" Codes Action c + "" nnoremap cf :action ReformatCode nnoremap cs :action GotoSymbol +nnoremap c/ :action CommentByLineComment "" Project Action p + "" nnoremap pr :action Run diff --git a/linux/.zshrc b/linux/.zshrc index 83843a3..32c6bcf 100644 --- a/linux/.zshrc +++ b/linux/.zshrc @@ -69,7 +69,6 @@ alias ohmyzsh="code ~/.oh-my-zsh" # Editors # alias v=nvim -alias gvi=neovide alias c=code # Misc # @@ -107,7 +106,7 @@ open() { } # WSL Neovide -neovide() { +gvi() { local target=$1 if command -v neovide.exe > /dev/null; then diff --git a/linux/set_mirror.sh b/linux/set_mirror.sh new file mode 100644 index 0000000..7ba2502 --- /dev/null +++ b/linux/set_mirror.sh @@ -0,0 +1,22 @@ +# pip +alias pip=pip3 +alias python=python3 +python -m pip install --upgrade pip +pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple +# npm +npm config set registry https://registry.npmmirror.com + + + +# Linuxbrew +export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git" + +# 注:自 brew 4.0 起,使用默认 prefix (即 "/home/linuxbrew/.linuxbrew") 的大部分 Homebrew 用户无需设置 homebrew/core 镜像,只需设置 HOMEBREW_API_DOMAIN 即可。 +# 如果不是默认 prefix 或者需要使用 Homebrew 的开发命令 (如 `brew cat `),则仍然需要设置 homebrew/core 镜像。 +# 请按需执行如下命令: +brew tap --custom-remote --force-auto-update homebrew/core https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git + +# 除 homebrew/core 仓库外的 tap 仓库仍然需要设置镜像 +brew tap --custom-remote --force-auto-update homebrew/command-not-found https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-command-not-found.git +brew tap --custom-remote --force-auto-update homebrew/services https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-services.git +brew update \ No newline at end of file diff --git a/mac/.zshrc b/mac/.zshrc index 84a6375..7412cda 100644 --- a/mac/.zshrc +++ b/mac/.zshrc @@ -42,6 +42,10 @@ alias ......="cd ../../../../.." alias doku="cd ~/doku && ls" alias dotfiles="cd $DOTFILES && ls" +alias docs="cd ~/Documents" +alias dt="cd ~/Desktop" +alias down="cd ~/Downloads" +alias one="cd ~/OneDrive" ### Aliases ### @@ -56,20 +60,32 @@ alias cls=clear alias g++='g++ -std=c++2b' # Set the default C++ standard to C++20 alias gcc='gcc -std=c99' # Set the default C standard to C99 -alias cl='clang' -alias cl++='clang++' +alias cl='clang -std=c99' +alias clp='clang++ -std=c++2b' alias python=python3 # Set the default Python version to Python 3 alias py=python # Alias for Python alias bashcfg="nvim ~/.bashrc" alias zshcfg="nvim ~/.zshrc" alias shcfg=zshcfg +alias reload="source ~/.zshrc" alias nvimrc="nvim ~/.config/nvim/" alias ohmyzsh="code ~/.oh-my-zsh" +alias pulldots="cd $DOTFILES && git pull" + +# Conda # + +alias cact="conda activate" +alias cenvs="conda env list" +alias cdact="conda deactivate" + +# Git # + + + # Editors # alias v=nvim -alias gvi=neovide alias c=code # Misc # @@ -107,14 +123,14 @@ open() { } # WSL Neovide -neovide() { +gvi() { local target=$1 if command -v neovide.exe > /dev/null; then neovide.exe "$target" else if command -v neovide > /dev/null; then - neovide "$target" + neovide "$target" else echo "neovide is not installed" fi @@ -125,15 +141,24 @@ neovide() { # >>> conda initialize >>> # !! Contents within this block are managed by 'conda init' !! -__conda_setup="$('$HOME/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)" +__conda_setup="$('/opt/homebrew/Caskroom/miniconda/base/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)" if [ $? -eq 0 ]; then eval "$__conda_setup" else - if [ -f "$HOME/miniconda3/etc/profile.d/conda.sh" ]; then - . "$HOME/miniconda3/etc/profile.d/conda.sh" + if [ -f "/opt/homebrew/Caskroom/miniconda/base/etc/profile.d/conda.sh" ]; then + . "/opt/homebrew/Caskroom/miniconda/base/etc/profile.d/conda.sh" else - export PATH="$HOME/miniconda3/bin:$PATH" + export PATH="/opt/homebrew/Caskroom/miniconda/base/bin:$PATH" fi fi unset __conda_setup # <<< conda initialize <<< + +# >>> juliaup initialize >>> + +# !! Contents within this block are managed by juliaup !! + +path=('$HOME/.juliaup/bin' $path) +export PATH + +# <<< juliaup initialize <<< diff --git a/mac/Microsoft.PowerShell_profile.ps1 b/mac/Microsoft.PowerShell_profile.ps1 index 766a9b5..548d261 100644 --- a/mac/Microsoft.PowerShell_profile.ps1 +++ b/mac/Microsoft.PowerShell_profile.ps1 @@ -18,19 +18,19 @@ Set-PSReadLineKeyHandler -Chord "Ctrl+f" -Function ForwardWord # Relative navigation # # ${function:~} = { Set-Location -Path ~ } cd is better -${function:...} = { Set-Location -Path ..\.. } -${function:....} = { Set-Location -Path ..\..\.. } -${function:.....} = { Set-Location -Path ..\..\..\.. } -${function:......} = { Set-Location -Path ..\..\..\..\.. } +${function:...} = { Set-Location -Path ../.. } +${function:....} = { Set-Location -Path ../../.. } +${function:.....} = { Set-Location -Path ../../../.. } +${function:......} = { Set-Location -Path ../../../../.. } # Absolute navigation # -${function:docs} = { Set-Location -Path ~\Documents } -${function:down} = { Set-Location -Path ~\Downloads } -${function:dt} = { Set-Location -Path ~\Desktop } -${function:mytmp} = { Set-Location -Path ~\Temp } -${function:one} = { Set-Location -Path ~\OneDrive } -${function:doku} = { Set-Location -Path ~\doku && Get-ChildItem } +${function:docs} = { Set-Location -Path ~/Documents } +${function:down} = { Set-Location -Path ~/Downloads } +${function:dt} = { Set-Location -Path ~/Desktop } +${function:mytmp} = { Set-Location -Path ~/Temp } +${function:one} = { Set-Location -Path ~/OneDrive } +${function:doku} = { Set-Location -Path ~/doku && Get-ChildItem } ### Aliases ### @@ -39,7 +39,6 @@ ${function:doku} = { Set-Location -Path ~\doku && Get-ChildItem } Set-Alias "touch" "New-Item" Set-Alias "ll" "Get-ChildItem" Set-Alias "curl" "Invoke-WebRequest" -Set-Alias "cd" "Set-Location" Set-Alias "man" "Get-Help" Set-Alias "kill" "Stop-Process" @@ -52,14 +51,21 @@ ${function:reload} = { Invoke-Expression $PROFILE } ${function:csi} = { dotnet script } ${function:pulldots} = { Set-Location -Path $DOTFILES && git pull } Set-Alias "pwshcfg" "shcfg" -Set-Alias "python3" "python" -Set-Alias "pip3" "pip" -Set-Alias "py" "python" Set-Alias "cl" "clang" Set-Alias "cl++" "clang++" Set-Alias "clang" "clang -std=c99" Set-Alias "clang++" "clang++ -std=c++2b" +# Python & Conda # + +Set-Alias "python3" "python" +Set-Alias "pip3" "pip" +Set-Alias "py" "python" +Set-Alias "pyact" "conda activate" +Set-Alias "pylsenv" "conda env list" +Set-Alias "pydeact" "conda deactivate" +Set-Alias "pymkenv" "conda create --name" + # Editors # Set-Alias "v" "nvim" @@ -88,8 +94,8 @@ function cdls { param( [string] $dirname) ### Modules ### -Import-Module -Name Microsoft.WinGet.CommandNotFound #f45873b3-b655-43a6-b217-97c00aa0db58 - Import-Module CompletionPredictor +# Import-Module syntax-highlighting + +### Misc ### -### Misc ### \ No newline at end of file diff --git a/mac/set_mirror.sh b/mac/set_mirror.sh new file mode 100644 index 0000000..1c7b27b --- /dev/null +++ b/mac/set_mirror.sh @@ -0,0 +1,33 @@ +# pip +alias pip=pip3 +alias python=python3 +python -m pip install --upgrade pip +pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple +# npm +npm config set registry https://registry.npmmirror.com + + + +# Homebrew +# 手动设置 +export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git" + +# 注:自 brew 4.0 起,大部分 Homebrew 用户无需设置 homebrew/core 和 homebrew/cask 镜像,只需设置 HOMEBREW_API_DOMAIN 即可。 +# 如果需要使用 Homebrew 的开发命令 (如 `brew cat `),则仍然需要设置 homebrew/core 和 homebrew/cask 镜像。 +# 请按需执行如下两行命令: +brew tap --custom-remote --force-auto-update homebrew/core https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git +brew tap --custom-remote --force-auto-update homebrew/cask https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git + +# 除 homebrew/core 和 homebrew/cask 仓库外的 tap 仓库仍然需要设置镜像 +brew tap --custom-remote --force-auto-update homebrew/cask-fonts https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-fonts.git +brew tap --custom-remote --force-auto-update homebrew/cask-versions https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-versions.git +brew tap --custom-remote --force-auto-update homebrew/command-not-found https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-command-not-found.git +brew tap --custom-remote --force-auto-update homebrew/services https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-services.git +brew update + +# 或使用下面的几行命令自动设置 +export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git" +for tap in core cask{,-fonts,-versions} command-not-found services; do + brew tap --custom-remote --force-auto-update "homebrew/${tap}" "https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-${tap}.git" +done +brew update diff --git a/set_mirror.ps1 b/set_mirror.ps1 index adcee55..c7d6573 100644 --- a/set_mirror.ps1 +++ b/set_mirror.ps1 @@ -4,3 +4,4 @@ Set-Alias python python3 python -m pip install --upgrade pip pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple # npm +npm config set registry https://registry.npmmirror.com \ No newline at end of file diff --git a/set_mirror.sh b/set_mirror.sh deleted file mode 100644 index ba8ccf4..0000000 --- a/set_mirror.sh +++ /dev/null @@ -1,6 +0,0 @@ -# pip -alias pip=pip3 -alias python=python3 -python -m pip install --upgrade pip -pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple -# npm diff --git a/win/Microsoft.PowerShell_profile.ps1 b/win/Microsoft.PowerShell_profile.ps1 index 209edf8..6796eee 100644 --- a/win/Microsoft.PowerShell_profile.ps1 +++ b/win/Microsoft.PowerShell_profile.ps1 @@ -1,5 +1,6 @@ ### Variables ### +$EDITOR = "code" $DOTFILES = "$HOME\Documents\.dotfiles" ### PSReadLine ### @@ -39,20 +40,48 @@ ${function:doku} = { Set-Location -Path ~\MyDocuments && Get-ChildItem } Set-Alias "touch" "New-Item" Set-Alias "open" "explorer.exe" -# Dev # +# Shell Configurations # -${function:shcfg} = { code $PROFILE } +${function:shcfg} = { $EDITOR $PROFILE } ${function:reload} = { Invoke-Expression $PROFILE } -${function:csi} = { dotnet script } ${function:pulldots} = { Set-Location -Path $DOTFILES && git pull } Set-Alias "pwshcfg" "shcfg" + +# Dotnet # + +${function:csi} = { dotnet script } + +# C & C++ # + +Set-Alias "cl" "clang" +Set-Alias "clp" "clang++" +Set-Alias "clang" "clang -std=c99" +Set-Alias "clang++" "clang++ -std=c++2b" + +# Python & Conda # + Set-Alias "python3" "python" Set-Alias "pip3" "pip" Set-Alias "py" "python" -Set-Alias "cl" "clang" -Set-Alias "cl++" "clang++" -Set-Alias "clang" "clang -std=c99" -Set-Alias "clang++" "clang++ -std=c++2b" +Set-Alias "pyact" "conda activate" +Set-Alias "pylsenv" "conda env list" +Set-Alias "pydeact" "conda deactivate" +Set-Alias "pymkenv" "conda create --name" + +# # Git # + +# Set-Alias "g" "git" +# Set-Alias "ginit" "git init" +# Set-Alias "ga" "git add" +# Set-Alias "gaa" "git add --all" +# Set-Alias "gc" "git commit --message" +# Set-Alias "gca" "git commit --all --message" +# Set-Alias "gcl" "git clone" +# Set-Alias "gclnh" "git clone --depth 1" +# Set-Alias "gs" "git status" +# Set-Alias "gpl" "git pull" +# Set-Alias "gps" "git push" + # Editors # @@ -78,8 +107,6 @@ function cdls { param( [string] $dirname) Set-Location $dirname && Get-ChildItem } - - ### Modules ### $ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"