powerline
Powerline is a statusline plugin for vim, and provides statuslines and prompts for several other applications, including zsh, bash, tmux, IPython, Awesome and Qtile.
Top Related Projects
A colorful, dark color scheme for Vim.
lean & mean status/tabline for vim that's light as air
A light and configurable statusline/tabline plugin for Vim
Adds file type icons to Vim plugins such as: NERDTree, vim-airline, CtrlP, unite, Denite, lightline, vim-startify and many more
A Zsh theme
🙃 A delightful community-driven (with 2,400+ contributors) framework for managing your zsh configuration. Includes 300+ optional plugins (rails, git, macOS, hub, docker, homebrew, node, php, python, etc), 140+ themes to spice up your morning, and an auto-update tool that makes it easy to keep up with the latest updates from the community.
Quick Overview
Powerline is a statusline plugin for vim, and provides statuslines and prompts for several other applications, including zsh, bash, tmux, IPython, Awesome, i3, and Qtile. It's designed to create beautiful and functional status lines and prompts, with a focus on aesthetics and information density.
Pros
- Highly customizable with a wide range of configuration options
- Supports multiple applications beyond just vim
- Provides a consistent look across different environments
- Offers informative status indicators for Git, virtual environments, and more
Cons
- Can be complex to set up and configure for beginners
- Requires special fonts for full functionality
- May impact performance on older systems or with complex configurations
- Documentation can be overwhelming due to the many options available
Code Examples
- Basic Powerline configuration for vim:
set rtp+=/path/to/powerline/powerline/bindings/vim
set laststatus=2
set t_Co=256
- Configuring Powerline for bash:
powerline-daemon -q
POWERLINE_BASH_CONTINUATION=1
POWERLINE_BASH_SELECT=1
. /path/to/powerline/powerline/bindings/bash/powerline.sh
- Adding a custom segment to Powerline:
from powerline.theme import requires_segment_info
@requires_segment_info
def my_custom_segment(pl, segment_info):
return [{
'contents': 'Custom',
'highlight_groups': ['custom_group'],
}]
Getting Started
-
Install Powerline:
pip install powerline-status
-
Install Powerline fonts:
git clone https://github.com/powerline/fonts.git cd fonts ./install.sh
-
Add to your
.vimrc
:set rtp+=/path/to/powerline/powerline/bindings/vim set laststatus=2
-
Add to your
.bashrc
or.zshrc
:powerline-daemon -q . /path/to/powerline/powerline/bindings/bash/powerline.sh
-
Restart your terminal or source your configuration file.
Competitor Comparisons
A colorful, dark color scheme for Vim.
Pros of jellybeans.vim
- Lightweight and focused solely on color scheme
- Easy to install and use with minimal configuration
- Compatible with a wide range of Vim plugins and file types
Cons of jellybeans.vim
- Limited to Vim editor, while Powerline supports multiple applications
- Lacks advanced statusline customization features
- No built-in support for displaying system information or Git status
Code Comparison
jellybeans.vim (color definition):
let s:gui_base03 = "151515"
let s:gui_base02 = "30302c"
let s:gui_base01 = "4e4e43"
let s:gui_base00 = "666656"
let s:gui_base0 = "808070"
Powerline (configuration):
{
"segments": {
"left": [
{
"function": "powerline.segments.common.net.hostname",
"priority": 10
},
{
"function": "powerline.segments.common.env.user",
"priority": 30
},
{
"function": "powerline.segments.common.env.virtualenv",
"priority": 50
}
]
}
}
While jellybeans.vim focuses on providing a color scheme for Vim, Powerline offers a more comprehensive statusline solution with extensive customization options for multiple applications. jellybeans.vim is simpler to set up and use, but lacks the advanced features and cross-application support that Powerline provides.
lean & mean status/tabline for vim that's light as air
Pros of vim-airline
- Lightweight and faster performance, especially on older systems
- Easier to configure and customize without external dependencies
- Written entirely in Vimscript, making it more portable across different environments
Cons of vim-airline
- Less feature-rich compared to Powerline's extensive functionality
- Limited support for non-Vim applications (Powerline works with shells, tmux, etc.)
- May require manual installation of patched fonts for full glyph support
Code Comparison
Powerline (Python):
def get_segment_info(segment_info, mode):
r = segment_info.copy()
if mode == 'nc':
r['buffer'].number = None
return r
vim-airline (Vimscript):
function! airline#init#sections()
let spc = g:airline_symbols.space
if !exists('g:airline_section_a')
let g:airline_section_a = airline#section#create_left(['mode', 'crypt', 'paste', 'spell', 'iminsert'])
endif
" ... (more section definitions)
endfunction
Both projects aim to enhance the status line in Vim, but they differ in implementation and scope. Powerline is a more comprehensive solution written in Python, while vim-airline is a lightweight, Vim-specific alternative written in Vimscript. The choice between them depends on user preferences, system requirements, and desired features.
A light and configurable statusline/tabline plugin for Vim
Pros of lightline.vim
- Lightweight and fast, with minimal dependencies
- Highly customizable without the need for patched fonts
- Written entirely in Vim script, making it easier to modify and debug
Cons of lightline.vim
- Less feature-rich out of the box compared to Powerline
- Requires more manual configuration to achieve advanced functionality
- Limited built-in themes and components
Code Comparison
Powerline configuration (Python):
from powerline import Powerline
powerline = Powerline()
powerline.add_segment('hostname', 'hostname')
powerline.add_segment('cwd', 'cwd')
lightline.vim configuration (Vim script):
let g:lightline = {
\ 'component': {
\ 'filename': '%F',
\ 'modified': '%M',
\ },
\ }
Summary
Lightline.vim is a lightweight alternative to Powerline, offering faster performance and easier customization at the cost of fewer built-in features. It's ideal for users who prefer a minimalist approach and are comfortable with Vim script. Powerline, on the other hand, provides a more comprehensive set of features out of the box but may be slower and require more setup. The choice between the two depends on the user's specific needs and preferences.
Adds file type icons to Vim plugins such as: NERDTree, vim-airline, CtrlP, unite, Denite, lightline, vim-startify and many more
Pros of vim-devicons
- Focuses specifically on adding icons to Vim/Neovim, making it more lightweight and specialized
- Supports a wider range of file types and plugins for icon integration
- Easier to install and configure, with fewer dependencies
Cons of vim-devicons
- Limited to Vim/Neovim environments, unlike Powerline's broader application support
- Doesn't provide status line customization features like Powerline
- May require additional plugins or configuration for full functionality
Code Comparison
vim-devicons:
let g:webdevicons_enable = 1
let g:webdevicons_enable_nerdtree = 1
let g:webdevicons_enable_airline_tabline = 1
Powerline:
from powerline import Powerline
powerline = Powerline()
powerline.setup(segment_info=segment_info)
Summary
vim-devicons is a specialized plugin for adding icons to Vim/Neovim, offering easier setup and broader file type support. Powerline, on the other hand, provides a more comprehensive status line customization solution across multiple applications. The choice between them depends on whether you need a focused icon solution for Vim or a versatile status line tool for various environments.
A Zsh theme
Pros of Powerlevel10k
- Significantly faster performance and load times
- More customizable with easy configuration wizard
- Better out-of-the-box experience with instant prompt feature
Cons of Powerlevel10k
- Limited to Zsh shell, while Powerline supports multiple shells
- Steeper learning curve for advanced customizations
- Requires a Nerd Font for full functionality
Code Comparison
Powerline configuration (Python):
{
"segments": {
"left": [
{"function": "powerline.segments.common.net.hostname"},
{"function": "powerline.segments.common.env.user"},
{"function": "powerline.segments.common.env.virtualenv"}
]
}
}
Powerlevel10k configuration (Zsh):
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
os_icon
dir
vcs
)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(
status
command_execution_time
background_jobs
)
Both projects aim to enhance command-line prompts, but Powerlevel10k focuses on speed and ease of use for Zsh users, while Powerline offers broader shell support with a more complex setup process. Powerlevel10k's configuration is more intuitive for many users, but Powerline's Python-based approach may be preferred by some developers.
🙃 A delightful community-driven (with 2,400+ contributors) framework for managing your zsh configuration. Includes 300+ optional plugins (rails, git, macOS, hub, docker, homebrew, node, php, python, etc), 140+ themes to spice up your morning, and an auto-update tool that makes it easy to keep up with the latest updates from the community.
Pros of Oh My Zsh
- Easier to install and configure for beginners
- Larger community and more extensive plugin ecosystem
- More focused on enhancing the shell experience with themes and aliases
Cons of Oh My Zsh
- Can be slower to load, especially with many plugins enabled
- May introduce conflicts with existing Zsh configurations
- Less customizable for advanced users compared to Powerline's flexibility
Code Comparison
Oh My Zsh (theme configuration):
ZSH_THEME="robbyrussell"
plugins=(git docker kubectl)
source $ZSH/oh-my-zsh.sh
Powerline (Python configuration):
from powerline import Powerline
powerline = Powerline()
powerline.add_segment('hostname', 'host')
powerline.add_segment('cwd', 'cwd')
print(powerline.render())
Oh My Zsh is a framework for managing Zsh configurations, focusing on providing a rich set of plugins and themes for enhancing the shell experience. Powerline, on the other hand, is a statusline plugin that can be used with various applications, including shells, editors, and window managers.
Oh My Zsh is more user-friendly for beginners and offers a wide range of pre-configured options, while Powerline provides greater flexibility and can be integrated into multiple applications beyond just the shell.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Powerline
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.
+---------+---------------------------------------------------+ | Author | Kim Silkebækken (kim.silkebaekken+vim@gmail.com) | +---------+---------------------------------------------------+ | Source | https://github.com/powerline/powerline | +---------+---------------------------------------------------+ | Version | beta | +---------+---------------------------------------------------+
Powerline does not support python2 anymore and powerline will stop working with python2 in the near future.
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 3.6+.
- 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.
If you installed powerline via apt-get 'powerline_root' should be '/usr/share/powerline/'.
This should yield you the following directory structure:
::
.config/powerline/
âââ colorschemes
â  âââ ...
â  âââ wm
|Â Â Â Â âââ default.json // Your configuration goes here
âââ colors.json
âââ config.json
âââ themes
âââ ...
âââ wm
âââ default.json // Your configuration goes here
The files in the subdirectories of themes
are used to specify which segments shall be shown; the files in subdirectories of colorschemes
are used to specify which colors (as defined in colors.json
) shall be used to display a segment.
Note that your local configuration only overrides the global configuration, it does not replace it, i.e. if you don't configure something locally, the global default will be used instead.
- Consult the
documentation <https://powerline.readthedocs.org/en/latest/configuration.html#quick-setup-guide>
_ for more details. See also thesegment reference <https://powerline.readthedocs.org/en/latest/configuration/segments.html>
_ for available segments and their configuration. - Check out
powerline-fonts <https://github.com/powerline/fonts>
_ for pre-patched versions of popular, open source coding fonts.
Screenshots
Vim statusline ^^^^^^^^^^^^^^
Mode-dependent highlighting
- .. image:: https://raw.github.com/powerline/powerline/develop/docs/source/_static/img/pl-mode-normal.png :alt: Normal mode
- .. image:: https://raw.github.com/powerline/powerline/develop/docs/source/_static/img/pl-mode-insert.png :alt: Insert mode
- .. image:: https://raw.github.com/powerline/powerline/develop/docs/source/_static/img/pl-mode-visual.png :alt: Visual mode
- .. image:: https://raw.github.com/powerline/powerline/develop/docs/source/_static/img/pl-mode-replace.png :alt: Replace mode
Automatic truncation of segments in small windows
- .. image:: https://raw.github.com/powerline/powerline/develop/docs/source/_static/img/pl-truncate1.png :alt: Truncation illustration
- .. image:: https://raw.github.com/powerline/powerline/develop/docs/source/_static/img/pl-truncate2.png :alt: Truncation illustration
- .. image:: https://raw.github.com/powerline/powerline/develop/docs/source/_static/img/pl-truncate3.png :alt: Truncation illustration
The font in the screenshots is Pragmata Pro
_ by Fabrizio Schiavi.
.. _Pragmata Pro
: http://www.fsd.it/shop/fonts/pragmatapro
Top Related Projects
A colorful, dark color scheme for Vim.
lean & mean status/tabline for vim that's light as air
A light and configurable statusline/tabline plugin for Vim
Adds file type icons to Vim plugins such as: NERDTree, vim-airline, CtrlP, unite, Denite, lightline, vim-startify and many more
A Zsh theme
🙃 A delightful community-driven (with 2,400+ contributors) framework for managing your zsh configuration. Includes 300+ optional plugins (rails, git, macOS, hub, docker, homebrew, node, php, python, etc), 140+ themes to spice up your morning, and an auto-update tool that makes it easy to keep up with the latest updates from the community.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot