Add the option to specify `interface='default_gateway'` to the
`internal_ip` segment, which displays the IP address of the interface
connected to the default gateway.
Equivalent to airline csv Christian Brabandt plugin integration, but uses Python
own facilities.
Note: filetype detection is out of the scope of the powerline responsibilities.
CSV is supported by powerline, but only as long as filetype detection is
done by Vim correctly. By default CSV files are neither detected nor
highlighted.
Some known differences between powerline code and @chrisbra plugin with
corresponding airline integration:
1. Detection work differently. I cannot say which is better because I have not
tested it much, but it is definitely different.
2. My variant is able to detect whether there is (no) header. (Of course,
relying on Python code.) Airline is using a setting. (Both do not allow
manual per-filetype setting.) Of course, user can force either variant (no
headers at all or headers always).
3. My variant makes it possible to configure header output format, including
truncating it at 15 characters (the default).
4. CSV plugin does not work with multiline CSV items (in some dialects one can
use code like `abc;"I<CR>am<CR>multiline<CR>string"`). See `:h csv-column` on
how to fix this if possible (will require also changing `<sid>WColumn`
function because currently it only works with one line).
5. AFAIK Python does not such a thing as “fixed width CSV”. Thus I do not work
with this, but CSV plugin does. Not sure whether it is different with
space-separated CSV files though.
Note: some modules (i.e wthr and bat) have their names in order to avoid the
situation when module name matches segment name:
import powerline.segments.common.weather
will import weather segment because `powerline.segments.common` contains line
`from powerline.segments.common.weather import weather`.
Fixes#1083
According to the documentation and linter `'highlight_group': 'string'` was not
correct even at the current stage, but it worked. This commit fixes this
situation.
Now imports follow the following structure:
1. __future__ line: exactly one line allowed:
from __future__ import (unicode_literals, division, absolute_import, print_function)
(powerline.shell is the only exception due to problems with argparse).
2. Standard python library imports in a form `import X`.
3. Standard python library imports in a form `from X import Y`.
4. and 5. 2. and 3. for third-party (non-python and non-powerline imports).
6. 3. for powerline non-test imports.
7. and 8. 2. and 3. for powerline testing module imports.
Each list entry is separated by exactly one newline from another import. If
there is module docstring it goes between `# vim:` comment and `__future__`
import. So the structure containing all items is the following:
#!/usr/bin/env python
# vim:fileencoding=utf-8:noet
'''Powerline super module'''
import sys
from argparse import ArgumentParser
import psutil
from colormath.color_diff import delta_e_cie2000
from powerline.lib.unicode import u
import tests.vim as vim_module
from tests import TestCase
.
- This segment displays the number of attached tmux clients to the
currently running session.
- The minimum argument is used to specify a threshold for when the
segment should be visible.
Fixes#661Closes#662
Conflicts:
docs/source/index.rst
powerline/config_files/colorschemes/shell/default.json
powerline/config_files/colorschemes/shell/solarized.json
powerline/config_files/colorschemes/tmux/default.json
powerline/config_files/colorschemes/vim/default.json
powerline/config_files/colorschemes/vim/solarized.json
powerline/config_files/colorschemes/wm/default.json
tests/test_segments.py
Specifically I searched for all lines that are more then one tab off compared to
the previous line with
BufGrep /\(^\t\+\)\S.*\n\1\t\t\+/
and replaced them with something more appropriate. Most of time this resulted in
a few more newlines, but there are cases when I used mixed tabs/spaces
indentation+alignment.