This commit is contained in:
js0ny 2024-08-03 11:10:10 +08:00
commit 25398e3b9e
11 changed files with 163 additions and 45 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

1
.gitignore vendored
View file

@ -8,3 +8,4 @@ nvim/.repro
nvim/foo.*
nvim/*.log
nvim/data
test/

View file

@ -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 <leader>vr :source ~/.ideavimrc<CR>
"" NERDTree ""
nnoremap <leader>e :NERDTreeToggle<CR>
"" EasyMotion ""
nmap s <Plug>(easymotion-f)
nmap S <Plug>(easymotion-F)
"" Sneak ""
nmap f <Plug>(sneak-s)
nmap F <Plug>(sneak-S)
"" Miscs ""
nnoremap <leader>: :action GotoAction<CR>
"" AI Related <leader>a + ""
nnoremap <leader>ac :action copilot.chat.show<CR>
nnoremap <leader>ad :action copilot.disabelCopilot<CR>
nnoremap <leader>ae :action copilot.enabelCopilot<CR>
nnoremap <leader>ad :action copilot.disableCopilot<CR>
nnoremap <leader>ae :action copilot.enableCopilot<CR>
nnoremap <leader>ai :action copilot.openCopilot<CR>
"" Codes Action <leader>c + ""
nnoremap <leader>cf :action ReformatCode<CR>
nnoremap <leader>cs :action GotoSymbol<CR>
nnoremap <leader>c/ :action CommentByLineComment<CR>
"" Project Action <leader>p + ""
nnoremap <leader>pr :action Run<CR>

View file

@ -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

22
linux/set_mirror.sh Normal file
View file

@ -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 <formula>`),则仍然需要设置 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

View file

@ -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 <<<

View file

@ -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 ###

33
mac/set_mirror.sh Normal file
View file

@ -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 <formula>`),则仍然需要设置 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

View file

@ -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

View file

@ -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

View file

@ -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"