mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-29 21:41:00 +08:00
commit
83e4403b03
@ -1,64 +1,62 @@
|
||||
translating---geekpi
|
||||
|
||||
Powerline – A Powerful Statusline Plugin For Vim & Bash Terminal
|
||||
Powerline - Vim 和 Bash 中的一个强大状态栏插件
|
||||
============================================================
|
||||
|
||||
|
||||
[Powerline][2] is a statusline plugin for vim, zsh, bash, tmux, IPython, Awesome, bar, fish, lemonbar, pdb, rc, shell, tcsh, wm, i3 and Qtil. It provides statuslines to applications and make all applications more beautiful. It’s written in Python.
|
||||
[Powerline][2] 是 vim、zsh、bash、tmux、IPython、Awesome、bar、fish、lemonbar、pdb、rc、shell、tcsh、wm、i3 和 Qtil 中的一个状态栏插件。它给程序提供状态栏,并使程序更好看。它用 Python 写成。
|
||||
|
||||
It’s Extensible and feature rich, written in Python which is very thin and doesn’t required any third-party dependencies other than a Python interpreter.
|
||||
它是可扩展的并且功能丰富,它用 Python 写成,非常轻便不需要任何第三方的依赖,只需要一个 Python 解释器。
|
||||
|
||||
Stable and testable code base which is throughly tested and works fine with Python 2.6+ and Python 3.
|
||||
稳定以及可测试代码库经过完整的测试,并且在 Python 2.6+ 和 Python 3 中工作良好。
|
||||
|
||||
Statuslines Originally created exclusively for vim, later the project has evolved to provide statuslines in many Linux applications such as zsh, bash, tmux, IPython, Awesome, i3 and Qtil.
|
||||
最初状态栏只在 vim 中可用,随后项目进化为为许多 Linux 程序如 zsh、bash、tmux、IPython、Awesome、i3 和 Qtil 提供状态栏。
|
||||
|
||||
Configuration and colorschemes written in JSON. It’s a standard and easy file format that allows user to configure supported applications with Powerline’s.
|
||||
配置以及配色方案用 JSON 写成。它是一种标准简易的文件格式,允许用户配置 Powerline 支持的程序。
|
||||
|
||||
Fast and lightweight, with daemon support for even better performance.
|
||||
快速并且轻量级,支持守护进程为了更好的性能。
|
||||
|
||||
#### Install pre requisites
|
||||
#### 安装预先要求
|
||||
|
||||
Make sure your system should have below pre requisite packages. If no, install before proceeding powerline installation.
|
||||
确保你的系统有下面预先要求的包。如果没有,在安装 powerline 之前先安装它们。
|
||||
|
||||
For Debian users, use [APT Package Manager][3] or [Apt-Get Package Manager][4] to install Audit package.
|
||||
对于 Debian 用户,使用[ APT 包管理器][3]或者[ Apt-Get 包管理器][4]安装需要的包。
|
||||
|
||||
```
|
||||
$ sudo apt-get install python-pip git
|
||||
```
|
||||
|
||||
For openSUSE users, use [Zypper Package Manager][5] to install Audit package.
|
||||
对于 openSUSE 用户,使用 [ Zypper 包管理器][5]安装需要的包。
|
||||
|
||||
```
|
||||
$ sudo zypper install python-pip git
|
||||
```
|
||||
|
||||
For Fedora users, use [dnf Package Manager][6] to install Audit package.
|
||||
对于 Fedora 用户,使用[ dnf 包管理器][6]安装需要的包。
|
||||
|
||||
```
|
||||
$ sudo dnf install python-pip git
|
||||
```
|
||||
|
||||
For Arch Linux users, use [pacman Package Manager][7] to install Audit package.
|
||||
对于 Arch Linux 用户,使用[ pacman 包管理器][7]安装需要的包。
|
||||
|
||||
```
|
||||
$ sudo pacman -S python-pip git
|
||||
```
|
||||
|
||||
For CentOS/RHEL user, use [yum Package Manager][8] to install Audit package.
|
||||
对于 CentOS/RHEL 用户,使用[ yum 包管理器][8]安装需要的包。
|
||||
|
||||
```
|
||||
$ sudo yum install python-pip git
|
||||
```
|
||||
|
||||
#### How to install Powerline in Linux
|
||||
#### 如何在 Linux 中安装 Powerline
|
||||
|
||||
In this article, we are going to show you how to install Powerline. Also show you how to use with Bash, tumx & Vim in Debian and RHEL based systems.
|
||||
在本篇中,我们将向你展示如何安装 Powerline。以及如何在基于 Debian 以及 RHEL 的系统中在 Bash、tumx 和 Vim 中使用。
|
||||
|
||||
```
|
||||
$ sudo pip install git+git://github.com/Lokaltog/powerline
|
||||
```
|
||||
|
||||
Find the powerline installed location in order to configure with applications.
|
||||
找出 powerline 安装位置以便配置程序。
|
||||
|
||||
```
|
||||
$ pip show powerline-status
|
||||
@ -73,9 +71,9 @@ Location: /usr/lib/python2.7/site-packages
|
||||
Requires:
|
||||
```
|
||||
|
||||
#### Add/Enable Powerline on Bash Shell
|
||||
#### 在 Bash Shell 中添加/启用 Powerline
|
||||
|
||||
Add following lines to your `.bashrc` file which will enable powerline to base shell by default.
|
||||
添加下面的行到 `.bashrc` 中,它会默认在基础 shell 中启用 powerline。
|
||||
|
||||
```
|
||||
if [ -f `which powerline-daemon` ]; then
|
||||
@ -86,7 +84,7 @@ if [ -f `which powerline-daemon` ]; then
|
||||
fi
|
||||
```
|
||||
|
||||
Reload the `.bashrc` file to take immediate effect to get the powerline in the same window.
|
||||
重新加载 `.bashrc` 文件使得 powerline 在当前窗口中立即生效。
|
||||
|
||||
```
|
||||
$ source ~/.bashrc
|
||||
@ -94,9 +92,9 @@ $ source ~/.bashrc
|
||||
|
||||
[![](http://www.2daygeek.com/wp-content/uploads/2017/06/install-powerline-in-linux-1.png)][9]
|
||||
|
||||
#### Add/Enable Powerline on tmux
|
||||
#### 在 tmux 中添加/启用 Powerline
|
||||
|
||||
Tmux is one of the best terminal emulator that offers multiple window and statusline but is not looks good compare with powerline statusline. Add following line to your `.tmux.conf` file which will enable powerline to tmux by default. If you don’t found `.tmux.conf` file then create a new one.
|
||||
tmux 是最好的终端仿真程序之一,它提供多窗口以及状态栏,但是相比 powerline 的状态栏看上去不那么好。添加下面的的行到 `.tmux.conf` 中,它会默认在 tmux 中启用 powerline。如果你没有找到 `.tmux.conf` 文件,那么创建一个新的。
|
||||
|
||||
```
|
||||
# vi ~/.tmuc.conf
|
||||
@ -106,9 +104,9 @@ source "/usr/local/lib/python2.7/site-packages/powerline/bindings/tmux/powerline
|
||||
|
||||
[![](http://www.2daygeek.com/wp-content/uploads/2017/06/install-powerline-in-linux-2.png)][10]
|
||||
|
||||
#### Add/Enable Powerline on Vim
|
||||
#### 在 Vim 中添加/启用 Powerline
|
||||
|
||||
Vim is one of the favourite text editor for admins. Enable powerline to add more power to vim by adding below lines into `.vmrc`file. Make a note, in vim 7.x you may not found the .vmrc file in system so don’t worry create a new one and add below lines that’s it.
|
||||
vim 是管理员最爱的文本编辑器之一。添加下面的行到 `.vmrc` 中,启用 powerline 使 vim 更加强大。注意,在 vim 7.x 中,你可能不会在系统中发现 .vimrc 文件,因此不必担心,创建一个新的文件,并添加下面行。
|
||||
|
||||
```
|
||||
# vi ~/.vmrc
|
||||
@ -127,7 +125,7 @@ set t_Co=256
|
||||
via: http://www.2daygeek.com/powerline-adds-powerful-statusline-to-vim-bash-tumx-in-ubuntu-fedora-debian-arch-linux-mint/
|
||||
|
||||
作者:[ 2DAYGEEK · ][a]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
Loading…
Reference in New Issue
Block a user