Remove you from most of the documentation

This commit is contained in:
ZyX 2015-01-08 18:24:09 +03:00
parent b00d7ee356
commit 7dbbc1003b
14 changed files with 268 additions and 255 deletions

View File

@ -2,9 +2,10 @@
Configuration and customization
*******************************
.. note:: **You DO NOT have to fork the main GitHub repo to personalize your
Powerline configuration!** Please read through the :ref:`quick-guide` for
a quick introduction to user configuration.
.. note::
**Forking the main GitHub repo is not needed to personalize Powerline
configuration!** Please read through the :ref:`quick-guide` for a quick
introduction to user configuration.
Powerline is configured with one main configuration file, and with separate
configuration files for themes and colorschemes. All configuration files are
@ -29,26 +30,27 @@ configuration files are stored in :file:`$XDG_CONFIG_HOME/powerline` for
Linux users, and in :file:`~/.config/powerline` for OS X users. This usually
corresponds to :file:`~/.config/powerline` on both platforms.
If you need per-instance configuration please refer to :ref:`Local configuration
overrides <local-configuration-overrides>`.
If per-instance configuration is needed please refer to :ref:`Local
configuration overrides <local-configuration-overrides>`.
.. note:: If you have multiple configuration files with the same name in
different directories then these files will be merged. Merging happens in
the following order:
.. note::
Existing multiple configuration files that have the same name, but are placed
in different directories, will be merged. Merging happens in the following
order:
* :file:`{powerline_root}/powerline/config_files` is checked for
configuration first. Configuration from this source has least priority.
* :file:`$XDG_CONFIG_DIRS/powerline` directories are the next ones to check.
Checking happens in the reversed order: directories mentioned last are
checked before directories mentioned first. Each new found file is merged
with the result of previous merge.
* :file:`$XDG_CONFIG_HOME/powerline` directory is the last to check.
Configuration from there has top priority.
* :file:`{powerline_root}/powerline/config_files` is checked for
configuration first. Configuration from this source has least priority.
* :file:`$XDG_CONFIG_DIRS/powerline` directories are the next ones to check.
Checking happens in the reversed order: directories mentioned last are
checked before directories mentioned first. Each new found file is merged
with the result of previous merge.
* :file:`$XDG_CONFIG_HOME/powerline` directory is the last to check.
Configuration from there has top priority.
When merging configuration only dictionaries are merged and they are merged
recursively: keys from next file overrule those from the previous unless
corresponding values are both dictionaries in which case these dictionaries
are merged and key is assigned the result of the merge.
When merging configuration only dictionaries are merged and they are merged
recursively: keys from next file overrule those from the previous unless
corresponding values are both dictionaries in which case these dictionaries
are merged and key is assigned the result of the merge.
.. note:: Some configuration files (i.e. themes and colorschemes) have two level
of merging: first happens merging described above, second theme- or

View File

@ -18,8 +18,8 @@ Vim configuration can be overridden using the following options:
``g:powerline_theme_overrides``
Dictionary mapping theme names to theme overrides, recursively merged with
contents of :file:`powerline/themes/vim/{key}.json`. Note that this way you
cant redefine some value (e.g. segment) in list, only the whole list
contents of :file:`powerline/themes/vim/{key}.json`. Note that this way some
value (e.g. segment) in a list cannot be redefined, only the whole list
itself: only dictionaries are merged recursively.
``g:powerline_config_paths``
@ -179,16 +179,17 @@ this variant is used.
Sets directories where configuration should be read from. If present, no
default locations are searched for configuration. No expansions are
performed by powerline script itself, but zsh usually performs them on its
own if you set variable without quotes: ``POWERLINE_CONFIG_PATHS=( ~/example
)``. You should use array parameter or the usual colon-separated
``POWERLINE_CONFIG_PATHS=$HOME/path1:$HOME/path2``.
own if variable without is set without quotes: ``POWERLINE_CONFIG_PATHS=(
~/example )``. In addition to arrays usual colon-separated “array” string
can be used: ``POWERLINE_CONFIG_PATHS=$HOME/path1:$HOME/path2``.
Ipython overrides
=================
Ipython overrides depend on ipython version. Before ipython-0.11 you should pass
additional keyword arguments to setup() function. After ipython-0.11 you should
use ``c.Powerline.KEY``. Supported ``KEY`` strings or keyword argument names:
Ipython overrides depend on ipython version. Before ipython-0.11 additional
keyword arguments should be passed to setup() function. After ipython-0.11
``c.Powerline.KEY`` should be used. Supported ``KEY`` strings or keyword
argument names:
``config_overrides``
Overrides options from :file:`powerline/config.json`. Should be a dictionary
@ -202,41 +203,39 @@ use ``c.Powerline.KEY``. Supported ``KEY`` strings or keyword argument names:
``config_paths``
Sets directories where configuration should be read from. If present, no
default locations are searched for configuration. No expansions are
performed thus you cannot use paths starting with ``~/``.
performed thus paths starting with ``~/`` cannot be used: use
:py:func:`os.path.expanduser`.
Prompt command
==============
In addition to the above configuration options you can use
``$POWERLINE_COMMAND`` environment variable to tell shell or tmux to use
specific powerline implementation and ``$POWERLINE_CONFIG_COMMAND`` to tell zsh
or tmux where ``powerline-config`` script is located. This is mostly useful for
putting powerline into different directory.
In addition to the above configuration options ``$POWERLINE_COMMAND``
environment variable can be used to tell shell or tmux to use specific powerline
implementation and ``$POWERLINE_CONFIG_COMMAND`` to tell zsh or tmux where
``powerline-config`` script is located. This is mostly useful for putting
powerline into different directory.
.. note::
``$POWERLINE_COMMAND`` is always treated as one path in shell bindings, so
you may use paths with spaces in it. To specify additional arguments one may
path with spaces in it may be used. To specify additional arguments one may
use ``$POWERLINE_COMMAND_ARGS``, but note that this variable exists for
testing purposes only and may be removed. One should use :ref:`Environment
variable overrides <local-configuration-overrides-env>` instead.
If you want to disable prompt in shell, but still have tmux support or if you
want to disable tmux support you can use variables
``$POWERLINE_NO_{SHELL}_PROMPT``/``$POWERLINE_NO_SHELL_PROMPT`` and
``$POWERLINE_NO_{SHELL}_TMUX_SUPPORT``/``$POWERLINE_NO_SHELL_TMUX_SUPPORT``
(substitute ``{SHELL}`` with the name of the shell (all-caps) you want to
disable support for (e.g. ``BASH``) or use all-inclusive ``SHELL`` that will
disable support for all shells). These variables have no effect after
configuration script was sourced (in fish case: after ``powerline-setup``
function was run). To disable specific feature support set one of these
variables to some non-empty value.
To disable prompt in shell, but still have tmux support or to disable tmux
support environment variables ``$POWERLINE_NO_{SHELL}_PROMPT`` and
``$POWERLINE_NO_{SHELL}_TMUX_SUPPORT`` can be used (substitute ``{SHELL}`` with
the name of the shell (all-caps) that should be affected (e.g. ``BASH``) or use
all-inclusive ``SHELL`` that will disable support for all shells). These
variables have no effect after configuration script was sourced (in fish case:
after ``powerline-setup`` function was run). To disable specific feature support
set one of these variables to some non-empty value.
If you do not want to disable prompt in shell, but yet do not want to launch
python twice to get :ref:`above <config-themes-above>` lines you do not use in
tcsh you should set ``$POWERLINE_NO_TCSH_ABOVE`` or
``$POWERLINE_NO_SHELL_ABOVE`` variable.
In order to keep shell prompt, but avoid launching Python twice to get unused
:ref:`above <config-themes-above>` lines in tcsh ``$POWERLINE_NO_TCSH_ABOVE`` or
``$POWERLINE_NO_SHELL_ABOVE`` variable should be set.
If you do not want to see additional space which is added to the right prompt in
fish in order to support multiline prompt you should set
``$POWERLINE_NO_FISH_ABOVE`` or ``$POWERLINE_NO_SHELL_ABOVE`` variables.
In order to remove additional space from the end of the right prompt in fish
that was added in order to support multiline prompt ``$POWERLINE_NO_FISH_ABOVE``
or ``$POWERLINE_NO_SHELL_ABOVE`` variable should be set.

View File

@ -24,7 +24,7 @@ Common configuration is a subdictionary that is a value of ``common`` key in
``term_truecolor``
Defines whether to output cterm indices (8-bit) or RGB colors (24-bit)
to the terminal emulator. See the :ref:`term-feature-support-matrix` for
information on whether your terminal emulator supports 24-bit colors.
information on whether used terminal emulator supports 24-bit colors.
This variable is forced to be ``false`` if :ref:`term_escape_style
<config-common-term_escape_style>` option is set to ``"fbterm"`` or if it is
@ -55,7 +55,7 @@ Common configuration is a subdictionary that is a value of ``common`` key in
Tells powerline what to do with characters with East Asian Width Class
Ambigious (such as Euro, Registered Sign, Copyright Sign, Greek
letters, Cyrillic letters). Valid values: any positive integer; it is
suggested that you only set it to 1 (default) or 2.
suggested that this option is only set it to 1 (default) or 2.
.. _config-common-watcher:
@ -77,12 +77,11 @@ Common configuration is a subdictionary that is a value of ``common`` key in
``additional_escapes``
Valid for shell extensions, makes sense only if :ref:`term_truecolor
<config-common-term_truecolor>` is enabled. Is to be set from command-line
(unless you are sure you always need it). Controls additional escaping that
is needed for tmux/screen to work with terminal true color escape codes:
normally tmux/screen prevent terminal emulator from receiving these control
codes thus rendering powerline prompt colorless. Valid values: ``"tmux"``,
``"screen"``, ``null`` (default).
<config-common-term_truecolor>` is enabled. Is to be set from command-line.
Controls additional escaping that is needed for tmux/screen to work with
terminal true color escape codes: normally tmux/screen prevent terminal
emulator from receiving these control codes thus rendering powerline prompt
colorless. Valid values: ``"tmux"``, ``"screen"``, ``null`` (default).
.. _config-common-paths:
@ -212,8 +211,8 @@ Color definitions
* A list of cterm color indicies.
* A list of hex color strings.
It is expected that you define gradients from least alert color to most
alert or use non-alert colors.
It is expected that gradients are defined from least alert color to most
alert or non-alert colors are used.
.. _config-colorschemes:
@ -253,8 +252,8 @@ override those from each previous file. It is required that either
``attrs``
List of attributes. Valid values are one or more of ``bold``,
``italic`` and ``underline``. Note that some attributes may be
unavailable in some applications or terminal emulators. If you do not
need any attributes leave this empty.
unavailable in some applications or terminal emulators. If no
attributes are needed this list should be left empty.
#) a string (an alias): a name of existing group. This groups definition
will be used when this color is requested.
@ -333,9 +332,7 @@ ascii Theme without any unicode characters at all
``dividers``
Defines the dividers used in all Powerline extensions. This option
should usually only be changed if you dont have a patched font, or if
you use a font patched with the legacy font patcher.
Defines the dividers used in all Powerline extensions.
The ``hard`` dividers are used to divide segments with different
background colors, while the ``soft`` dividers are used to divide

View File

@ -24,8 +24,8 @@ segments in some set of applications. Specifically this means
computing text width.
This subclass must be placed directly in :file:`powerline/renderers`
directory (if you are creating powerline extension for a set of applications
use :file:`powerline/renderers/{ext}/*.py`) and named like ``ExtRenderer`` or
directory (for powerline extensions developed for a set of applications use
:file:`powerline/renderers/{ext}/*.py`) and named like ``ExtRenderer`` or
``AppPromptRenderer``. For technical reasons the class itself must be
referenced in ``renderer`` module attribute thus allowing only one renderer
per one module.

View File

@ -4,7 +4,7 @@
Writing listers
***************
Listers allow you to show some segments multiple times: once per each entity
Listers provide a way to show some segments multiple times: once per each entity
(buffer, tabpage, etc) lister knows. They are functions which receive the
following arguments:

View File

@ -32,7 +32,7 @@ arguments: matcher name (same as in :ref:`local_themes
<config-ext-local_themes>`) and dictionary with theme. This dictionary is merged
with :ref:`top theme <config-ext-top_theme>` and
:file:`powerline/themes/vim/__main__.json`. Note that if user already specified
your matcher in his configuration file ``KeyError`` is raised.
the matcher in his configuration file ``KeyError`` is raised.
Other local themes
==================

View File

@ -12,7 +12,7 @@ object it should receive the following arguments:
``pl``
A :py:class:`powerline.PowerlineLogger` instance. It must be used every time
you need to log something.
something needs to be logged.
``segment_info``
A dictionary. It is only received if callable has
@ -32,20 +32,21 @@ And also any other argument(s) specified by user in :ref:`args key
.. note::
For powerline-lint to work properly the following things may be needed:
#. If your segment is a :py:class:`powerline.segments.Segment` and used
#. If segment is a :py:class:`powerline.segments.Segment` instance and used
arguments are scattered over multiple methods
:py:meth:`powerline.segments.Segment.argspecobjs` should be overridden in
subclass to tell powerline-lint which objects should be inspected for
arguments.
#. If your segment takes some arguments that are never listed, but accessed
via ``kwargs.get()`` or you cannot use previous function for whatever
reason :py:meth:`powerline.segments.Segment.additional_args` should be
#. If segment takes some arguments that are never listed, but accessed via
``kwargs.get()`` or previous function cannot be used for whatever reason
:py:meth:`powerline.segments.Segment.additional_args` should be
overridden in subclass.
#. If you are expecting user to use one :ref:`name <config-themes-seg-name>`
for multiple segments which cannot be linked to the segment function
#. If user is expected to use one :ref:`name <config-themes-seg-name>` for
multiple segments which cannot be linked to the segment function
automatically by powerline-lint (e.g. because there are no instances of
the segments in question in the default configuration) you should use
:py:func:`powerline.lint.checks.register_common_name`.
the segments in question in the default configuration)
:py:func:`powerline.lint.checks.register_common_name` function should be
used.
Object representing segment may have the following attributes used by
powerline:
@ -110,7 +111,7 @@ powerline:
.. warning::
“Amount of display cells” is *not* number of Unicode codepoints, string
length, or byte count. It is suggested that your function should look
length, or byte count. It is suggested that this function should look
something like ``return (' ' * amount) + segment['contents']`` where
``' '`` may be replaced with anything that is known to occupy exactly
one display cell.
@ -172,22 +173,23 @@ Detailed description of used dictionary keys:
Defaults to the name of the segment.
.. note::
If you want to include your segment in powerline you must specify all
highlighting groups used in the segment documentation in the form::
If target is inclusion of the segment in powerline upstream all used
highlighting groups must be specified in the segment documentation in the
form::
Highlight groups used: ``g1``[ or ``g2``]*[, ``g3`` (gradient)[ or ``g4``]*]*.
Highlight groups used: ``g1``[ or ``g2``]*[, ``g3`` (gradient)[ or ``g4``]*]*.
I.e. use::
I.e. use::
Highlight groups used: ``foo_gradient`` (gradient) or ``foo``, ``bar``.
Highlight groups used: ``foo_gradient`` (gradient) or ``foo``, ``bar``.
to specify that your segment uses *either* ``foo_gradient`` group or
``foo`` group *and* ``bar`` group meaning that ``powerline-lint`` will
check that at least one of the first two groups is defined (and if
``foo_gradient`` is defined it must use at least one gradient color) and
third group is defined as well.
to specify that the segment uses *either* ``foo_gradient`` group or
``foo`` group *and* ``bar`` group meaning that ``powerline-lint`` will
check that at least one of the first two groups is defined (and if
``foo_gradient`` is defined it must use at least one gradient color) and
third group is defined as well.
You must specify all groups on one line.
All groups must be specified on one line.
``divider_highlight_group``
Determines segment divider highlight group. Only applicable for soft
@ -195,13 +197,14 @@ Detailed description of used dictionary keys:
segments.
.. note::
If you want to include your segment in powerline you must specify used
groups in the segment documentation in the form::
If target is inclusion of the segment in powerline upstream used divider
highlight group must be specified in the segment documentation in the
form::
Divider highlight group used: ``group``.
This text must not wrap and you are supposed to end all divider
highlight group names with ``:divider``: e.g. ``cwd:divider``.
This text must not wrap and all divider highlight group names are
supposed to end with ``:divider``: e.g. ``cwd:divider``.
``gradient_level``
First and the only key that may not be specified in user configuration. It
@ -330,16 +333,19 @@ keys:
have ``__getitem__`` and ``get`` methods and nothing more.
.. warning::
You must not ever use ``os.environ``. If your segment is run in daemon
you will get daemons environment which is not correct. If your segment
is run in Vim or in zsh with libzpython you will get Vim or zsh
environment at python startup.
``os.environ`` must not ever be used:
* If segment is run in the daemon this way it will get daemons
environment which is not correct.
* If segment is run in Vim or in zsh with libzpython ``os.environ`` will
contain Vim or zsh environ *at the moment Python interpreter was
loaded*.
``getcwd``
Function that returns current working directory being called with no
arguments. You must not use ``os.getcwd`` for the same reasons you must not
use ``os.environ``, except that current working directory is valid in Vim
and zsh (but not in daemon).
arguments. ``os.getcwd`` must not be used for the same reasons the use of
``os.environ`` is forbidden, except that current working directory is valid
in Vim and zsh (but not in daemon).
``home``
Current home directory. May be false.
@ -352,36 +358,36 @@ Vim
Vim ``segment_info`` argument is a dictionary with the following keys:
``window``
``vim.Window`` object. You may obtain one using ``vim.current.window`` or
``vim.windows[number - 1]``. May be a false object, in which case you should
not use any of this objects properties.
``vim.Window`` object. ``vim.current.window`` or ``vim.windows[number - 1]``
may be used to obtain such object. May be a false object, in which case any
of this objects properties must not be used.
``winnr``
Window number. Same as ``segment_info['window'].number`` *assuming* Vim is
new enough for ``vim.Window`` object to have ``number`` attribute.
``window_id``
Internal powerline window id, unique for each newly created window. You
should assume that this ID is hashable and supports equality comparison, but
you must not use any other assumptions about it. Currently uses integer
Internal powerline window id, unique for each newly created window. It is
safe to assume that this ID is hashable and supports equality comparison,
but no other assumptions about it should be used. Currently uses integer
numbers incremented each time window is created.
``buffer``
``vim.Buffer`` object. You may obtain one using ``vim.current.buffer``,
``vim.Buffer`` object. One may be obtained using ``vim.current.buffer``,
``segment_info['window'].buffer`` or ``vim.buffers[some_number]``. Note that
in the latter case depending on vim version ``some_number`` may be ``bufnr``
or the internal Vim buffer index which is *not* buffer number. For this
reason to get ``vim.Buffer`` object other then stored in ``segment_info``
dictionary you must iterate over ``vim.buffers`` and check their ``number``
attributes.
dictionary iteration over ``vim.buffers`` and checking their ``number``
attributes should be performed.
``bufnr``
Buffer number.
``tabpage``
``vim.Tabpage`` object. You may obtain one using ``vim.current.tabpage`` or
``vim.tabpages[number - 1]``. May be a false object, in which case you
should not use any of this objects properties.
``vim.Tabpage`` object. One may be obtained using ``vim.current.tabpage`` or
``vim.tabpages[number - 1]``. May be a false object, in which case no
objects properties can be used.
``tabnr``
Tabpage number.
@ -394,18 +400,18 @@ Vim ``segment_info`` argument is a dictionary with the following keys:
should be used to convert return values.
.. note::
Your segment generally should not assume that it is run for the current
window, current buffer or current tabpage. “Current window” and “current
buffer” restrictions may be ignored if you use ``window_cached`` decorator,
“current tabpage” restriction may be safely ignored if you do not plan to
ever see your segment in the tabline.
Segment generally should not assume that it is run for the current window,
current buffer or current tabpage. “Current window” and “current buffer”
restrictions may be ignored if ``window_cached`` decorator is used, “current
tabpage” restriction may be safely ignored if segment is not supposed to be
used in tabline.
.. warning::
Powerline is being tested with vim-7.2 and will be tested with it until
travis changes used vim version. This means that you may not use most of the
functionality like ``vim.Window.number``, ``vim.*.vars``, ``vim.*.options``
or even ``dir(vim object)`` if you want your segment to be included in
powerline.
Powerline is being tested with vim-7.0.112 (some minor sanity check) and
latest Vim. This means that most of the functionality like
``vim.Window.number``, ``vim.*.vars``, ``vim.*.options`` or even ``dir(vim
object)`` should be avoided in segments that want to be included in the
upstream.
Shell
-----
@ -431,7 +437,7 @@ Shell
``renderer_arg``
Dictionary containing some keys that are additional arguments used by
shell bindings. *You must not use this attribute directly*: all
shell bindings. *This attribute must not be used directly*: all
arguments from this dictionary are merged with ``segment_info``
dictionary. Known to have at least the following keys:

View File

@ -47,8 +47,8 @@ PyPI under the ``powerline-status`` name:
pip install powerline-status
is the preferred method because this will get you the latest release. To get
current development version
is the preferred method because this will get the latest release. To get current
development version
.. code-block:: sh
@ -71,7 +71,7 @@ will have to be done (:file:`~/.local/bin` should be replaced with some path
present in ``$PATH``).
.. note::
If your ISP blocks git protocol for some reason github also provides ``ssh``
If ISP blocks git protocol for some reason github also provides ``ssh``
(``git+ssh://git@github.com/powerline/powerline``) and ``https``
(``git+https://github.com/powerline/powerline``) protocols. ``git`` protocol
should be the fastest, but least secure one though.
@ -80,12 +80,15 @@ Fonts installation
==================
Powerline uses several special glyphs to get the arrow effect and some custom
symbols for developers. This requires that you either have a symbol font or
a patched font on your system. Your terminal emulator must also support either
patched fonts or fontconfig for Powerline to work properly.
symbols for developers. This requires having either a symbol font or a patched
font installed in the system. Used application (e.g. terminal emulator) must
also either be configured to use patched fonts (in some cases even support it
because custom glyphs live in private use area which some applications reserve
for themselves) or support fontconfig for powerline to work properly with
powerline-specific glyphs.
You can also enable :ref:`24-bit color support <config-common-term_truecolor>`
if your terminal emulator supports it (see :ref:`the terminal emulator support
:ref:`24-bit color support <config-common-term_truecolor>` may be enabled if
used terminal emulator supports it (see :ref:`the terminal emulator support
matrix <usage-terminal-emulators>`).
There are basically two ways to get powerline glyphs displayed: use
@ -100,9 +103,8 @@ Patched fonts
This method is the fallback method and works for every terminal, with the
exception of :ref:`rxvt-unicode <tips-and-tricks-urxvt>`.
Download the font of your choice from `powerline-fonts`_. If you cant find
your preferred font in the `powerline-fonts`_ repo, youll have to patch your
own font instead.
Download the font from `powerline-fonts`_. If preferred font cant be found in
the `powerline-fonts`_ repo, then patching the preferred font is needed instead.
.. _powerline-fonts: https://github.com/powerline/fonts

View File

@ -4,7 +4,7 @@ Installation on Linux
The following distribution-specific packages are officially supported, and they
provide an easy way of installing and upgrading Powerline. The packages will
automatically do most of the configuration for you.
automatically do most of the configuration.
* `Arch Linux (AUR), Python 2 version <https://aur.archlinux.org/packages/python2-powerline-git/>`_
* `Arch Linux (AUR), Python 3 version <https://aur.archlinux.org/packages/python-powerline-git/>`_
@ -14,11 +14,11 @@ automatically do most of the configuration for you.
<https://packages.debian.org/search?keywords=powerline&searchon=names&suite=all&section=all>`_
to get more information.
If youre running a distribution without an official package youll have to
follow the installation guide below:
If used distribution does not have an official package installation guide below
should be followed:
1. Install Python 3.2+ or Python 2.6+ with ``pip``. This step is
distribution-specific, so no commands provided.
1. Install Python 3.2+, Python 2.6+ or PyPy and ``pip`` with ``setuptools``.
This step is distribution-specific, so no commands provided.
2. Install Powerline using one of the following commands:
.. code-block:: sh
@ -36,10 +36,11 @@ follow the installation guide below:
.. note:: Due to the naming conflict with an unrelated project powerline is
named ``powerline-status`` in PyPI.
.. note:: If you are powerline developer you should be aware that ``pip install
--editable`` does not currently fully work. If you
install powerline this way you will be missing ``powerline`` executable and
need to symlink it. It will be located in ``scripts/powerline``.
.. note::
Powerline developers should be aware that``pip install --editable`` does
not currently fully work. Installation performed this way are missing
``powerline`` executable that needs to be symlinked. It will be located in
``scripts/powerline``.
Fonts installation
==================
@ -47,9 +48,9 @@ Fonts installation
Fontconfig
----------
This method only works on Linux. Its the recommended method if your
terminal emulator supports it as you dont have to patch any fonts, and it
generally works well with any coding font.
This method only works on Linux. Its the second recommended method if terminal
emulator supports it as patching fonts is not needed, and it generally works
with any coding font.
#. Download the latest version of the symbol font and fontconfig file::
@ -61,8 +62,8 @@ generally works well with any coding font.
mv PowerlineSymbols.otf ~/.fonts/
#. Update font cache for the path you moved the font to (you may need to be
root to update the cache for system-wide paths)::
#. Update font cache for the path the font was moved to (root priveleges may be
needed to update cache for the system-wide paths)::
fc-cache -vf ~/.fonts/
@ -72,37 +73,38 @@ generally works well with any coding font.
mv 10-powerline-symbols.conf ~/.config/fontconfig/conf.d/
If you cant see the custom symbols, please close all instances of your
terminal emulator. You may need to restart X for the changes to take
effect.
If custom symbols still cannot be seen then try closing all instances of the
terminal emulator. Restarting X may be needed for the changes to take effect.
If you *still* cant see the custom symbols, double-check that you have
installed the font to a valid X font path, and that you have installed the
fontconfig file to a valid fontconfig path. Alternatively try to install
a :ref:`patched font <installation-patched-fonts>`.
If custom symbols *still* cant be seen, double-check that the font have been
installed to a valid X font path, and that the fontconfig file was installed to
a valid fontconfig path. Alternatively try to install a :ref:`patched font
<installation-patched-fonts>`.
Patched font installation
-------------------------
After downloading font you should do the following:
This is the preferred method, but it is not always available because not all
fonts were patched and not all fonts *can* be patched due to licensing issues.
After downloading font the following should be done:
#. Move the patched font to a valid X font path. Valid font paths can be
listed with ``xset q``::
mv 'MyFont for Powerline.otf' ~/.fonts/
mv 'SomeFont for Powerline.otf' ~/.fonts/
#. Update font cache for the path you moved the font to (you may need to be
root to update the cache for system-wide paths)::
#. Update font cache for the path the font was moved to (root priveleges may be
needed for updating font cache for some paths)::
fc-cache -vf ~/.fonts/
After installing the patched font you need to update Gvim or your terminal
emulator to use the patched font. The correct font usually ends with *for
Powerline*.
After installing patched font terminal emulator, GVim or whatever application
powerline should work with must be configured to use the patched font. The
correct font usually ends with *for Powerline*.
If you cant see the custom symbols, please close all instances of your
terminal emulator. You may need to restart X for the changes to take
effect.
If custom symbols cannot be seen then try closing all instances of the terminal
emulator. X server may need to be restarted for the changes to take effect.
If you *still* cant see the custom symbols, double-check that you have
installed the font to a valid X font path.
If custom symbols *still* cant be seen then double-check that the font have
been installed to a valid X font path.

View File

@ -11,16 +11,16 @@ Python package
sudo port select python python27-apple
. You may use homebrew for this::
. Homebrew may be used here::
brew install python
.
.. note::
In case you want or have to use ``powerline.sh`` socat-based client you
should also install GNU env named ``genv``. This may be achieved by
running ``brew install coreutils``.
In case :file:`powerline.sh` as a client ``socat`` and ``coreutils`` need
to be installed. ``coreutils`` may be installed using ``brew install
coreutils``.
2. Install Powerline using one of the following commans:
@ -45,16 +45,16 @@ Python package
``powerline-status`` in PyPI.
.. note::
If you are powerline developer you should be aware that ``pip install
--editable`` does not currently fully work. If you install powerline this
way you will be missing ``powerline`` executable and need to symlink it.
It will be located in ``scripts/powerline``.
Powerline developers should be aware that``pip install --editable`` does
not currently fully work. Installation performed this way are missing
``powerline`` executable that needs to be symlinked. It will be located in
``scripts/powerline``.
Vim installation
================
Any terminal vim version with Python 3.2+ or Python 2.6+ support should work,
but if youre using MacVim you need to install it using the following command::
but MacVim users need to install it using the following command::
brew install macvim --env-std --override-system-vim
@ -64,6 +64,6 @@ Fonts installation
Install downloaded patched font by double-clicking the font file in Finder, then
clicking :guilabel:`Install this font` in the preview window.
After installing the patched font you need to update MacVim or your terminal
emulator to use the patched font. The correct font usually ends with *for
Powerline*.
After installing the patched font MacVim or terminal emulator (whatever
application powerline should work with) need to be configured to use the patched
font. The correct font usually ends with *for Powerline*.

View File

@ -8,16 +8,15 @@ Application-specific requirements
Vim plugin requirements
^^^^^^^^^^^^^^^^^^^^^^^
The vim plugin requires a vim version with Python support compiled in. You
can check if your vim supports Python by running ``vim --version | grep
The vim plugin requires a vim version with Python support compiled in. Presense
of Python support in Vim can be checked by running ``vim --version | grep
+python``.
If your vim version doesnt have support for Python, youll have to compile
it with the ``--enable-pythoninterp`` flag (``--enable-python3interp`` if
you want Python 3 support instead). Note that this also requires the related
Python headers to be installed on your system. Please consult your
distributions documentation for details on how to compile and install
packages.
If Python support is absent then Vim needs to be compiled with it. To do this
use ``--enable-pythoninterp`` :file:`./configure` flag (Python 3 uses
``--enable-python3interp`` flag instead). Note that this also requires the
related Python headers to be installed. Please consult distributions
documentation for details on how to compile and install packages.
Vim version 7.4 or newer is recommended for performance reasons, but Powerline
is known to work on vim-7.0.112 (some segments may not work though as it was not
@ -28,13 +27,13 @@ actually tested).
Terminal emulator requirements
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Powerline uses several special glyphs to get the arrow effect and some
custom symbols for developers. This requires that you either have a symbol
font or a patched font on your system. Your terminal emulator must also
support either patched fonts or fontconfig for Powerline to work properly.
Powerline uses several special glyphs to get the arrow effect and some custom
symbols for developers. This requires either a symbol font or a patched font
installed. Used terminal emulator must also support either patched fonts or
fontconfig for Powerline to work properly.
You can also enable :ref:`24-bit color support <config-common-term_truecolor>`
if your terminal emulator supports it.
:ref:`24-bit color support <config-common-term_truecolor>` can also be enabled
if terminal emulator supports it.
.. table:: Application/terminal emulator feature support matrix
:name: term-feature-support-matrix

View File

@ -15,32 +15,35 @@ If installed using pip just add
python powerline_setup()
python del powerline_setup
(replace ``python`` with ``python3`` if appropriate) to your :file:`vimrc`.
(replace ``python`` with ``python3`` if appropriate) to the :file:`vimrc`.
If you just cloned the repository add the following line to your :file:`vimrc`,
where ``{repository_root}`` is the absolute path to your Powerline installation
directory:
If the repository was just cloned the following line needs to be added to the
:file:`vimrc`:
.. code-block:: vim
set rtp+={repository_root}/powerline/bindings/vim
If youre using pathogen and dont want Powerline functionality in any other
applications, simply add Powerline as a bundle and point the path above to the
Powerline bundle directory, e.g.
``~/.vim/bundle/powerline/powerline/bindings/vim``.
where ``{repository_root}`` is the absolute path to the Powerline installation
directory.
With Vundle you may instead use
If pathogen is used and Powerline functionality is not needed outside of Vim
then it is possible to simply add Powerline as a bundle and point the path above
to the Powerline bundle directory, e.g.
:file:`~/.vim/bundle/powerline/powerline/bindings/vim`.
Vundle and NeoBundle users may instead use
.. code-block:: vim
Bundle 'powerline/powerline', {'rtp': 'powerline/bindings/vim/'}
(replace ``Bundle`` with ``NeoBundle`` for NeoBundle).
(NeoBundle users need ``NeoBundle`` in place of ``Bundle``, otherwise setup is
the same).
For vim-addon-manager it is even easier since you dont need to write this big
path or install anything by hand: ``powerline`` is installed and run just like
any other plugin using
Vim-addon-manager setup is even easier because it is not needed to write this
big path or install anything by hand: ``powerline`` can be installed and
activated just like any other plugin using
.. code-block:: vim
@ -48,17 +51,16 @@ any other plugin using
.. warning::
*Never* install powerline with pathogen/VAM/Vundle/NeoBundle *and* with pip.
If you want powerline functionality in vim and other applications use
system-wide installation if your system has powerline package, pip-only or
``pip install --editable`` kind of installation performed on the repository
installed by Vim plugin manager.
If powerline functionality is needed in applications other then Vim then
system-wide installation (in case used OS distribution has powerline
package), pip-only or ``pip install --editable`` kind of installation
performed on the repository installed by Vim plugin manager should be used.
If you have installed powerline with pip and with some of Vim package
managers do never report any errors to powerline bug tracker, especially
errors occurring after updates.
No issues are accepted in powerline issue tracker for double pip/non-pip
installations, especially if these issues occur after update.
.. note::
If you use supplied :file:`powerline.vim` file to load powerline there are
If supplied :file:`powerline.vim` file is used to load powerline there are
additional configuration variables available: ``g:powerline_pycmd`` and
``g:powerline_pyeval``. First sets command used to load powerline: expected
values are ``"py"`` and ``"py3"``. Second sets function used in statusline,
@ -66,32 +68,32 @@ any other plugin using
If ``g:powerline_pycmd`` is set to the one of the expected values then
``g:powerline_pyeval`` will be set accordingly. If it is set to some other
value then you must also set ``g:powerline_pyeval``. Powerline will not
check that Vim is compiled with Python support if you set
``g:powerline_pycmd`` to an unexpected value.
value then ``g:powerline_pyeval`` must also be set. Powerline will not check
that Vim is compiled with Python support if ``g:powerline_pycmd`` is set to
an unexpected value.
These values are to be used to specify the only Python that is to be loaded
if you have both versions: Vim may disable loading one python version if
other was already loaded. They should also be used if you have two python
versions able to load simultaneously, but with powerline installed only for
if both versions are present: Vim may disable loading one python version if
other was already loaded. They should also be used if two python versions
are able to load simultaneously, but powerline was installed only for
python-3 version.
Tmux statusline
===============
Add the following lines to your :file:`.tmux.conf`, where ``{repository_root}``
is the absolute path to your Powerline installation directory::
Add the following lines to :file:`.tmux.conf`, where ``{repository_root}`` is
the absolute path to the Powerline installation directory::
source "{repository_root}/powerline/bindings/tmux/powerline.conf"
.. note::
The availability of the ``powerline-config`` command is required for
powerline support. You may specify location of this script via
powerline support. DLlocation of this script may be specified via
``$POWERLINE_CONFIG_COMMAND`` environment variable.
.. note::
It is advised that you run ``powerline-daemon`` before adding the above line
to tmux.conf. To do so add::
It is advised to run ``powerline-daemon`` before adding the above line to
tmux.conf. To do so add::
run-shell "powerline-daemon -q"
@ -100,18 +102,21 @@ is the absolute path to your Powerline installation directory::
IPython prompt
==============
For IPython<0.11 add the following lines to your
:file:`.ipython/ipy_user_conf.py`::
For IPython<0.11 add the following lines to :file:`.ipython/ipy_user_conf.py`:
.. code-block:: Python
# top
from powerline.bindings.ipython.pre_0_11 import setup as powerline_setup
# main() function (assuming you launched ipython without configuration to
# main() function (assuming ipython was launched without configuration to
# create skeleton ipy_user_conf.py file):
powerline_setup()
For IPython>=0.11 add the following line to your :file:`ipython_config.py`
file in the profile you are using::
For IPython>=0.11 add the following line to :file:`ipython_config.py` file in
the used profile:
.. code-block:: Python
c.InteractiveShellApp.extensions = [
'powerline.bindings.ipython.post_0_11'

View File

@ -4,19 +4,19 @@ Shell prompts
.. note::
Powerline daemon is not run automatically by any of my bindings. It is
advised that you add
advised to add
.. code-block:: bash
powerline-daemon -q
before any other powerline-related code in your shell configuration file.
before any other powerline-related code in the shell configuration file.
Bash prompt
===========
Add the following line to your :file:`bashrc`, where ``{repository_root}`` is
the absolute path to your Powerline installation directory:
Add the following line to the :file:`bashrc`, where ``{repository_root}`` is the
absolute path to the Powerline installation directory:
.. code-block:: bash
@ -34,21 +34,21 @@ the absolute path to your Powerline installation directory:
POWERLINE_BASH_SELECT=1
. {repository_root}/powerline/bindings/bash/powerline.sh
in your bash configuration file. Without ``POWERLINE_BASH_*`` variables PS2
in the bash configuration file. Without ``POWERLINE_BASH_*`` variables PS2
and PS3 prompts are computed exactly once at bash startup.
.. warning::
At maximum bash continuation PS2 and select PS3 prompts are computed each
time main PS1 prompt is computed. Do not expect it to work properly if you
e.g. put current time there.
time main PS1 prompt is computed. Thus putting e.g. current time into PS2 or
PS3 prompt will not work as expected.
At minimum they are computed once on startup.
Zsh prompt
==========
Add the following line to your :file:`zshrc`, where ``{repository_root}`` is the
absolute path to your Powerline installation directory:
Add the following line to the :file:`zshrc`, where ``{repository_root}`` is the
absolute path to the Powerline installation directory:
.. code-block:: bash
@ -57,8 +57,8 @@ absolute path to your Powerline installation directory:
Fish prompt
===========
Add the following line to your :file:`config.fish`, where ``{repository_root}``
is the absolute path to your Powerline installation directory:
Add the following line to :file:`config.fish`, where ``{repository_root}`` is
the absolute path to the Powerline installation directory:
.. code-block:: bash
@ -77,9 +77,9 @@ many \*nix distributions. To use it add
. {repository_root}/powerline/bindings/rc/powerline.rc
to your :file:`rcrc` file (usually :file:`~/.rcrc`) and make sure you start your
shell as a login shell (with ``-l`` argument): otherwise this configuration file
is not read.
to :file:`rcrc` file (usually :file:`~/.rcrc`) and make sure ``rc`` is startead
as a login shell (with ``-l`` argument): otherwise this configuration file is
not read.
.. warning::
Original Plan9 shell and its \*nix port are not supported because they are

View File

@ -10,15 +10,15 @@ Awesome widget
.. note:: The Powerline widget will spawn a shell script that runs in the
background and updates the statusline with ``awesome-client``.
Add the following to your :file:`rc.lua`, where ``{repository_root}`` is the
absolute path to your Powerline installation directory:
Add the following to :file:`rc.lua`, where ``{repository_root}`` is the absolute
path to Powerline installation directory:
.. code-block:: lua
package.path = package.path .. ';{repository_root}/powerline/bindings/awesome/?.lua'
require('powerline')
Then add the ``powerline_widget`` to your ``wibox``:
Then add the ``powerline_widget`` to ``wibox``:
.. code-block:: lua
@ -27,7 +27,7 @@ Then add the ``powerline_widget`` to your ``wibox``:
Qtile widget
============
Add the following to your :file:`~/.config/qtile/config.py`:
Add the following to :file:`~/.config/qtile/config.py`:
.. code-block:: python
@ -47,11 +47,12 @@ Add the following to your :file:`~/.config/qtile/config.py`:
I3 bar
======
.. note:: Until the patch is done in i3, you will need a custom ``i3bar`` build
called ``i3bgbar``. The source is available `here
<https://github.com/S0lll0s/i3bgbar>`_.
.. note::
Until the patch is done in i3 a custom ``i3bar`` build called ``i3bgbar`` is
needed. The source is available `in S0lll0s/i3bgbar github repository
<https://github.com/S0lll0s/i3bgbar>`_.
Add the following to your :file:`~/.i3/config`::
Add the following to :file:`~/.i3/config`::
bar {
i3bar_command i3bgbar