many changes
This commit is contained in:
16
README.md
16
README.md
@@ -2,11 +2,19 @@
|
|||||||
|
|
||||||
[](https://github.com/trekhleb/state-of-the-art-shitcode)
|
[](https://github.com/trekhleb/state-of-the-art-shitcode)
|
||||||
|
|
||||||
Automatically configure terminal according to my habits.
|
Automatically configure terminals according to my habits.
|
||||||
|
|
||||||
## For `ZSH`
|
## For `ZSH`
|
||||||
Using `Oh-My-ZSH` framework to manage plugins, and `Starship` to customize prompt.
|
Using `Oh-My-ZSH` framework to manage plugins, and `Starship` to customize prompt.
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
`Oh-My-ZSH` is installed at `$HOME/.oh-my-zsh`;
|
||||||
|
`$HOME/.zshrc` is linked to `zsh/zshrc`;
|
||||||
|
`$HOME/.config/starship.toml` is linked to `starship/starship.toml`;
|
||||||
|
|
||||||
|
Required software:
|
||||||
|
`git`; `fzf`; `zoxide`; `python`; `starship`
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
git clone https://gitea.meip.work/gwbeip/TerminalPolyjuice.git $HOME/.TerminalPolyjuice
|
git clone https://gitea.meip.work/gwbeip/TerminalPolyjuice.git $HOME/.TerminalPolyjuice
|
||||||
cd $HOME/.TerminalPolyjuice/zsh
|
cd $HOME/.TerminalPolyjuice/zsh
|
||||||
@@ -14,4 +22,8 @@ zsh polyjuice.sh install_ohmyzsh config_starship check
|
|||||||
```
|
```
|
||||||
|
|
||||||
`zsh/zshenv` contains some useful `$PATH`
|
`zsh/zshenv` contains some useful `$PATH`
|
||||||
`zsh/p10k.zsh` includes the configuration for execution time when using `powerlevel10k`
|
|
||||||
|
`zsh/p10k.zsh` includes the configuration for execution time when using `powerlevel10k`
|
||||||
|
|
||||||
|
## For `powershell`
|
||||||
|
|
||||||
|
@@ -1,10 +1,33 @@
|
|||||||
|
# Install `PSReadLine`
|
||||||
|
Execute following the instruction in powershell to install `PSReadLine` and enable `IntelliSense`
|
||||||
|
```powershell
|
||||||
|
Install-Module -Name PSReadLine -AllowClobber -Force
|
||||||
|
Set-PSReadLineOption -PredictionSource History
|
||||||
|
```
|
||||||
|
|
||||||
# Emacs mode
|
# Emacs mode
|
||||||
|
Add the following line into `$PROFILE`
|
||||||
|
```powershell
|
||||||
Set-PSReadLineOption -EditMode Emacs
|
Set-PSReadLineOption -EditMode Emacs
|
||||||
|
```
|
||||||
|
|
||||||
|
# Command Not Found
|
||||||
|
Add the following line into `$PROFILE`
|
||||||
|
```powershell
|
||||||
|
Import-Module -Name Microsoft.WinGet.CommandNotFound
|
||||||
|
```
|
||||||
|
|
||||||
|
# Starship
|
||||||
|
Create symbolic link `$HOME\.config\starship.toml` point to `$HOME\.TerminalPolyjuice\starship\starship.toml`
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
New-Item -ItemType SymbolicLink -Path "$HOME\.config\starship.toml" -Target "$HOME\.TerminalPolyjuice\starship\starship.toml"
|
||||||
|
```
|
||||||
|
|
||||||
# Oh-My-Posh
|
# Oh-My-Posh
|
||||||
Copy *.omp.json to `$env:POSH_THEMES_PATH`
|
Copy *.omp.json to `$env:POSH_THEMES_PATH`
|
||||||
Edit $PROFILE and add `oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH/powerlevel10k_rainbow_eip.omp.json" | Invoke-Expression` at the top.
|
Edit $PROFILE and add
|
||||||
|
```powershell
|
||||||
# Command Not Found
|
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH/powerlevel10k_rainbow_eip.omp.json" | Invoke-Expression
|
||||||
Import-Module -Name Microsoft.WinGet.CommandNotFound
|
```
|
||||||
|
at the top.
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
# "$schema" = 'https://starship.rs/config-schema.json'
|
"$schema" = 'https://starship.rs/config-schema.json'
|
||||||
|
|
||||||
format = """
|
format = """
|
||||||
[](color_orange)\
|
[](color_orange)\
|
||||||
|
6
wsl/README.md
Normal file
6
wsl/README.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# Disable adding windows path to WSL
|
||||||
|
edit `/etc/wsl.conf` and add:
|
||||||
|
```toml
|
||||||
|
[interop]
|
||||||
|
appendWindowsPath = false
|
||||||
|
```
|
@@ -122,7 +122,7 @@ fi
|
|||||||
# copying $HOME/.zshrc
|
# copying $HOME/.zshrc
|
||||||
current_dir=$(dirname $(realpath "$0"))
|
current_dir=$(dirname $(realpath "$0"))
|
||||||
|
|
||||||
if $(file "$HOME/.zshrc"); then
|
if [ -f "$HOME/.zshrc" ]; then
|
||||||
if $(file "$HOME/.zshrc" | grep -q "symbolic link") ; then
|
if $(file "$HOME/.zshrc" | grep -q "symbolic link") ; then
|
||||||
if [[ $(readlink "$HOME/.zshrc") != "$current_dir/zshrc" ]]; then
|
if [[ $(readlink "$HOME/.zshrc") != "$current_dir/zshrc" ]]; then
|
||||||
ln -sf "$current_dir/zshrc" "$HOME/.zshrc"
|
ln -sf "$current_dir/zshrc" "$HOME/.zshrc"
|
||||||
|
Reference in New Issue
Block a user