Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install Powerline and configure Vim, Bash, tmux, IPython, pdb

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to install Powerline and configure Vim, Bash, tmux, IPython, pdb". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let the editor take you to learn "how to install Powerline and configure Vim, Bash, tmux, IPython, pdb"!

Using Bash is a basic skill developed under Linux. Although there are zsh, fish and other popular Shell, but Bash is the default in most cases, the basic of the basic.

The prompt (Prompt) of Shell is # by default under root and $under ordinary users, but this can only prompt the user's permission information. Bash makes some enhancements by default, but it is less informative and less beautiful.

This article mainly introduces the CLI beautification configuration based on Powerline.

Introduction to Powerline

Powerline started as a status bar plug-in for Vim, and later developed into a terminal prompt tool for Shell such as Bash, zsh, fish and so on. In addition, it also supports tmux, IPython, Awesome, i3, Qtile and other software.

Powerline in Vim (and tmux)

In this enhanced status bar, we can see information about Vim mode, Git branch, file path, Git status, and so on. It is not only beautiful, but also practical.

In Bash, Powerline is just as powerful. Because the scene is different from Vim, the display content is also different. By default, there are user name, current path, number of background tasks, etc., and hostname in remote mode. As needed, you can also add more system elements, such as the previous command return value, time, battery, and so on.

Powerline in Bash (and tmux)

In tmux, there are Window number, boot time, date, hostname and other information by default.

Install softwar

In general, you can install it directly using pip. For the convenience of multiple users, it is usually installed globally. It is important to note that the package is occupied because the package name in pypi.org is powerline-status.

Sudo pip install powerline-status

It seems that due to the loss of contact with the author, the version of powerline-status stays at 2.7, and the latest version is 2.8.1. If you need updates, you can use develop or master branches.

Sudo pip install git+ https://github.com/powerline/powerline.git@develop

Install Font

Powerline uses special fonts when displaying. The general font configuration cannot be displayed correctly. Therefore, you need to install its fonts.

Sudo apt install fonts-powerline

If you are on other systems and environments, you can refer to the instructions of powerline-fonts and install them manually.

Git clone https://github.com/powerline/fonts.git cd fonts. / install.sh

Configuration

Powerline supports a variety of usage scenarios. Among them, different configurations are needed in different scenarios.

The following describes the configuration of the five scenarios:

Vim Bash tmux IPython pdb

Vim

In Vim, Powerline is just its status bar plug-in. In ~ / .vimrc, you can add it as a plug-in.

Bundle 'powerline/powerline', {' rtp': 'powerline/bindings/vim'} "or Plug' powerline/powerline', {'rtp':' powerline/bindings/vim'}

You can also reuse the powerline-status installed by the system directly.

Python3

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report