1 windows terminal : oh-my-posh
# 安装最新的Powershell
winget install --id Microsoft.Powershell --source winget
# 智能补全
Install-Module -Name PSReadLine -AllowClobber -Force
# 修改配置
notepad $profile
# profile文件内容
C:\\Users\\user\\AppData\\Local\\Programs\\oh-my-posh\\bin\\oh-my-posh.exe init pwsh --config $env:POSH_THEMES_PATH\montys.omp.json | Invoke-Expression
Import-Module PSReadLine # 历史命令联想
# 设置预测文本来源为历史记录
Set-PSReadLineOption -PredictionSource History
# 设置 Tab 为菜单补全和 Intellisense
Set-PSReadLineKeyHandler -Key "Tab" -Function MenuComplete
# 每次回溯输入历史,光标定位于输入内容末尾
Set-PSReadLineOption -HistorySearchCursorMovesToEnd
# 设置向上键为后向搜索历史记录
Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward
# 设置向下键为前向搜索历史纪录
Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward
# 安装OhMyPosh
winget install JanDeDobbeleer.OhMyPosh -s winget
# 更新OhMyPosh
oh-my-posh upgrade
# 安装字体
oh-my-posh font install
# 官方推荐安装 Meslo
# 无法加载文件C:\Users\xxx\Documents\WindowsPowerShell\profile.ps1
get-ExecutionPolicy
# 显示Restricted
set-ExecutionPolicy RemoteSigned
# 输入y
Get-PoshThemes
# 默认主题一般已经下载C:\Users\user\AppData\Local\Programs\oh-my-posh\themes
# 更换主题,更改profile文件的”montys.omp.json“中的montys(即为主题名)
Set-PoshPrompt -Theme 主题名
//新增命令
//设置——打开JSON文件
{
"command":
{
"action": "sendInput",
"input": "source /opt/qct/sa525m/environment-setup-telaf-app"
},
"name": "source"
},
{
"command":
{
"action": "sendInput",
"input": "mkapp -t sa525m time_manager.adef -C \"-O2\" -X \"-O2\""
},
"name": "mkapp"
},
{
"command":
{
"action": "sendInput",
"input": "adb push time_manager.sa525m.update /data/"
},
"name": "adb push"
},
{
"command":
{
"action": "sendInput",
"input": "sdir bind \"<root>.taf_sim\" \"<telaf>.taf_sim\""
},
"name": "sdir bind"
}
# ssh远程
设置——添加新配置文件
命令行:
C:\Program Files\PowerShell\7\pwsh.exe -NoExit -Command "ssh test@127.0.0.0 -p 10028"
# 保持SSH连接
# C:\Users\用户名\.ssh\config,增加如下两行
ServerAliveInterval 60
ServerAliveCountMax 1440
# 下载文件
Invoke-WebRequest -Uri https://github.com/wez/wezterm/releases/download/20240203-110809-5046fc22/WezTerm-windows-20240203-110809-5046fc22.zip -OutFile "F:\WezTerm-windows.zip"
2 Ubuntu : oh-my-posh
# 安装
sudo wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-amd64 -O /usr/local/bin/oh-my-posh
sudo chmod +x /usr/local/bin/oh-my-posh
# 配置
mkdir ~/.poshthemes
sudo wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/themes.zip -O ~/.poshthemes/themes.zip
unzip ~/.poshthemes/themes.zip -d ~/.poshthemes
chmod u+rw ~/.poshthemes/*.json
rm ~/.poshthemes/themes.zip
# Ubuntu 18.04及以下,需要先安装正确版本的 golang
sudo add-apt-repository ppa:longsleep/golang-backports
sudo apt update
# 自定义 Ubuntu 提示
for file in ~/.poshthemes/*.omp.json; do echo "$file\n"; oh-my-posh --config $file --shell universal; echo "\n"; done;
# 配置启动主题
vi ~/.bashrc
eval "$(oh-my-posh --init --shell bash --config ~/.poshthemes/montys.omp.json)"
# 安装字体
wget -P ~/.local/share/fonts https://github.com/ryanoasis/nerd-fonts/releases/download/v2.1.0/Meslo.zip
unzip Meslo.zip -d Meslo
cd Meslo
sudo mkdir /usr/share/fonts/ttf
sudo cp *.ttf /usr/share/fonts/ttf
cd /usr/share/fonts/ttf
sudo chmod 744 *
sudo mkfontscale
sudo mkfontdir
sudo fc-cache -f -v
# 查看字体
fc-list | grep Meslo
3 Ubuntu : oh-my-zsh
# 安装zsh
sudo apt install zsh -y
# 设为默认shell
chsh -s /bin/zsh
# 安装oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# 卸载oh-my-zsh
uninstall_oh_my_zsh
# 卸载zsh
sudo apt remove zsh
# zsh-autosuggestions 命令行命令键入时的历史命令建议
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
# zsh-syntax-highlighting 命令行语法高亮插件
git clone https://gitee.com/Annihilater/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
# 安装Powerleve10k主题
git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
# 更改配置文件
vi ~/.zshrc
ZSH_THEME="powerlevel10k/powerlevel10k"
# 启动错误命令自动更正
ENABLE_CORRECTION="true"
# 在命令执行的过程中,使用小红点进行提示
COMPLETION_WAITING_DOTS="true"
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
source ~/.zshrc
# 配置主题
p10k configure
使用visual studio远程调试,linux系统安装oh_my_posh或zsh时,均提示报错无法进行Debug。只有使用默认bash时,VS才可以进行远程调试。但是,远程编译生成不受影响。