diff --git a/.config/conda/condarc.yaml b/.config/conda/condarc.yaml index f974ff7..9965c1b 100644 --- a/.config/conda/condarc.yaml +++ b/.config/conda/condarc.yaml @@ -1,5 +1,5 @@ -# ~/.config/conda/condarc.yaml -# New-Item -ItemType SymbolicLink -Path ~\.config\conda\.condarc -Target ~\.dotfiles\.config\conda\condarc.yaml -# mkdir -p ~/.config/conda/ && ln -s ~/.dotfiles/.config/conda/condarc.yaml ~/.config/conda/.condarc +# $XDG_CONFIG_HOME/conda/condarc.yaml +# New-Item -ItemType SymbolicLink -Path ~\.condarc -Target ~\.dotfiles\.config\conda\condarc.yaml +# ln -s $DOTFILES/.config/conda/condarc.yaml $XDG_CONFIG_HOME/conda/.condarc # Reference: https://docs.conda.io/projects/conda/en/latest/user-guide/configuration/use-condarc.html auto_activate_base: false \ No newline at end of file diff --git a/.gitconfig b/.config/git/config similarity index 50% rename from .gitconfig rename to .config/git/config index d69c628..9b1b6fb 100644 --- a/.gitconfig +++ b/.config/git/config @@ -1,5 +1,6 @@ -# ~/.gitconfig -# ln -sf ~/.dotfiles/.gitconfig ~/.gitconfig +# $XDG_CONFIG_HOME/git/config +# ln -sf $DOTFILES/.gitconfig $XDG_CONFIG_HOME/git/config +# New-Item -ItemType SymbolicLink -Path $Env:XDG_CONFIG_HOME/git/ -Value $DOTFILES\.config\git\config [user] name = js0ny email = json.y@outlook.com diff --git a/.config/ideavim/ideavimrc b/.config/ideavim/ideavimrc.vimrc similarity index 89% rename from .config/ideavim/ideavimrc rename to .config/ideavim/ideavimrc.vimrc index 48cf34f..939f9ad 100644 --- a/.config/ideavim/ideavimrc +++ b/.config/ideavim/ideavimrc.vimrc @@ -1,9 +1,28 @@ -" ~/.config/ideavim/ideavimrc -" New-Item -ItemType SymbolicLink -Path ~\.config\ideavim/ideavimrc -Target ~\.dotfiles\.config/ideavim/ideavimrc -" ln -sf ~/.dotfiles/.config/ideavim/ideavimrc +"$XDG_CONFIG_HOME/ideavim/ideavimrc +" New-Item -ItemType SymbolicLink -Path ~\.ideavimrc -Target $DOTFILES\.config\ideavim\ideavimrc.vimrc +" ln -sf $DOTFILES/.config/ideavim/ideavimrc $XDG_CONFIG_HOME/ideavim/ideavimrc """ Basic Configs """ let mapleader = " " " set to +""" Colemak """ +" Word wrap +noremap n gj +noremap e gk +noremap i l + +" 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 + +" Y to yank to end of line +noremap Y y$ + """ Options """ " search for actions: :actionlist diff --git a/.markdownlint.json b/.config/markdownlint/.markdownlint.json similarity index 100% rename from .markdownlint.json rename to .config/markdownlint/.markdownlint.json diff --git a/.config/nvim/README.md b/.config/nvim/README.md index 6ed6a69..a5ea7b9 100644 --- a/.config/nvim/README.md +++ b/.config/nvim/README.md @@ -4,5 +4,5 @@ - `j->e`, `k->n`, `h->h`, `l->i` ```sh -ln -s ~/.dotfiles/.config/nvim/ ~/.config/nvim +ln -s $DOTFILES/.config/nvim/ ~/.config/nvim ``` \ No newline at end of file diff --git a/.config/pip/pip.conf b/.config/pip/pip.conf new file mode 100644 index 0000000..359fd84 --- /dev/null +++ b/.config/pip/pip.conf @@ -0,0 +1,5 @@ +# $XDG_CONFIG_HOME/pip/pip.conf +# ln -sf $DOTFILES/.config/pip/pip.conf $XDG_CONFIG_HOME/pip/pip.conf +# New-Item -ItemType SymbolicLink -Path $Env:XDG_CONFIG_HOME/pip/pip.conp -Value $DOTFILES\.config\pip\pip.conf +[global] +# index-url = https://pypi.tuna.tsinghua.edu.cn/simple \ No newline at end of file diff --git a/.config/zellij/config.kdl b/.config/zellij/config.kdl new file mode 100644 index 0000000..b55fa30 --- /dev/null +++ b/.config/zellij/config.kdl @@ -0,0 +1,24 @@ +// ~/.config/zellij/config.kdl +// ln -sf $DOTFILES/.config/zellij/config.kdl ~.config/zellij/config.kdl +// https://zellij.dev/documentation/configuration +keybinds { + // keybinds are divided into modes + normal { + // bind instructions can include one or more keys (both keys will be bound separately) + // bind keys can include one or more actions (all actions will be performed with no sequential guarantees) + bind "Ctrl g" { SwitchToMode "locked"; } + bind "Ctrl p" { SwitchToMode "pane"; } + bind "Alt n" { NewPane; } + bind "Alt h" "Alt Left" { MoveFocusOrTab "Left"; } + } + pane { + bind "h" "Left" { MoveFocus "Left"; } + bind "i" "Right" { MoveFocus "Right"; } + bind "n" "Down" { MoveFocus "Down"; } + bind "e" "Up" { MoveFocus "Up"; } + bind "p" { SwitchFocus; } + } + locked { + bind "Ctrl g" { SwitchToMode "normal"; } + } +} diff --git a/.npmrc b/.npmrc index 32f372a..b95c6b1 100644 --- a/.npmrc +++ b/.npmrc @@ -1,4 +1,4 @@ # ~/.npmrc # New-Item -ItemType SymbolicLink -Path ~\.npmrc -Target ~\.dotfiles\.npmrc -# ln -s ~/.dotfiles/.npmrc ~/.npmrc +# ln -s $DOTFILES/.npmrc ~/.npmrc # registry=https://registry.npmmirror.com diff --git a/installer/install_nvim.sh b/installer/install_nvim.sh deleted file mode 100644 index 62d5514..0000000 --- a/installer/install_nvim.sh +++ /dev/null @@ -1,3 +0,0 @@ -curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz -sudo rm -rf /opt/nvim -sudo tar -C /opt -xzf nvim-linux64.tar.gz \ No newline at end of file diff --git a/mac/.zshrc b/mac/.zshrc index c5dd388..43f0e9d 100644 --- a/mac/.zshrc +++ b/mac/.zshrc @@ -1,5 +1,5 @@ # ~/.config/zsh/.zshrc -# ln -s ~/.dotfiles/mac/.zshrc ~/.config/zsh/.zshrc +# ln -s $DOTFILES/mac/.zshrc ~/.config/zsh/.zshrc ### Variables ### export DOTFILES="$HOME/.dotfiles" diff --git a/mac/mac_setup.sh b/mac/mac_setup.sh index a10f167..93903e4 100644 --- a/mac/mac_setup.sh +++ b/mac/mac_setup.sh @@ -2,12 +2,15 @@ # This script is used to setup a new mac # Xcode Command Line Tools +echo [INFO] Installing Xcode Command Line Tools xcode-select --install # System Preferences # Installation Sources +echo [INFO] Setting Installation Sources sudo spctl --master-disable ## Finder +echo [INFO] Setting Finder Preferences defaults write com.apple.finder QuitMenuItem -bool true # Quit with CMD+Q defaults write com.apple.finder AppleShowAllFiles -bool false # Don't show Hidden Files defaults write com.apple.finder ShowPathbar -bool true # Show Path Bar @@ -25,6 +28,7 @@ defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool false defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true killall Finder ## Dock +echo [INFO] Setting Dock Preferences defaults write com.apple.dock persistent-apps -array defaults write com.apple.dock persistent-others -array defaults write com.apple.dock autohide -bool true # Autohide Dock @@ -38,19 +42,48 @@ defaults write com.apple.AppleMultitouchTrackpad Clicking -bool true defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true # Development # ### Dotfiles Setup ### +echo [INFO] Setting Up Dotfiles export $DOTFILES="$HOME/.dotfiles" git clone https://www.github.com/js0ny/dotfiles.git $DOTFILES -export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" -ln -s $DOTFILES/.condarc ~/.condarc -ln -s $DOTFILES/.gitconfig ~/.gitconfig -ln -s $DOTFILES/.haskeline ~/.haskeline -ln -s $DOTFILES/.ideavimrc ~/.ideavimrc -ln -s $DOTFILES/.tmux.conf ~/.tmux.conf +ln -sf $DOTFILES/zsh/.zshenv ~/.zshenv +echo [INFO] 'source ~/.zshenv' to use XDG_CONFIG_HOME +source ~/.zshenv + # export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" + # export ZDOTDIR="${XDG_CONFIG_HOME}/zsh" +echo [INFO] Setting Up Oh-My-Zsh +sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" +ln -sf $DOTFILES/zsh/.zshenv ~/.zshenv +ln -sf $DOTFILES/mac/.zshrc $XDG_CONFIG_HOME/zsh/.zshrc +source $XDG_CONFIG_HOME/zsh/.zshrc +git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH/custom/plugins/zsh-autosuggestions +git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH/custom/plugins/zsh-syntax-highlighting +source $XDG_CONFIG_HOME/zsh/.zshrc + +echo [INFO] Setting Up dotfiles +mkdir -p $XDG_CONFIG_HOME/conda $XDG_CONFIG_HOME/nvim $XDG_CONFIG_HOME/git $XDG_CONFIG_HOME/ideavim $XDG_CONFIG_HOME/markdownlint $XDG_CONFIG_HOME/pip $XDG_CONFIG_HOME/neovide $XDG_CONFIG_HOME/powershell $XDG_CONFIG_HOME/vscode +mkdir -p ~/.config/zellij # Not support XDG_CONFIG_HOME but same directory +ln -sf $DOTFILES/.config/conda/condarc.yaml $XDG_CONFIG_HOME/conda/.condarc +ln -sf $DOTFILES/.config/git/config $XDG_CONFIG_HOME/git/config +ln -sf $DOTFILES/.haskeline ~/.haskeline +ln -sf $DOTFILES/.ideavimrc ~/.ideavimrc +ln -sf $DOTFILES/.tmux.conf ~/.tmux.conf +ln -sf $DOTFILES/.config/markdownlint/.markdownlintrc.json $XDG_CONFIG_HOME/markdownlint/markdownlintrc.json +ln -sf $DOTFILES/.config/zellij/config.kdl ~/.config/zellij/config.kdl +ln -sf $DOTFILES/.npmrc ~/.npmrc +ln -sf $DOTFILES/.config/pip/pip.conf $XDG_CONFIG_HOME/pip/pip.conf +ln -sf $DOTFILES/mac/neovide.toml $XDG_CONFIG_HOME/neovide/config.toml +ln -sf $DOTFILES/mac/Microsoft.PowerShell_profile.ps1 $XDG_CONFIG_HOME/powershell/Microsoft.PowerShell_profile.ps1 +ln -sf $DOTFILES/vscode/vscode.vimrc $XDG_CONFIG_HOME/vscode.vimrc + +# Brew +echo [INFO] Installing Homebrew +echo [ACTION] Request Human Input /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" +echo [INFO] Installing Brew Packages brew install mas # Mac App Store CLI # File Management -brew install --cask keka # Archive +brew install --cask keka # Archiver brew install --cask google-drive # Cloud Storage # CLI @@ -64,12 +97,16 @@ brew install --formula ripgrep brew install --formula tmux brew install --formula tree brew install --formula pandoc +brew install --formula zellij # Better Tmux for me # Editors brew install --cask visual-studio-code brew install --formula neovim brew install --formula neovide +# IDE +brew install --cask qt-creator + # Programming Languages brew install --formula lua brew install --formula luajit @@ -97,6 +134,8 @@ brew install --cask squirrel # PKM brew install --cask obsidian brew install --cask typora +brew install --cask notion +brew install --cask notion-calendar # Media brew install --cask iina @@ -111,7 +150,7 @@ brew install --cask ltspice brew install --cask mactex-no-gui # Browser -brew install --cask arc +brew install --cask vivaldi brew install --cask firefox@nightly # Fonts @@ -140,12 +179,3 @@ brew install --cask telegram-desktop mas install 836500024 # WeChat mas install 451108668 # QQ -# Oh My Zsh -sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" -sudo rm -rf ~/.zshrc -mkdir -p ~/.config/zsh -ln -s $DOTFILES/zsh/.zshenv ~/.zshenv -ln -s $DOTFILES/mac/.zshrc ~/.config/zsh/.zshrc -source ~/.config/zsh/.zshrc -git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH/custom/plugins/zsh-autosuggestions -git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH/custom/plugins/zsh-syntax-highlighting \ No newline at end of file diff --git a/mac/neovide.toml b/mac/neovide.toml index e8e00ed..5677d38 100644 --- a/mac/neovide.toml +++ b/mac/neovide.toml @@ -1,5 +1,7 @@ -# ~/.config/neovide/config.toml -# ln -sf ~/.dotfiles/mac/neovide.toml ~/.config/neovide/config.toml +# $XDG_CONFIG_HOME/neovide/config.toml +# ln -sf $DOTFILES/mac/neovide.toml $XDG_CONFIG_HOME/neovide/config.toml +# New-Item -ItemType SymbolicLink -Path $Env:XDG_CONFIG_HOME/neovide/config.toml -Value $DOTFILES\mac\neovide.toml (Mac) +# https://neovide.dev/config-file.html?highlight=toml#config-file fork = false frame = "full" idle = true diff --git a/pip.conf b/pip.conf deleted file mode 100644 index 27a69a5..0000000 --- a/pip.conf +++ /dev/null @@ -1,2 +0,0 @@ -[global] -# index-url = https://pypi.tuna.tsinghua.edu.cn/simple \ No newline at end of file diff --git a/vscode/vscode.vimrc b/vscode/vscode.vimrc index a520fbf..11b8c20 100644 --- a/vscode/vscode.vimrc +++ b/vscode/vscode.vimrc @@ -1,6 +1,6 @@ " ~/.config/vscode/vscode.vimrc " New-Item -ItemType SymbolicLink -Path ~\.config\vscode\vscode.vimrc -Target ~\.dotfiles\vscode\vscode.vimrc -" mkdir -p ~/.config/vscode && ln -sf ~/.dotfiles/vscode/vscode.vimrc ~/.config/vscode/vscode.vimrc +" ln -sf $DOTFILES/vscode/vscode.vimrc ~/.config/vscode/vscode.vimrc " And go to vscode vim setting: "vim.vimrc.path": "$HOME/.config/vscode/vscode.vimrc", diff --git a/wsl/.zshrc b/wsl/.zshrc index b8e8331..cb85f8a 100644 --- a/wsl/.zshrc +++ b/wsl/.zshrc @@ -1,5 +1,5 @@ # ~/.config/zsh/.zshrc -# ln -s ~/.dotfiles/wsl/.zshrc ~/.config/zsh/.zshrc +# ln -s $DOTFILES/wsl/.zshrc ~/.config/zsh/.zshrc ### Variables ### export DOTFILES="$HOME/.dotfiles" diff --git a/zsh/.zshenv b/zsh/.zshenv index 82779fe..c196353 100644 --- a/zsh/.zshenv +++ b/zsh/.zshenv @@ -1,5 +1,5 @@ # ~/.zshenv -# ln -s ~/.dotfiles/zsh/.zshenv ~/.zshenv +# ln -s $DOTFILES/zsh/.zshenv ~/.zshenv # This file is sourced by all zsh sessions upon startup. # Use XDG Base Directory Specification diff --git a/zsh/keymap.zsh b/zsh/keymap.zsh index 9a51834..32cceb0 100644 --- a/zsh/keymap.zsh +++ b/zsh/keymap.zsh @@ -1,4 +1,4 @@ -# ~/.dotfiles/keymap.zsh +# $DOTFILES/keymap.zsh bindkey -v # Vi Keybindings # Colemak hnei