自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

在Fedora上優(yōu)化bash或zsh

系統(tǒng) Linux
本文將向你展示如何在 Fedora 的命令行解釋器(CLI)Shell 中設(shè)置一些強大的工具。如果使用bash(默認)或zsh,F(xiàn)edora 可讓你輕松設(shè)置這些工具。

[[281909]]

本文將向你展示如何在 Fedora 的命令行解釋器(CLI)Shell 中設(shè)置一些強大的工具。如果使用bash(默認)或zsh,F(xiàn)edora 可讓你輕松設(shè)置這些工具。

前置需求

這需要一些已安裝的軟件包。在 Fedora 工作站上,運行以下命令:

  1. sudo dnf install git wget curl ruby ruby-devel zsh util-linux-user redhat-rpm-config gcc gcc-c++ make

在 Silverblue 上運行:

  1. sudo rpm-ostree install git wget curl ruby ruby-devel zsh util-linux-user redhat-rpm-config gcc gcc-c++ make

注意:在 Silverblue 上,你需要重新啟動才能繼續(xù)。

字體

你可以通過安裝新字體使終端煥然一新。為什么不使用可以同時顯示字符和圖標(biāo)的字體呢?

Nerd-Fonts

打開一個新終端,然后鍵入以下命令:

  1. git clone https://github.com/ryanoasis/nerd-fonts ~/.nerd-fonts
  2. cd .nerd-fonts
  3. sudo ./install.sh

Awesome-Fonts

在工作站上,使用以下命令進行安裝:

  1. sudo dnf fontawesome-fonts

在 Silverblue 上鍵入:

  1. sudo rpm-ostree install fontawesome-fonts

Powerline

Powerline 是 vim 的狀態(tài)行插件,并為其他幾個應(yīng)用程序也提供了狀態(tài)行和提示符,包括 bash、zsh、tmus、i3、Awesome、IPython 和 Qtile。你也可以在官方文檔站點上找到更多信息。

安裝

要在 Fedora 工作站上安裝 Powerline 實用程序,請打開一個新終端并運行:

  1. sudo dnf install powerline vim-powerline tmux-powerline powerline-fonts

在 Silverblue 上,命令更改為:

  1. sudo rpm-ostree install powerline vim-powerline tmux-powerline powerline-fonts

注意:在 Silverblue 上,你需要重新啟動才能繼續(xù)。

激活 Powerline

要使 Powerline 默認處于活動狀態(tài),請將下面的代碼放在 ~/.bashrc 文件的末尾:

  1. if [ -f `which powerline-daemon` ]; then
  2. powerline-daemon -q
  3. POWERLINE_BASH_CONTINUATION=1
  4. POWERLINE_BASH_SELECT=1
  5. . /usr/share/powerline/bash/powerline.sh
  6. fi

最后,關(guān)閉終端并打開一個新終端。它看起來像這樣:

[[281911]]

Oh-My-Zsh

Oh-My-Zsh 是用于管理 Zsh 配置的框架。它捆綁了有用的功能、插件和主題。要了解如何將 Zsh 設(shè)置為默認外殼程序,請參見這篇文章。

安裝

在終端中輸入:

  1. sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

或者,你也可以輸入以下內(nèi)容:

  1. sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

最后,你將看到如下所示的終端:

[[281912]]

恭喜,Oh-my-zsh 已安裝成功。

主題

安裝后,你可以選擇主題。我喜歡使用 powerlevel10k。優(yōu)點之一是它比 powerlevel9k 主題快 100 倍。要安裝它,請運行以下命令行:

  1. git clone https://github.com/romkatv/powerlevel10k.git ~/.oh-my-zsh/themes/powerlevel10k

并在你的 ~/.zshrc 文件設(shè)置 ZSH_THEME

  1. ZSH_THEME=powerlevel10k/powerlevel10k

關(guān)閉終端。再次打開終端時,powerlevel10k 配置向?qū)⒃儐柲銕讉€問題以正確配置提示符。

[[281913]]

完成 powerline10k 配置向?qū)Ш?,你的提示符將如下所示?/p>

[[281914]]

如果你不喜歡它。你可以隨時使用 p10k configure 命令來運行 powerline10k 向?qū)А?/p>

啟用插件

插件存儲在 .oh-my-zsh/plugins 文件夾中。要激活插件,你需要編輯 ~/.zshrc 文件。安裝插件意味著你創(chuàng)建了一系列執(zhí)行特定功能的別名或快捷方式。

例如,要啟用 firewalld 和 git 插件,請首先編輯 ~/.zshrc

  1. plugins=(firewalld git)

注意:使用空格分隔插件名稱列表。

然后重新加載配置:

  1. source ~/.zshrc

要查看創(chuàng)建的別名,請使用以下命令:

  1. alias | grep firewall[[281915]]

更多配置

我建議安裝語法高亮和語法自動建議插件。

  1. git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
  2. git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

將它們添加到文件 ~/.zshrc 的插件列表中。

  1. plugins=( [plugins...] zsh-syntax-highlighting zsh-autosuggestions)

重新加載配置。

  1. source ~/.zshrc

查看結(jié)果:

[[281916]]

彩色的文件夾和圖標(biāo)

colorls 是一個 ruby gem,可使用顏色和超棒的字體圖標(biāo)美化終端的 ls 命令。你可以訪問官方網(wǎng)站以獲取更多信息。

因為它是個 ruby gem,所以請按照以下簡單步驟操作:

  1. sudo gem install colorls

要保持最新狀態(tài),只需執(zhí)行以下操作:

  1. sudo gem update colorls

為防止每次輸入 colorls,你可以在 ~/.bashrc 或 ~/.zshrc 中創(chuàng)建別名。

  1. alias ll='colorls -lA --sd --gs --group-directories-first'
  2. alias ls='colorls --group-directories-first'

另外,你可以為 colorls 的選項啟用制表符補完功能,只需在 shell 配置末尾輸入以下行:

  1. source $(dirname ($gem which colorls))/tab_complete.sh

重新加載并查看會發(fā)生什么:

 

 

 

 

責(zé)任編輯:龐桂玉 來源: Linux中國
相關(guān)推薦

2018-06-11 09:55:09

LinuxFedorazsh

2011-06-13 14:03:57

zshellbash shellLinux

2023-07-27 17:41:02

BashZshFish

2020-07-20 18:30:44

Fedora 32DockerLinux

2014-10-11 11:30:43

CentOSDocker

2021-10-03 14:47:26

Fedora CoreGitHub Acti運行器

2022-12-03 16:02:51

2020-08-16 09:00:15

樹莓派FedoraLinux

2021-08-19 18:28:22

FedoraLinuxOpenCV

2019-10-29 16:30:10

FedoraSSH端口Linux

2019-12-02 15:23:34

FedoraLinuxGIMP

2024-01-01 18:52:35

軟件包ostree

2019-07-08 15:38:56

FedoraJupyter數(shù)據(jù)科學(xué)家

2019-03-24 19:16:35

FedoraSSH系統(tǒng)運維

2015-06-01 12:19:03

FedoraCentOSSamba

2019-08-01 09:35:09

LinuxBashmessages

2020-10-22 16:29:32

LinuxMariaDBMySQL

2022-03-21 21:28:00

Homebrew包管理器Linux

2022-09-22 16:21:43

開源GUI 應(yīng)用

2021-03-13 16:38:15

LinuxFedora發(fā)行版
點贊
收藏

51CTO技術(shù)棧公眾號