Arch安装zsh以及通过 Oh-My-ZSH! 开源项目的配置

Arch安装zsh以及通过 Oh-My-ZSH! 开源项目的配置

首先:安装官方源的 zsh

$ sudo pacman -S zsh

安装 wget 、git 并获取开源项目的安装脚本

$ sudo pacman -S wget
$ sudo pacman -S git
$ wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh
$ chmod +x install.sh
$ ./install.sh

按照系统的提醒设置为默认的shell

或者设置为默认的shell

 sudo chsh -s /bin/zsh 

选择合适的主题

#==========================================================================
# 主题的设置文件在 : ~/.zshrc                              
# 主题的存放目录在 : ~/.oh-my-zsh/themes   
# 推荐主题        : ZSH_THEME="crcandy"           
#==========================================================================
ZSH_THEME="robbyrussel"    # 这是默认主题 robbyrussel ,更改别的主题只需替换这个名字即可。
ZSH_THEME="random"         # 如果一时之间找不到合适的,可以用:random 这里会随机获取主题。
$ echo $RANDOM_THEME       # 然后使用 echo 命令读取当前主题,可以将喜欢的主题保存到 ZSH_THEME。

4.小技巧
4.1 给history命令增加时间

$ vim ~/.zshrc
HIST_STAMPS="yyyy-mm-dd" 
source ~/.zshrc

更新oh_my_zsh

# 设置自动更新oh-my-zsh : ~/.zshrc
DISABLE_UPDATE_PROMPT=true
# 加入需要手动更新
$ upgrade_oh_my_zsh

设置插件

# 插件存放的目录 : ~/.oh-my-zsh/plugins
# 插件设置 plugins=(插件名)
plugins=(git)  # 默认启用git插件
# 网上推荐的几个好用插件:

zsh-history-substring-search
https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/history-substring-search

zsh-syntax-highlighting
https://github.com/zsh-users/zsh-syntax-highlighting

zsh-autosuggestions
https://github.com/zsh-users/zsh-autosuggestions

更多插件可参考

https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins
https://github.com/unixorn/awesome-zsh-plugins
https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins-Overview

卸载

uninstall_oh_my_zsh  # 直接命令行输入
  • 2
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
使用electron-builder和electron-updater给项目配置自动更新可以分为以下几个步骤: 1. 安装所需依赖: - 在项目根目录下运行以下命令安装electron-builder和electron-updater: ```shell npm install electron-builder electron-updater --save-dev ``` 2. 配置electron-builder: - 在项目根目录下创建一个名为`electron-builder.json`的文件,用于配置构建选项。以下是一个示例配置文件: ```json { "appId": "com.example.app", "productName": "MyApp", "linux": { "target": "deb" }, "mac": { "target": "dmg", "category": "public.app-category.developer-tools" }, "win": { "target": [ { "target": "nsis", "arch": [ "x64", "ia32" ] } ] }, "directories": { "output": "build" }, "publish": { "provider": "github", "owner": "your-github-username", "repo": "your-github-repo", "private": true } } ``` 上述示例配置文件中,`appId`是应用程序的ID,`productName`是应用程序的名称,`linux`、`mac`、`win`分别表示不同平台的构建选项,`directories.output`指定构建输出目录,`publish`配置用于自动更新的发布选项。 3. 配置自动更新: - 在主进程代码中,按照以下步骤进行配置: ```javascript const { app, autoUpdater } = require('electron'); const log = require('electron-log'); autoUpdater.logger = log; autoUpdater.logger.transports.file.level = 'info'; autoUpdater.setFeedURL({ provider: 'github', owner: 'your-github-username', repo: 'your-github-repo', private: true }); autoUpdater.on('update-available', () => { // 处理更新可用事件 }); autoUpdater.on('update-downloaded', () => { // 处理更新下载完成事件 autoUpdater.quitAndInstall(); }); app.on('ready', () => { if (process.env.NODE_ENV === 'production') { autoUpdater.checkForUpdates(); } }); ``` 上述代码中,`autoUpdater.setFeedURL`用于设置自动更新的URL,`autoUpdater.on('update-available')`用于处理更新可用事件,`autoUpdater.on('update-downloaded')`用于处理更新下载完成事件,`autoUpdater.checkForUpdates()`用于检查更新。 4. 构建和发布应用: - 在项目根目录下运行以下命令构建应用: ```shell npx electron-builder ``` - 构建完成后,可以将应用程序的安装包发布到GitHub等平台上。 以上就是使用electron-builder和electron-updater给项目配置自动更新的步骤。请根据自己的实际情况进行配置和调整。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值