当前位置: 首页 > news >正文

ble.sh 的安装和用法

以下是关于 ble.sh 的安装和使用指南:

安装 ble.sh

ble.sh 是一个 Bash Line Editor,提供了类似于 zsh-autosuggestions 的自动补全和语法高亮功能。以下是安装步骤:

  1. 克隆 ble.sh 仓库

    git clone --recursive https://github.com/akinomyoga/ble.sh.git
    
  2. 安装 ble.sh

    make -C ble.sh install PREFIX=~/.local
    
  3. 配置 Bashrc

    echo 'source ~/.local/share/blesh/ble.sh' >> ~/.bashrc
    
  4. 重启终端或运行以下命令使配置生效

    source ~/.bashrc
    

使用 ble.sh

主要功能

  • 自动补全:ble.sh 提供基于命令历史和文件路径的自动补全功能。
  • 语法高亮:支持对复杂命令结构的语法高亮,包括嵌套命令和多个 here 文档等。
  • 菜单式补全:使用 Tab 键可以在候选列表中选择补全项。

自定义颜色设置

如果你想自定义 ble.sh 的颜色设置,可以使用 ble-face 命令。要使这些设置持久化,请将它们添加到 ~/.blerc 文件中。

  1. 创建或编辑 ~/.blerc 文件

    touch ~/.blerc
    
  2. 在 ~/.blerc 中添加颜色设置

    # 示例:设置命令行输入的背景色和前景色
    ble-face --set background '#000000' --set foreground '#ffffff'
    
  3. 保存并退出编辑器


常见问题

  • 安装后无法生效:确保已经正确添加了 source ~/.local/share/blesh/ble.sh.bashrc 文件中,并重启终端或手动运行 source ~/.bashrc
  • 颜色设置不持久:将颜色设置添加到 ~/.blerc 文件中,以使其在每次启动时自动应用。

通过这些步骤,你可以成功安装和使用 ble.sh,享受其带来的自动补全和语法高亮功能!

Citations:
[1] https://forum.manjaro.org/t/can-you-help-me-install-ble-sh/119252
[2] https://www.baeldung.com/linux/shell-add-syntax-highlighting-other-features
[3] https://github.com/akinomyoga/ble.sh
[4] https://bash.forret.com/2022/08/ble-sh-%E2%80%95bash-line-editor%E2%80%95/
[5] https://yinan.me/shell-auto-suggestions.html
[6] https://superuser.com/questions/1837033/changed-color-settings-of-ble-sh-bash-terminal-are-not-applied
[7] https://github.com/ohmybash/oh-my-bash/issues/108
[8] https://superuser.com/questions/1512618/autocompletion-background-colour-in-ble-sh
[9] https://www.reddit.com/r/bash/comments/15t7q2h/is_there_zshfishlike_autosuggestions_completions/
[10] https://github.com/akinomyoga/ble.sh/discussions/254
[11] https://www.reddit.com/r/bash/comments/1d52uu3/many_open_issues_for_blesh_bash_line_editor/
[12] https://superuser.com/questions/288714/bash-autocomplete-like-zsh
[13] https://forum.atuin.sh/t/atuin-bash-and-ble-sh/175
[14] https://forums.linuxmint.com/viewtopic.php?t=400895
[15] https://www.reddit.com/r/bash/comments/1gzn6gu/blesh_performance_tune_help/
[16] https://www.codyhiar.com/blog/switching-back-to-bash-from-zsh/
[17] https://forums.gentoo.org/viewtopic-t-1167425-start-0-postdays-0-postorder-asc-highlight-.html?sid=0d669cf37d07f88c3777bba4b6e63aec
[18] https://askubuntu.com/questions/1493857/powershell-like-history-auto-suggestion-for-bash
[19] https://discussion.fedoraproject.org/t/telometto-ble-sh/38948
[20] https://github.com/akinomyoga/ble.sh/issues/178
[21] https://unix.stackexchange.com/questions/649545/how-do-i-show-a-bash-autocomplete-result-as-a-faded-text-in-the-terminal
[22] https://unix.stackexchange.com/questions/109366/does-bash-have-similar-features-such-as-fishs-autosuggestions-and-highlighting
[23] https://github.com/akinomyoga/ble.sh/discussions/411
[24] https://www.youtube.com/watch?v=rFNzCMU-wlI
[25] https://wiki.archlinux.org/title/Bash
[26] https://blesh.net/interface/
[27] https://dev.to/goranvasic/using-zsh-and-zsh-autosuggestions-on-windows-terminal-with-oh-my-posh-theme-do6
[28] https://github.com/akinomyoga/ble.sh/releases
[29] https://harduex.com/blog/fish-like-autosuggestions-in-bash-shell/

相关文章:

  • 如何在SpringBoot中灵活使用异步事件?
  • C++—vector类的使用及模拟实现
  • Windows 11下Git Bash执行cURL脚本400问题、CMD/PowerShell不能执行多行文本等问题记录及解决方案
  • 进程(上)【Linux操作系统】
  • Web基础:HTML快速入门
  • doris:Elasticsearch
  • 六轴传感器ICM-20608
  • 10. 【.NET 8 实战--孢子记账--从单体到微服务--转向微服务】--微服务基础工具与技术--Ocelot 网关--认证
  • VBA 数据库同一表的当前行与其他行的主键重复判断实现方案1
  • Spike RISC-V ISA 模拟器
  • doris :SAP HANA
  • gRPC学习笔记
  • 双指针算法——配合例题讲解
  • 镭神C32测试LEGO-LOAM
  • IntelliJ IDEA 2021版创建springboot项目的五种方式
  • 深度解析前端页面性能优化
  • Python与SQL深度融合实战案例:打造你的数据处理秘籍
  • C++后端服务器开发技术栈有哪些?有哪些资源或开源库拿来用?
  • 嵌入式八股C语言---指针与函数篇
  • ESP8266 入门(第 2 部分):使用 AT 命令
  • 网站里的地图定位怎么做的/舆情监测分析系统
  • 重庆建设安全管理网站/深圳营销型网站设计公司
  • 凡科网做网站教程/网站流量查询工具
  • 中小企业网站设计/广东疫情动态人民日报
  • 每个城市建设规划在哪个网站/销售课程视频免费
  • 企业在线/seo排名赚钱