placeholderPersonalization for Terminal,Shell & Prompt

Personalization for Terminal,Shell & Prompt

📚Related Glossary

MeaningExamples
TerminalA text input and output environment.Windows Terminal,Alacritty,Kitty,Wezterm…
ConsoleA physical terminal.
Shellcommand-line interpreternushell,bash,zsh,fish,powershell…
PromptThe text that appears at the beginning of a command line形如$>>>

⌨️Terminal

个人体验的终端有 Windows Terminal,Wezterm;

Wezterm 可自定义的程度比较高,可以自定义 tab 的位置&样式,但体验过程中,Wezterm 的启动速度相对较慢,目前主要使用 Windows Terminal

我的一些个性化设置

  • 字体: Maple Mono NF CN,对 Ligatures,中文支持比较好的 Nerd Font;
  • toggle focus mode: 选择开启 Focus Mode,可以隐藏上方 tab 栏,让界面更简洁
  • Color Schemes:Tokyo Night 或 Catppuccin Mocha;比较美观的两款夜间主题,你可以在windowsterminalthemes.dev找到更多主题
  • Appearance: 在 Transparency 中选择 Enable acrylic material,启用亚克力效果;透明度 80%

showcase

🐚Shell

个人觉得比较好用的 shell 有 Nushell,fish; Powershell 功能也很强大,但启动速度慢,对使用体验有些影响。

Nushell 社区比较活跃,e.g. nu_scripts 仓库维护了社区用户分享的 nushell 配置,喜欢折腾的可以参考本仓库。

下面是个人的 Nushell Config,配置文件比较长,考虑篇幅,这里只附上关键内容。有需要完整配置的可以联系作者

Keybindings

我下载了 fzf 以及 bat 这两个命令行工具,配合以下配置可以方便的检索历史命令以及文件;此外还有一些比较实用的命令行工具,放在文末

keybindings.nu
$env.config.keybindings = (    $env.config.keybindings    | append {  # history_menu using fzf        name: fzf_history_menu_fzf_ui        modifier: control        keycode: char_r        mode: [emacs, vi_normal, vi_insert]        event: {            send: executehostcommand            cmd: "commandline edit --insert (cat $nu.history-path | fzf --height 70% --layout reverse --border +s --tac | str trim)"        }    }    | append {        name: fuzzy_file        modifier: control        keycode: char_t        mode: emacs        event: {        send: executehostcommand        cmd: "commandline edit --insert (fzf --layout=reverse --preview 'bat --color=always --style=numbers --line-range=:500 {}')"        }    })# 在你的config.nu里source <path_to_keybind.nu>

Completions

nu_scripts 仓库中提供了部分命令的补全脚本,如 dockergit 等,下载后放在某个目录下,然后在 config.nu 中引用补全脚本即可

此外,Nushell 支持使用 zoxide,carapace 等外部补全工具,可以不必依赖内置的补全脚本,个人相关配置详见这篇文章,Nushell Cook Book 中也有介绍 External Completers

ide-style

list-style

Prompt

Prompt 的美化方案有很多,比较知名的有 starship,ohmyzsh,ohmyposh; 这里采用 ohmyposh

此前 omp 采用 Powershell 编写,后来为了兼容性用 go 重写,现在适用于 powershell,nushell,fish,zsh,bash 等等,甚至在安卓上也可以食用;

oh my posh 对自定义的支持程度非常高,支持的 Prompt 内容也很广泛,包括但不限于

  • OS
  • docker
  • git
  • java、python、golang、rust…
  • path
  • Execution Time

添加一些 prompt 对开发体验有一定提升。我在官方提供的主题上进行了自定义,配置文件放在后面仅供参考

显示效果如下图所示,配置文件见 dotfiles/tui_cli/ohmyposh/omp.json at main · Efterklang/dotfiles

prompt

🛠️CLI & TUI

下面是一些比较实用/有意思的命令行工具

TUI

  • gitui
    Blazing 💥 fast terminal-ui for git written in rust 🦀
    类似于 lazygit,在终端中管理 git repo,适合不想动鼠标的人
  • btop
    A monitor of resources
    任务管理器 TUI 版,同样适合纯键盘操作
  • yazi
    💥 Blazing fast terminal file manager written in Rust, based on async I/O.
    支持 windows 平台的 terminal file manager,除此之外 midnight commander 也支持 windows;适合纯键盘操作

CLI

  • bat
    A cat clone with syntax highlighting and Git integration.
    相比 cat 多了语法高亮,可选择多种主题;
  • zoxide
    A smarter cd command. Supports all major shells.
    快速切换目录

下面三个都是搜索类的工具,ripgrep 是 grep 的替代品(项目名意为 R.I.P grep),VSCode 的快速搜索便是用的 ripgrep,fzf 可以与其它的工具相结合,用于模糊搜找文件,历史记录等等…

  • ripgrep
    ripgrep recursively searches directories for a regex pattern while respecting your gitignore
  • fd
    A simple, fast and user-friendly alternative to find.
  • fzf
    🌸 A command-line fuzzy finder;

MISC

  • fastfetch
  • curlie
    The power of curl, the ease of use of httpie.
  • gping
    Ping, but with a graph
  • code2prompt
  • tokei

Personalization for Terminal,Shell & Prompt

https://vluv.space/terminal/

Author

GnixAij

Posted

2024-10-19

Updated

2026-02-03

License