mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 08:43:00 +00:00
Sync from Mac
This commit is contained in:
parent
90110e8fed
commit
02ed4d20fb
11 changed files with 163 additions and 42 deletions
BIN
.DS_Store
vendored
BIN
.DS_Store
vendored
Binary file not shown.
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -8,3 +8,4 @@ nvim/.repro
|
||||||
nvim/foo.*
|
nvim/foo.*
|
||||||
nvim/*.log
|
nvim/*.log
|
||||||
nvim/data
|
nvim/data
|
||||||
|
test/
|
||||||
14
.ideavimrc
14
.ideavimrc
|
|
@ -36,6 +36,7 @@ Plug 'tpope/vim-surround'
|
||||||
Plug 'tpope/vim-commentary'
|
Plug 'tpope/vim-commentary'
|
||||||
Plug 'terryma/vim-multiple-cursors'
|
Plug 'terryma/vim-multiple-cursors'
|
||||||
Plug 'machakann/vim-highlightedyank'
|
Plug 'machakann/vim-highlightedyank'
|
||||||
|
Plug 'easymotion/vim-easymotion'
|
||||||
|
|
||||||
""" Keybindings """
|
""" Keybindings """
|
||||||
|
|
||||||
|
|
@ -46,18 +47,27 @@ nnoremap <leader>vr :source ~/.ideavimrc<CR>
|
||||||
"" NERDTree ""
|
"" NERDTree ""
|
||||||
nnoremap <leader>e :NERDTreeToggle<CR>
|
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 ""
|
"" Miscs ""
|
||||||
nnoremap <leader>: :action GotoAction<CR>
|
nnoremap <leader>: :action GotoAction<CR>
|
||||||
|
|
||||||
"" AI Related <leader>a + ""
|
"" AI Related <leader>a + ""
|
||||||
nnoremap <leader>ac :action copilot.chat.show<CR>
|
nnoremap <leader>ac :action copilot.chat.show<CR>
|
||||||
nnoremap <leader>ad :action copilot.disabelCopilot<CR>
|
nnoremap <leader>ad :action copilot.disableCopilot<CR>
|
||||||
nnoremap <leader>ae :action copilot.enabelCopilot<CR>
|
nnoremap <leader>ae :action copilot.enableCopilot<CR>
|
||||||
nnoremap <leader>ai :action copilot.openCopilot<CR>
|
nnoremap <leader>ai :action copilot.openCopilot<CR>
|
||||||
|
|
||||||
"" Codes Action <leader>c + ""
|
"" Codes Action <leader>c + ""
|
||||||
nnoremap <leader>cf :action ReformatCode<CR>
|
nnoremap <leader>cf :action ReformatCode<CR>
|
||||||
nnoremap <leader>cs :action GotoSymbol<CR>
|
nnoremap <leader>cs :action GotoSymbol<CR>
|
||||||
|
nnoremap <leader>c/ :action CommentByLineComment<CR>
|
||||||
|
|
||||||
"" Project Action <leader>p + ""
|
"" Project Action <leader>p + ""
|
||||||
nnoremap <leader>pr :action Run<CR>
|
nnoremap <leader>pr :action Run<CR>
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,6 @@ alias ohmyzsh="code ~/.oh-my-zsh"
|
||||||
# Editors #
|
# Editors #
|
||||||
|
|
||||||
alias v=nvim
|
alias v=nvim
|
||||||
alias gvi=neovide
|
|
||||||
alias c=code
|
alias c=code
|
||||||
|
|
||||||
# Misc #
|
# Misc #
|
||||||
|
|
@ -107,7 +106,7 @@ open() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# WSL Neovide
|
# WSL Neovide
|
||||||
neovide() {
|
gvi() {
|
||||||
local target=$1
|
local target=$1
|
||||||
|
|
||||||
if command -v neovide.exe > /dev/null; then
|
if command -v neovide.exe > /dev/null; then
|
||||||
|
|
|
||||||
22
linux/set_mirror.sh
Normal file
22
linux/set_mirror.sh
Normal 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
|
||||||
41
mac/.zshrc
41
mac/.zshrc
|
|
@ -42,6 +42,10 @@ alias ......="cd ../../../../.."
|
||||||
|
|
||||||
alias doku="cd ~/doku && ls"
|
alias doku="cd ~/doku && ls"
|
||||||
alias dotfiles="cd $DOTFILES && ls"
|
alias dotfiles="cd $DOTFILES && ls"
|
||||||
|
alias docs="cd ~/Documents"
|
||||||
|
alias dt="cd ~/Desktop"
|
||||||
|
alias down="cd ~/Downloads"
|
||||||
|
alias one="cd ~/OneDrive"
|
||||||
|
|
||||||
### Aliases ###
|
### Aliases ###
|
||||||
|
|
||||||
|
|
@ -56,20 +60,32 @@ alias cls=clear
|
||||||
|
|
||||||
alias g++='g++ -std=c++2b' # Set the default C++ standard to C++20
|
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 gcc='gcc -std=c99' # Set the default C standard to C99
|
||||||
alias cl='clang'
|
alias cl='clang -std=c99'
|
||||||
alias cl++='clang++'
|
alias clp='clang++ -std=c++2b'
|
||||||
alias python=python3 # Set the default Python version to Python 3
|
alias python=python3 # Set the default Python version to Python 3
|
||||||
alias py=python # Alias for Python
|
alias py=python # Alias for Python
|
||||||
alias bashcfg="nvim ~/.bashrc"
|
alias bashcfg="nvim ~/.bashrc"
|
||||||
alias zshcfg="nvim ~/.zshrc"
|
alias zshcfg="nvim ~/.zshrc"
|
||||||
alias shcfg=zshcfg
|
alias shcfg=zshcfg
|
||||||
|
alias reload="source ~/.zshrc"
|
||||||
alias nvimrc="nvim ~/.config/nvim/"
|
alias nvimrc="nvim ~/.config/nvim/"
|
||||||
alias ohmyzsh="code ~/.oh-my-zsh"
|
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 #
|
# Editors #
|
||||||
|
|
||||||
alias v=nvim
|
alias v=nvim
|
||||||
alias gvi=neovide
|
|
||||||
alias c=code
|
alias c=code
|
||||||
|
|
||||||
# Misc #
|
# Misc #
|
||||||
|
|
@ -107,7 +123,7 @@ open() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# WSL Neovide
|
# WSL Neovide
|
||||||
neovide() {
|
gvi() {
|
||||||
local target=$1
|
local target=$1
|
||||||
|
|
||||||
if command -v neovide.exe > /dev/null; then
|
if command -v neovide.exe > /dev/null; then
|
||||||
|
|
@ -125,15 +141,24 @@ neovide() {
|
||||||
|
|
||||||
# >>> conda initialize >>>
|
# >>> conda initialize >>>
|
||||||
# !! Contents within this block are managed by 'conda init' !!
|
# !! 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
|
if [ $? -eq 0 ]; then
|
||||||
eval "$__conda_setup"
|
eval "$__conda_setup"
|
||||||
else
|
else
|
||||||
if [ -f "$HOME/miniconda3/etc/profile.d/conda.sh" ]; then
|
if [ -f "/opt/homebrew/Caskroom/miniconda/base/etc/profile.d/conda.sh" ]; then
|
||||||
. "$HOME/miniconda3/etc/profile.d/conda.sh"
|
. "/opt/homebrew/Caskroom/miniconda/base/etc/profile.d/conda.sh"
|
||||||
else
|
else
|
||||||
export PATH="$HOME/miniconda3/bin:$PATH"
|
export PATH="/opt/homebrew/Caskroom/miniconda/base/bin:$PATH"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
unset __conda_setup
|
unset __conda_setup
|
||||||
# <<< conda initialize <<<
|
# <<< conda initialize <<<
|
||||||
|
|
||||||
|
# >>> juliaup initialize >>>
|
||||||
|
|
||||||
|
# !! Contents within this block are managed by juliaup !!
|
||||||
|
|
||||||
|
path=('$HOME/.juliaup/bin' $path)
|
||||||
|
export PATH
|
||||||
|
|
||||||
|
# <<< juliaup initialize <<<
|
||||||
|
|
|
||||||
|
|
@ -18,19 +18,19 @@ Set-PSReadLineKeyHandler -Chord "Ctrl+f" -Function ForwardWord
|
||||||
# Relative navigation #
|
# Relative navigation #
|
||||||
|
|
||||||
# ${function:~} = { Set-Location -Path ~ } cd is better
|
# ${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 #
|
# Absolute navigation #
|
||||||
|
|
||||||
${function:docs} = { Set-Location -Path ~\Documents }
|
${function:docs} = { Set-Location -Path ~/Documents }
|
||||||
${function:down} = { Set-Location -Path ~\Downloads }
|
${function:down} = { Set-Location -Path ~/Downloads }
|
||||||
${function:dt} = { Set-Location -Path ~\Desktop }
|
${function:dt} = { Set-Location -Path ~/Desktop }
|
||||||
${function:mytmp} = { Set-Location -Path ~\Temp }
|
${function:mytmp} = { Set-Location -Path ~/Temp }
|
||||||
${function:one} = { Set-Location -Path ~\OneDrive }
|
${function:one} = { Set-Location -Path ~/OneDrive }
|
||||||
${function:doku} = { Set-Location -Path ~\doku && Get-ChildItem }
|
${function:doku} = { Set-Location -Path ~/doku && Get-ChildItem }
|
||||||
|
|
||||||
### Aliases ###
|
### Aliases ###
|
||||||
|
|
||||||
|
|
@ -51,14 +51,21 @@ ${function:reload} = { Invoke-Expression $PROFILE }
|
||||||
${function:csi} = { dotnet script }
|
${function:csi} = { dotnet script }
|
||||||
${function:pulldots} = { Set-Location -Path $DOTFILES && git pull }
|
${function:pulldots} = { Set-Location -Path $DOTFILES && git pull }
|
||||||
Set-Alias "pwshcfg" "shcfg"
|
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 "cl++" "clang++"
|
Set-Alias "cl++" "clang++"
|
||||||
Set-Alias "clang" "clang -std=c99"
|
Set-Alias "clang" "clang -std=c99"
|
||||||
Set-Alias "clang++" "clang++ -std=c++2b"
|
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 #
|
# Editors #
|
||||||
|
|
||||||
Set-Alias "v" "nvim"
|
Set-Alias "v" "nvim"
|
||||||
|
|
@ -88,5 +95,7 @@ function cdls { param( [string] $dirname)
|
||||||
### Modules ###
|
### Modules ###
|
||||||
|
|
||||||
Import-Module CompletionPredictor
|
Import-Module CompletionPredictor
|
||||||
|
# Import-Module syntax-highlighting
|
||||||
|
|
||||||
### Misc ###
|
### Misc ###
|
||||||
|
|
||||||
|
|
|
||||||
33
mac/set_mirror.sh
Normal file
33
mac/set_mirror.sh
Normal 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
|
||||||
|
|
@ -4,3 +4,4 @@ Set-Alias python python3
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
|
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
|
||||||
# npm
|
# npm
|
||||||
|
npm config set registry https://registry.npmmirror.com
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
### Variables ###
|
### Variables ###
|
||||||
|
|
||||||
|
$EDITOR = "code"
|
||||||
$DOTFILES = "$HOME\Documents\.dotfiles"
|
$DOTFILES = "$HOME\Documents\.dotfiles"
|
||||||
|
|
||||||
### PSReadLine ###
|
### PSReadLine ###
|
||||||
|
|
@ -39,20 +40,48 @@ ${function:doku} = { Set-Location -Path ~\MyDocuments && Get-ChildItem }
|
||||||
Set-Alias "touch" "New-Item"
|
Set-Alias "touch" "New-Item"
|
||||||
Set-Alias "open" "explorer.exe"
|
Set-Alias "open" "explorer.exe"
|
||||||
|
|
||||||
# Dev #
|
# Shell Configurations #
|
||||||
|
|
||||||
${function:shcfg} = { code $PROFILE }
|
${function:shcfg} = { $EDITOR $PROFILE }
|
||||||
${function:reload} = { Invoke-Expression $PROFILE }
|
${function:reload} = { Invoke-Expression $PROFILE }
|
||||||
${function:csi} = { dotnet script }
|
|
||||||
${function:pulldots} = { Set-Location -Path $DOTFILES && git pull }
|
${function:pulldots} = { Set-Location -Path $DOTFILES && git pull }
|
||||||
Set-Alias "pwshcfg" "shcfg"
|
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 "python3" "python"
|
||||||
Set-Alias "pip3" "pip"
|
Set-Alias "pip3" "pip"
|
||||||
Set-Alias "py" "python"
|
Set-Alias "py" "python"
|
||||||
Set-Alias "cl" "clang"
|
Set-Alias "pyact" "conda activate"
|
||||||
Set-Alias "cl++" "clang++"
|
Set-Alias "pylsenv" "conda env list"
|
||||||
Set-Alias "clang" "clang -std=c99"
|
Set-Alias "pydeact" "conda deactivate"
|
||||||
Set-Alias "clang++" "clang++ -std=c++2b"
|
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 #
|
# Editors #
|
||||||
|
|
||||||
|
|
@ -78,8 +107,6 @@ function cdls { param( [string] $dirname)
|
||||||
Set-Location $dirname && Get-ChildItem
|
Set-Location $dirname && Get-ChildItem
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Modules ###
|
### Modules ###
|
||||||
|
|
||||||
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
|
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue