Powerline

Powerline 是一个用于 vim 的 statusline 插件,它为其他几个应用程序(包括 zsh、bash、tmux、IPython、Awesome 和 Qtile)提供状态线和提示。「Powerline is a statusline plugin for vim, and provides statuslines and prompts for several other applications, including zsh, bash, tmux, IPython, Awesome and Qtile.」

Github星跟蹤圖

Powerline

作者: Kim Silkebækken (kim.silkebaekken+vim@gmail.com)
源代码:https://github.com/powerline/powerline
版本: beta

Powerline 是一个用于 vim 的 statusline 插件,它为其他几个应用程序(包括 zsh、bash、tmux、IPython、Awesome 和 Qtile)提供状态线和提示。

特性

用 Python 编写的可扩展且功能丰富。 Powerline 已完全用 Python 重写,以消除尽可能多的 Vimscript。这样可以提供更好的可扩展性,更精简和更好的配置文件,以及结构化的,面向对象的代码库,除了 Python 解释程序外,没有任何强制性的第三方依赖关系。

稳定且可测试的代码库。使用 Python 可以对所有项目代码进行单元测试。该代码经过测试可在 Python 2.6+ 和 Python 3 中运行。

在许多应用程序中均支持提示和状态行。该项目最初是专门为 vim 状态线创建的,现已演变为在 tmux 和多个 WM 中提供状态线,并提示输入诸如 bash / zsh 之类的 shell 以及其他应用程序。为 Powerline 不支持的任何其他应用程序编写渲染器很简单。

用 JSON 编写的配置和颜色方案。 JSON 是一种标准化、简单易用的文件格式,可以在 Powerline 所有受支持的应用程序中轻松进行用户配置。

快速、轻巧,具有守护程序支持,可提供更好的性能。尽管代码库跨越了几千行代码,并没有“少于X行代码”的目标,但主要重点是性能好,代码越少越好,同时仍提供了丰富的功能。新的守护程序还确保仅启动一个 Python 实例来显示提示和状态行,从而提供出色的性能。

但是我讨厌 Python/我不需要 shell 提示/这对我来说太麻烦了/原始的 vim-powerline 项目发生了什么...

您应该检查一些 Powerline 衍生产品。目前,最轻巧、功能最丰富的替代方案是 vim-airline 项目。

设置

基本 powerline 配置是通过位于 .config/powerline/ 的 JSON 文件完成的。最好从将位于 powerline_root/powerline/config_files/ 的默认配置复制到 .config/powerline/ 开始。如果您通过 AUR 或通过 pip 安装了 powerline,则 powerline_root 应该为 /usr/lib/python3.6/site-packages/ 或类似的名称,具体取决于您的 python 版本。

如果通过 apt-get 安装了 powerline,则“powerline_root”应为“/usr/share/powerline/”。

这将为您提供以下目录结构:

.config/powerline/
├── colorschemes
│   ├── ...
│   └── wm
|       └── default.json  // Your configuration goes here
├── colors.json
├── config.json
└── themes
    ├── ...
    └── wm
        └── default.json  // Your configuration goes here

主题子目录中的文件用于指定应显示哪些段; colorschemes 子目录中的文件用于指定应使用哪种颜色(在 colors.json 中定义)来显示段。

请注意,您的本地配置只会覆盖全局配置,而不会替代全局配置,即,如果您不在本地配置某些配置,则会使用全局默认设置。

  • 有关更多详细信息,请查阅 文档。有关可用的段及其配置,请参阅 segment reference
  • 查看 powerline-fonts ,以获取流行的开放源代码字体的预先修补版本。

屏幕截图

Vim 状态栏

取决于模式的突出显示

  • 正常模式
  • 插入方式
  • 视觉模式
  • 更换模式

在小窗口中自动截断段

  • Truncation illustration
  • Truncation illustration
  • Truncation illustration

屏幕截图中的字体是 Fabrizio Schiavi 的 Pragmata Pro

(The first version translated by vz on 2020.07.26)

主要指標

概覽
名稱與所有者powerline/powerline
主編程語言Python
編程語言C (語言數: 5)
平台Linux, Mac, Windows
許可證Other
所有者活动
創建於2012-06-12 12:48:40
推送於2024-09-30 00:48:39
最后一次提交2024-08-29 20:02:46
發布數24
最新版本名稱2.8.4 (發布於 )
第一版名稱1.0 (發布於 2014-09-05 22:56:24)
用户参与
星數14.5k
關注者數264
派生數1k
提交數2.9k
已啟用問題?
問題數1477
打開的問題數201
拉請求數454
打開的拉請求數35
關閉的拉請求數273
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?

Powerline

:Author: Kim Silkebækken (kim.silkebaekken+vim@gmail.com)
:Source: https://github.com/powerline/powerline
:Version: beta

Powerline is a statusline plugin for vim, and provides statuslines and
prompts for several other applications, including zsh, bash, fish, tmux,
IPython, Awesome, i3 and Qtile.

.. image:: https://api.travis-ci.org/powerline/powerline.svg?branch=develop
:target: travis-build-status_
:alt: Build status

.. _travis-build-status: https://travis-ci.org/powerline/powerline
.. _Support forum: https://groups.google.com/forum/#!forum/powerline-support
.. _Development discussion: https://groups.google.com/forum/#!forum/powerline-dev

Features

  • Extensible and feature rich, written in Python. Powerline was
    completely rewritten in Python to get rid of as much vimscript as
    possible. This has allowed much better extensibility, leaner and better
    config files, and a structured, object-oriented codebase with no mandatory
    third-party dependencies other than a Python interpreter.
  • Stable and testable code base. Using Python has allowed unit testing
    of all the project code. The code is tested to work in Python 2.6+ and
    Python 3.
  • Support for prompts and statuslines in many applications. Originally
    created exclusively for vim statuslines, the project has evolved to
    provide statuslines in tmux and several WMs, and prompts for shells like
    bash/zsh and other applications. It’s simple to write renderers for any
    other applications that Powerline doesn’t yet support.
  • Configuration and colorschemes written in JSON. JSON is
    a standardized, simple and easy to use file format that allows for easy
    user configuration across all of Powerline’s supported applications.
  • Fast and lightweight, with daemon support for even better performance.
    Although the code base spans a couple of thousand lines of code with no
    goal of “less than X lines of code”, the main focus is on good performance
    and as little code as possible while still providing a rich set of
    features. The new daemon also ensures that only one Python instance is
    launched for prompts and statuslines, which provides excellent
    performance.

But I hate Python / I don’t need shell prompts / this is just too much
hassle for me / what happened to the original vim-powerline project / …

You should check out some of the Powerline derivatives. The most lightweight
and feature-rich alternative is currently the vim-airline <https://github.com/vim-airline/vim-airline>_ project.

Configuration

Basic powerline configuration is done via JSON files located at .config/powerline/. It is a good idea to start by copying the default configuration located at powerline_root/powerline/config_files/ to .config/powerline/.
If you installed the powerline from the AUR or via pip, powerline_root should be /usr/lib/python3.6/site-packages/ or something similar, depending on your python version.

This should yield you the following directory structure:

::

    .config/powerline/
    ├── colorschemes
    │   ├── ...
    │   └── wm