Git Product home page Git Product logo

powerline / powerline Goto Github PK

View Code? Open in Web Editor NEW
14.2K 268.0 992.0 4.16 MB

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

Home Page: https://powerline.readthedocs.org/en/latest/

License: Other

C 0.39% Python 90.61% Shell 7.06% Lua 0.04% Vim Script 1.90%
python statusline prompt vim bash zsh fish tmux ipython powerline

powerline's Introduction

Powerline

Build status

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 ([email protected])
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 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.

Screenshots

Vim statusline

Mode-dependent highlighting

  • Normal mode
  • Insert mode
  • Visual mode
  • Replace mode

Automatic truncation of segments in small windows

  • Truncation illustration
  • Truncation illustration
  • Truncation illustration

The font in the screenshots is Pragmata Pro by Fabrizio Schiavi.

powerline's People

Contributors

aikeru avatar arslan2012 avatar aschrab avatar austinbeam avatar blitzkraft avatar blueyed avatar bricewge avatar chester755 avatar cryptomilk avatar dffischer avatar einfachtoll avatar gsusrafael avatar iblislin avatar jdrouhard avatar joshperry avatar kovidgoyal avatar lokaltog avatar mrshu avatar mynameisfiber avatar pdf avatar ph111p avatar pmacosta avatar qulogic avatar s-ol avatar seanfisk avatar stopmotioncuber avatar thomwiggers avatar wernight avatar yparisien avatar zyx-i avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

powerline's Issues

Colorscheme namespacing

Currently colorschemes will be a complete mess unless highlighting groups can be namespaced. Some highlighting groups are entirely extension-specific and should not be available for other extensions. This will also allow different extensions to highlight functions with the same function name differently.

Namespacing could be done by having another dict in the colorscheme json files:

"groups": {
    "gradient1": { ... } <-- available for all extensions
    ...
},
"extension_groups": {
    "vim": {
        "modified_indicator": { ... } <-- only available in vim
        ...
    }
}

What do you guys think?

Python 2, Python 3, or both?

Because this plugin depends so much on correct Unicode handling, I'm very uncertain about this issue. I haven't written Python 2-specific code for quite a while before this project, so I fear that my lack of experience with Python 2's quirky Unicode handling may result in weird bugs in the future (it already has occured in this project).

Also, I think it's more responsible to write new code specifically for Python 3, to increase the adoption rate of this version of Python. It's been 4 years since its release, so I'm a bit reluctant to write new code for Python 2 in general.

My impression is that vim is rarely compiled with Python 3 support, which would require users to compile vim manually. I'm not really sure if this even is an issue. Does Homebrew for OS X provide precompiled binaries, or do users need to compile vim on their system anyways? Is it fair to require Linux users to compile vim manually with Python 3 support? In my experience this is quite a bit of hassle on systems like Ubuntu.

I'd like some input on this issue. I'd like to see this version of Powerline gain at least the same user base as the pure vimscript version, but a hurdle like this could certainly limit adoption of the new version. On the other hand, most vim users are developers, so do they even care if they have to compile vim manually?

Patching Consolas font in OSX

After hours of struggling, I have been unable to get the Consolas font working with powerline in OSX. Ive tried downloading the pre-patched fonts as well as using fontpatcher to patch them myself. So far, no dice. The closest I could get was using fontpatcher on the already pre-patched fonts which results in working italicized fonts but not for bold nor for regular.

Unable to Get Working on iTerm2

I've been unable to get Powerline working properly using vim in iTerm2.

It works fine in MacVim, and in the standard Mac OSX Terminal application.

It appears as if the patched font is not being used as I get question mark characters. However, I've used the same font with both Terminal and MacVim without issue...

I've tried downloading several patched fonts from other people, and patched my own (Monaco and Consolas) with no improvement.

Screenshot:
Screen Shot 2013-01-03 at 5 55 54 PM

Anyone else experienced anything similar?

I'm using iTerm2 Build 1.0.0.20120203 with Vim 7.3p762 on OSX 10.8.2.

Any suggestions would be appreciated!

Support 24-bit color in terminal

There is ISO-8613-3 standard for 24-bit color in terminals: \e[38;2;{R};{G};{B}m (foreground, 48 for background) ({R},{G},{B} are decimal integers from 0 to 255). Currently it is fully supported only* by konsole and partially** in xterm. On Windows there is support for this in ConEmu. I am working on supporting this in vim (it will use guifg/guibg attributes in terminal). Working version, bookmark 24-bit-xterm. Does not work if you try to compile with gui support enabled.

Issue is not urgent, but nice-to-have. I will probably look at it later as it should be easy to add.

* Checked all terminals that have at least one stable version in Gentoo main portage tree.

** Uses nearest color from 8-bit palette.

WANTED: Package maintainers

Since Powerline is intended to be installed as a Python package and not cloned into .vim as the previous version, it would be much more convenient to have Powerline in each distro's package tree (it's currently available on the AUR for Arch Linux users) so it can be updated automatically as a part of upgrading the user's system.

It would be awesome if any users of other distros or OSX could provide and maintain packages for Powerline when it's released. Please post links to the packages in this issue so I can add them to the docs.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Font patching happens in-place on OSX

I was surprised to find that fontpatcher.py patches the font in-place. This is not what I expected from the docs.

IMHO there should be a big red warning somewhere, so people do not (like I did) run this directly on system fonts. At bare minimum the OSX documentation should be updated to remove the post-patching install instructions that seem pretty redundant.

An ASCII version?

powerline looks very cool. However, it would look weird on machines without the special font (e.g., log in remotely to my own machine with powerline from other road machines). Should we provide a simple ASCII look, and some mechanism to switch between the two?

Request for feedback: Patched fonts may be unnecessary for many users

After moving the glyphs to the private use area I've done some testing and on my system and it appears that I don't actually have to have a patched font for the custom glyphs to work anymore. The glyphs look nice in all the coding fonts I've tried.

I've added a font file with only the patched symbols in it in 2cfd01e (located in powerline/fontpatcher/PowerlineSymbols.otf), and I'd like users on different systems to try this and see which systems this workaround works on.

EDIT: Please try these instructions instead!


Steps to reproduce (for Linux users, but probably quite similar for OSX users):

  1. Uninstall all fonts that may have Powerline glyphs in them.
  2. Copy PowerlineSymbols.otf to ~/.fonts.
  3. Run fc-cache -vf ~/.fonts
  4. Close all gvim instances and terminal emulators that's going to use Powerline.
  5. Start vim/gvim and select any coding font you want.

My system is running Arch Linux and vim in the Xfce Terminal. Let me know which systems and fonts you're using, and feel free to provide screenshots of how it looks.

Thanks!

Powerline on Windows opens several cmd windows on git managed files

I’m running gVim 7.3 (patches 1-754) on Windows.

Powerline is running fine in all aspects:

  • Shows every included segment correctly
  • No error messages

There is just one major problem:
Every time I work on a file inside a git repository, it flashes 2 cmd windows invoking git and almost immediatly disappearing.
This happens every time I click inside the window, or move the cursor.
The windows also steal the focus of vim, so working on a file is impossible.

Documentation improvements

I've written most of the documentation, but I'd like some comments on stuff that can be improved, and if anything is missing from the docs. I'm not a native English speaker either, so I'm sure much of the grammar in the docs can be improved.

Please let me know if you have any comments, and feel free to open a pull request with corrections or improvements to the docs.

Current status

Hi, my name is Eduan.

I am very interested in this descendant of the original, but I'm not sure of it's status.

Is it useable? Is it in alpha? Beta? What is it's current status.

Thanks for your attention.

Is it possible to change chars used for separators?

Hi,

It would be nice if there would be a way to override chars used for separators. That will allow to avoid font patching and use own separators, e.g. "|" instead of less-than arrow and so on. Something similar to vim's set listchars=...

Memoization only work on per-session basis

It is completely unsatisfactory for file_vcs_status segment: when switching between files I get information for file I have switched from. Neither it is good for branch segment: I constantly look for code in other projects as an example or even reference.

IPv6 issue in weather segment in tmux extension

external_ip() gets IP address from icanhazip.com, which will return IPv6 address if applicable. This would cause an error in weather() since freegeoip.net doesn't support IPv6 address. Using myip.dnsdynamic.org can avoid this issue.

guifont and guifontwide

OS: Windows 7
Version: 7.3 path 1-754

set guifont=Inconsolata\ for\ Powerline:h12:cANSI
set guifontwide=YaHei_Consolas_Hybrid
YaHei_Consolas_Hybrid not path
can't see the fancy symbols
vim-powerline no problem

set guifont=Inconsolata\ for\ Powerline:h12:cANSI
set guifontwide=
OK

Unicode code points and new glyphs

As discussed in Lokaltog/vim-powerline#128, all the glyphs are going to be moved to the Private Use Area for this version of Powerline. This also gives us the opportunity to include some new glyphs in this version. I'm thinking about a pencil shaped icon (file modified) and a window shaped icon (like two overlapping windows) for buffer number segments.

Since this project is going to be used for tmux and shell prompts as well, do you have any other ideas to new glyphs that we could include?

Merge configuration files

Currently user config files have to include all configuration options to work properly because the plugin only loads config files from one location. By merging user config files with the provided defaults, users will be able to override single options without including all the other config options.

Vim Startup Error R6034

When I use the .vimrc command:

python from powerline.ext.vim import source_plugin; source_plugin()

It gives me a runtime error from Microsoft Visual C++ Library. Vim then starts up and the powerline looks great, but anytime it refreshes, like I click my mouse somewhere I want to edit, two command windows breifly show up and close. I am on Windows 7 32bit

Mac OSX 10.8.2 (Fails to load properly)

In Mac OSX 10.8.2 im unable to get powerline to work, it bails everytime vim lauches with the following error:

Error detected while processing /Users/wbroach/.vimrc:
line 1:
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named powerline.ext.vim

I can verify that the module is in fact installed:

Python 2.7.2 (default, Jun 20 2012, 16:23:33)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

import powerline.ext.vim
dir(powerline)
['builtins', 'doc', 'file', 'name', 'package', 'path', 'ext']

It can be found in the following location on my system:

/Library/Python/2.7/site-packages/Powerline-beta-py2.7.egg/powerline/ext/vim/powerline.vim
/Library/Python/2.7/site-packages/powerline/ext/vim/powerline.vim

Im using just a plain blank .vimrc with just one line, shown below:

python from powerline.ext.vim import source_plugin; source_plugin()

My sys specs are as follows:

VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Aug 16 2012 15:12:57)
Python 2.7.2 (default, Jun 20 2012, 16:23:33)

I can verify that vim is in fact using the correct python version that the module is installed to

in vim:

:python import sys
:python print(sys.version)
2.7.2 (default, Jun 20 2012, 16:23:33)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)]
Press ENTER or type command to continue

Please advise

vim: Non-current windows use wrong info after switching between split windows

For some reason non-current windows use the info of the last window added(?) after switching between split windows. Reproducable by following these steps:

  1. Open vim
  2. Open a random file, e.g. your vimrc
  3. Do a :vsplit
  4. Open another file or a blank file with :enew
  5. Switch to the other split window

The non-current window is now displaying all the information from the original buffer (the first random file), and not the correct information for the buffer that is present in that window.

This bug may be caused by the "randomization" of window numbers when switching between split numbers, and the looping through windows where the w:powerline window variable is set. I've tried connecting the window data with the buffer number (i.e. storing data in w:powerline[bufnr]) but with no luck.

Non-current windows use the theme of the current window

This is probably related to #11 in some way, and it can be reproduced in a similar fashion: Open vim, create a couple of vertical splits and then run :help in one of the windows. Navigate between the windows and you'll notice that whenever the help window is focused, the other non-current windows will use its theme (in this case the file path and column segment is removed).

Possibly better installation instruction for developers

Right now, the documentation explains how to use pip to install the develop tarball. The following is probably the best method because it will allow users to fiddle with it and then commit it for pull-requests. I don't know if you want this in documentation or not, but it is helpful, so I add it here:

mkdir ~/.pip
cd ~/.pip
pip install -e git+https://github.com/Lokaltog/powerline.git@develop#egg=powerline

This creates a directory ~/.pip/src/powerline which is also a git repository for development purposes. It can be edited and it affects powerline instantaneously.

a lot of errors whyle `rake update` with Vundle

Vundle plugin has a rake task to update installed plugins - rake update. Rake task outputs a lot of errors:

Updating Bundles
Error detected while processing /home/saks/.vim/bundle/powerline/powerline/ext/vim/powerline.vim:
line    1:
E319: Sorry, the command is not available in this version: python import sys, vim, os
line    2:
E319: Sorry, the command is not available in this version: python sys.path.append(vim.eval('expand("<sfile>:h:h:h:h")'))
line    3:
E319: Sorry, the command is not available in this version: python import uuid
line    4:
E319: Sorry, the command is not available in this version: python from powerline.core import Powerline
line    5:
E319: Sorry, the command is not available in this version: python pl = Powerline('vim')
line   10:
E319: Sorry, the command is not available in this version: ^Ipython import json
Error detected while processing /home/saks/.vimrc:
line  329:
E319: Sorry, the command is not available in this version: python from powerline.ext.vim import source_plugin; source_plugin()

Vim segfaults when I load powerline in my .vimrc - runs fine when it's commented out (gdb dump included)

I know you already closed a previous bug submission that was similar to mine.

Please have a look at the gdb dump which clearly shows that the fault originates in a python call.

I installed powerline with the pip method as described in the docs.
As far as I know, nothing else in my vim setup is running python besides powerline.

After vim is launched from the terminal and segfaults, all mouse clicks outputs garbage to my tty and the text marker is also gone, until I restart the tty session.

I am using vim 7.3 compiled with python support as you can see in my output of vim --version and I have python 2.7.3.

If there's anything else I can do or provide, please let me know. Powerline is such a great plugin. I would really like to do what I can to see that powerline matures into a rock solid and amazing piece of software. If the problem lies anywhere else but the powerline plugin, I sincerely apoligize for wasting your time, but I will also be thankful for taking your project seriously by ensuring that every possible bug is thoroughly examined.

prompt not loading properly in zsh

Adams-MacBook-Pro% export PS1=`~/.dotfiles/libs/powerline/scripts/powerline-prompt`
zsh: not an identifier: %{^[[38;5;31;48;5;240;22m%}?
zsh --version
zsh 5.0.2 (x86_64-apple-darwin12.2.1)

Theme syntax

With the recent changes the suggested theme syntax in Lokaltog/vim-powerline#193 won't work as expected anymore. This is caused partially by the getwinvar/setwinvar workarounds (data has to be cached in a window dict), and by the possibility of having dynamic segments that are evaluated and able to change properties like colors and attributes for each statusline redraw.

An example of this dynamic behavior is the gradient cursor percentage segment from the vim example. Another example is the dynamic removal of the divider between the filename and the modified indicator if the modified indicator isn't empty.

If we decide to use JSON as the theme syntax, it may not be possible at all to have this kind of dynamic evaluation. The proposed JSON syntax will only allow passing arguments to the segment functions, but not actually change segment properties based on the current state of the window/buffer.

@ZyX-I What do you think we should do about this? Should we define themes in Python to allow this dynamic behavior, or should we stick to JSON? Do you have any suggestions to how we could use JSON and still have the possibility of dynamically changing segments?

Feature request: rbenv support

In the previous version of vim-powerline there was RVM support. It would be great if there was support for rbenv in the new one.

Git submodule branches not showing correctly

Seems the terminal powerline git code isn't pulling the correct branch if the repo is a submodule. The structure is:

main project (master branch)
-->submodule (development branch)

If you are in the submodule set to the development branch it's showing the active branch as "master" when it should be "development".

Can't see symbols in vim but present in tmux

Hey

I've recently switched computers and have installed the new version

After a bunch of head scratching though I just can't seem to get symbols displaying correctly in vim even though tmux seems to work correctly. I've also tested the zsh prompt which again shows the ? symbols

Screen Shot 2013-01-19 at 16 06 18

I'm running OSX 10.8.2 with a patched font (Inconsolata). Running iTerm 2

Any help/suggestions greatly received!

/Matt

Plugin API

As proposed by @ZyX-I in Lokaltog/vim-powerline#193, we should allow plugin authors to define the statuslines for their plugins in their own repos as opposed to including just the "top" plugins in the main Powerline code base. The proposed syntax was:

{
    "allow_plugin_subthemes": 1,
    "config_dirs": ["/full/path/to/dir", "~/.powerline"],
    "vim": {"theme": {"default": "my", "nerdtree": "nerdtree"}, "colorscheme": "my"}
}

A nice touch here is that the user can allow or disallow plugins to take control of the statusline. Another solution could be to have a config directive like "disallow_plugin_themes": ["nerdtree", "..."] for disabling single plugins instead.

There are a couple of issues I see with plugin authors writing their own segments and themes:

  1. Now that segments are written in Python, we would have to require plugin authors to potentially learn Python to write segments, instead of just using vimscript.
  2. Python modules work quite differently from vimscript and autoloading. How would we resolve the path and module issues for all the different vim configurations and bundle setups out there? Lookup plugins with a powerline.json file in their main folder and cache the paths, and later load them into Powerline? How would we do segment imports?
  3. We need to have a solid and tested API from the beginning, because once plugin authors start to use it it would be a lot of work updating it. We could include a version tag in the JSON files to be able to update the API more easily.

What do you think about these issues?

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

What about simplifying the core lib with oo?

I was looking through the library and I think there are some highly complex portions of the code such as a function-generator for the core powerline-renderer (yikes). I would like to hear some opinions on restructuring this code a more object-oriented approach. This could simplify the library (making it easier to manage and maintain) as well as allow for plugins/themes that extend these classes and allow for further customization if the core library doesn't give exactly what they want.

What do you think about the following classes

Theme: (Takes in json file or whatever and generates left-right lists of Segments)
Powerline ( Takes Theme and "format")
Renderer: (takes a segment and produces a string representation based on "format")
                 TmuxRenderer: specific for format="tmux"
                 VimRenderer: ... "vim"
                 TerminalRenderer: ... "terminal
Segment: takes key-word-arguments from Theme

If you agree with this, I'd be glad to take a crack at it to see what you think. Of course, the theme syntax hasn't been settled yet, so it would be a bit difficult to start without putting **kwargs everywhere (not a good idea, I think). Any other thoughts or ideas with regards to abstracting the core powerline lib?

OSX font patching brew docs out of date

The instructions for setting up fontforge say to do the following:

brew install --use-gcc fontforge

However, this throws the following error:

Error: GCC could not be found

Turns out you should just not use the --use-gcc flag.

References:


Also of note is the following Caveat in the fontforge Formula:

To use the Python extension with non-homebrew Python, you need to amend your
PYTHONPATH like so:
  export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH

Just running the export before calling fontforge seems to work ok.

Error when installed use vundle

I try install new powerline by us vundle, and put this line in my .vimrc:

source {path}/powerline/ext/vim/source_plugin.vim.

But I got this error during vim startup, E858 Eval not return a valid python object.

Anyone can help me figure this out?

Restructure extension directories?

As of 65e358d some segments have been moved into a common module to emphasize that they can be used by any extension. This doesn't really work with the current module naming scheme with a separate ext directory for each extension. I suggest that we restructure the extension directories somewhat.

This is the current structure:

powerline/
    matchers.py
    renderer.py
    segments.py
    ext/
        common/
            segments.py
        terminal/
            renderer.py
        tmux/
            renderer.py
        vim/
            bindings.py
            matchers.py
            renderer.py
            segments.py

This doesn't work too well with "common" modules like the terminal/tmux segments. They're located in the ext directory to match the current structure, even though "common" isn't really an extension.

I suggest that we move to a structure like this instead, as it would better allow common segments, common bindings, etc.:

powerline/
    bindings/
        vim.py
    matcher.py
    matchers/
        vim.py
    renderer.py
    renderers/
        terminal.py
        tmux.py
        vim.py
    segment.py
    segments/
        common.py
        vim.py

I'm not quite sure where we should put stuff like powerline.vim and source_plugin.vim though.

I'd like some feedback on this because I honestly don't know if this would be a change for the better or worse. Any other suggestions to structuring this stuff would also be great.

Powerline errors out after recent commit

Due to this commit: 8d584d0

I now get the following error when launching MacVim

big

I have the plugin installed via Vundle, I assume this is still a valid way to install the plugin?

I source it via:

source ~/.vim/bundle/powerline/powerline/ext/vim/source_plugin.vim

//Edit: I sourced the wrong commit

Perform checks for common issues when plugin is loaded

When Powerline is loaded it could do a couple of basic checks to see if the environment is properly configured to use UTF-8 and other issues, and report potential problems to the user. The checks that could be done include:

  • Check the LANG and LC_* environment variables to see if they're configured with an UTF-8 charset and automatically fallback to the fallback symbols if the charset is incorrectly configured
  • Check vim's encoding option
  • Check (and set?) vim's laststatus option
  • Check $TERM to see if the terminal supports 256 colors and optionally display an error message or notice
  • Since the new plugin is Python based, it could possibly check if the font that is configured is patched, and automatically select whether to use fancy symbols or fallback symbols
  • Check if the plugin is run in a tmux environment , and whether it's configured with the proper default-terminal setting

symbols are and method names are missing

Hi,
Why symbols are and method names are missing in powerline ( see http://i.imgur.com/ZahvF.png ) ?

easy_install --prefix=/home/mictadlo/apps/pymodules -UZ pyflakes
easy_install --prefix=/home/mictadlo/apps/pymodules -UZ rope
easy_install --prefix=/home/mictadlo/apps/pymodules -UZ ropemode
easy_install --prefix=/home/mictadlo/apps/pymodules -UZ ipython
easy_install --prefix=/home/mictadlo/apps/pymodules -UZ pylint
easy_install --prefix=/home/mictadlo/apps/pymodules -UZ pep8
easy_install --prefix=/home/mictadlo/apps/pymodules -UZ flake8

mkdir -p ~/.vim/colors && cd ~/.vim/colors 
wget -O wombat256mod.vim http://www.vim.org/scripts/download_script.php?src_id=13400
mkdir -p ~/.vim/autoload ~/.vim/bundle
curl -so ~/.vim/autoload/pathogen.vim https://raw.github.com/tpope/vim-pathogen/HEAD/autoload/pathogen.vim

cd ~/.vim/
git init
git submodule add https://github.com/klen/python-mode.git bundle/python-mode
git submodule add https://github.com/Lokaltog/powerline.git bundle/powerline
git submodule add https://github.com/kien/ctrlp.vim.git bundle/ctrlp.vim
git submodule add https://github.com/ivanov/vim-ipython bundle/vim-ipython      #videos avaible
git submodule add https://github.com/majutsushi/tagbar bundle/tagbar
git submodule add https://github.com/vim-scripts/indentpython.vim bundle/indentpython
git submodule add https://github.com/scrooloose/nerdtree bundle/nerdtree
git submodule add https://github.com/scrooloose/nerdcommenter bundle/nerdcommenter
git submodule add https://github.com/vim-scripts/mru.vim bundle/mru.vim
git submodule add https://github.com/tpope/vim-surround.git bundle/vim-surround #?
git submodule add https://github.com/ervandew/supertab.git bundle/supertab
git submodule add https://github.com/sjl/gundo.vim.git bundle/gundo.vim
git submodule add https://github.com/alfredodeza/pytest.vim.git bundle/pytest.vim
git submodule add https://github.com/reinh/vim-makegreen bundle/vim-makegreen
git submodule add https://github.com/rstacruz/sparkup.git bundle/sparkup
git submodule init
git submodule update
git submodule foreach git submodule init
git submodule foreach git submodule update
rm -rf .git .gitmodules

mkdir -p ~/.vim/ftplugin 
wget -O ~/.vim/ftplugin/python_editing.vim http://www.vim.org/scripts/download_script.php?src_id=5492

I use the following .vimrc:

" Sample .vimrc file by Martin Brochhaus
" Presented at PyCon APAC 2012


" ============================================
" Note to myself:
" DO NOT USE <C-z> FOR SAVING WHEN PRESENTING!
" ============================================


" Automatic reloading of .vimrc
autocmd! bufwritepost .vimrc source %


" Better copy & paste
" When you want to paste large blocks of code into vim, press F2 before you
" paste. At the bottom you should see ``-- INSERT (paste) --``.

set pastetoggle=<F2>
set clipboard=unnamed


" Mouse and backspace
set mouse=a  " on OSX press ALT and click
"" set bs=2     " make backspace behave like normal again


" Rebind <Leader> key
" I like to have it here becuase it is easier to reach than the default and
" it is next to ``m`` and ``n`` which I use for navigating between tabs.
let mapleader = ","


" Bind nohl
" Removes highlight of your last search
" ``<C>`` stands for ``CTRL`` and therefore ``<C-n>`` stands for ``CTRL+n``
noremap <C-n> :nohl<CR>
vnoremap <C-n> :nohl<CR>
inoremap <C-n> :nohl<CR>


" Quicksave command
"" noremap <C-Z> :update<CR>
"" vnoremap <C-Z> <C-C>:update<CR>
"" inoremap <C-Z> <C-O>:update<CR>


" Quick quit command
"" noremap <Leader>e :quit<CR>  " Quit current window
"" noremap <Leader>E :qa!<CR>   " Quit all windows


" bind Ctrl+<movement> keys to move around the windows, instead of using Ctrl+w + <movement>
" Every unnecessary keystroke that can be saved is good for your health :)
map <c-j> <c-w>j
map <c-k> <c-w>k
map <c-l> <c-w>l
map <c-h> <c-w>h


" easier moving between tabs
map <Leader>n <esc>:tabprevious<CR>
map <Leader>m <esc>:tabnext<CR>


" map sort function to a key
vnoremap <Leader>s :sort<CR>


" easier moving of code blocks
" Try to go into visual mode (v), thenselect several lines of code here and
" then press ``>`` several times.
vnoremap < <gv  " better indentation
vnoremap > >gv  " better indentation


" Show whitespace
" MUST be inserted BEFORE the colorscheme command
autocmd ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=red
au InsertLeave * match ExtraWhitespace /\s\+$/


" Color scheme
" mkdir -p ~/.vim/colors && cd ~/.vim/colors
" wget -O wombat256mod.vim http://www.vim.org/scripts/download_script.php?src_id=13400
set t_Co=256
color wombat256mod


" Enable syntax highlighting
" You need to reload this file for the change to apply
filetype off
filetype plugin indent on
syntax on


" Showing line numbers and length
set number  " show line numbers
set tw=79   " width of document (used by gd)
set nowrap  " don't automatically wrap on load
set fo-=t   " don't automatically wrap text when typing
set colorcolumn=80
highlight ColorColumn ctermbg=233


" easier formatting of paragraphs
vmap Q gq
nmap Q gqap


" Useful settings
set history=700
set undolevels=700


" Real programmers don't use TABs but spaces
set tabstop=4
set softtabstop=4
set shiftwidth=4
set shiftround
set expandtab


" Make search case insensitive
set hlsearch
set incsearch
set ignorecase
set smartcase


" Disable stupid backup and swap files - they trigger too many events
" for file system watchers
set nobackup
set nowritebackup
set noswapfile


" Setup Pathogen to manage your plugins
" mkdir -p ~/.vim/autoload ~/.vim/bundle
" curl -so ~/.vim/autoload/pathogen.vim https://raw.github.com/tpope/vim-pathogen/HEAD/autoload/pathogen.vim
" Now you can install any plugin into a .vim/bundle/plugin-name/ folder
call pathogen#infect()


" ============================================================================
" Python IDE Setup
" ============================================================================


" Settings for vim-powerline
" cd ~/.vim/bundle
" git clone git://github.com/Lokaltog/vim-powerline.git
source ~/.vim/bundle/powerline/powerline/ext/vim/source_plugin.vim
let g:Powerline_symbols = 'fancy'
set laststatus=2


" Settings for ctrlp
" cd ~/.vim/bundle
" git clone https://github.com/kien/ctrlp.vim.git
let g:ctrlp_max_height = 30
set wildignore+=*.pyc
set wildignore+=*_build/*
set wildignore+=*/coverage/*


" Settings for python-mode
" cd ~/.vim/bundle
" git clone https://github.com/klen/python-mode
map <Leader>g :call RopeGotoDefinition()<CR>
let ropevim_enable_shortcuts = 1
let g:pymode_rope_goto_def_newwin = "vnew"
let g:pymode_rope_extended_complete = 1
let g:pymode_breakpoint = 0
let g:pymode_syntax = 1
let g:pymode_syntax_builtin_objs = 0
let g:pymode_syntax_builtin_funcs = 0
map <Leader>b Oimport ipdb; ipdb.set_trace() # BREAKPOINT<C-c>

" Better navigating through omnicomplete option list
" See http://stackoverflow.com/questions/2170023/how-to-map-keys-for-popup-menu-in-vim
"" set completeopt=longest,menuone
function! OmniPopup(action)
if pumvisible()
    if a:action == 'j'
    return "\<C-N>"
    elseif a:action == 'k'
    return "\<C-P>"
    endif
endif
return a:action
endfunction

inoremap <silent><C-j> <C-R>=OmniPopup('j')<CR>
inoremap <silent><C-k> <C-R>=OmniPopup('k')<CR>


" Python folding
" mkdir -p ~/.vim/ftplugin
" wget -O ~/.vim/ftplugin/python_editing.vim http://www.vim.org/scripts/download_script.php?src_id=5492
set nofoldenable

" SuperTab plugin can be used to avoid needing to press Ctrl-X then Ctrl-O to invoke the popup completion menu. 
let g:SuperTabDefaultCompletionType = "context"

" Now we just enable the menu and pydoc preview to get the most useful 
" information out of the code completion
set completeopt=menuone,longest,preview

What could cause that?

Thank you in advance.

Color leak in ZSH

zsh 5.0.2 (x86_64-apple-darwin12.2.1), no .zshrc

I set PS1 by:

setopt prompt_subst
export PS1=\`~/.dotfiles/libs/powerline/scripts/powerline-prompt\`

I invoke ls -G (to enable colors for ls), and I get following output: http://d.pr/i/AUy4

As you can see, color 'leaks' from the prompt into my input and beginning of ls -G command output, until it's replaced by another color.

setup.py syntax error

Hello,

I think in last version posted to pipy, there's a glitch in the setup file. It looks like you put two times the zip_safe in the setup.py file.

Downloading/unpacking powerline
  Downloading powerline-0.2.4.zip (79kB): 79kB downloaded
  Running setup.py egg_info for package powerline
    Traceback (most recent call last):
      File "<string>", line 16, in <module>
      File "/var/folders/pm/pmEvZQRMFJ8H9Sfw2IZGgU+++TM/-Tmp-/pip-build/powerline/setup.py", line 27
        zip_safe = False,
    SyntaxError: keyword argument repeated
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 16, in <module>

  File "/var/folders/pm/pmEvZQRMFJ8H9Sfw2IZGgU+++TM/-Tmp-/pip-build/powerline/setup.py", line 27

    zip_safe = False,

SyntaxError: keyword argument repeated

----------------------------------------
Command python setup.py egg_info failed with error code 1 in /var/folders/pm/pmEvZQRMFJ8H9Sfw2IZGgU+++TM/-Tmp-/pip-build/powerline

here's a little patch, if that helps:

diff --git a/setup.py b/setup.py.patched
index 41b8b12..048d2f9 100644
--- a/setup.py
+++ b/setup.py.a
@@ -24,7 +24,6 @@ setup(
                        'templates/data/images/*'
                ]
        },
-   zip_safe = False,

        install_requires = [
                'setuptools>=0.6b1',

HTH

turn off nag prompt?

Is it possible to disable the nag prompt about upgrading to the plugin?

At the moment, being an admin, I'm installing on to a lot of machines each week & I carry the old Powerline plugin in my vimrc & use vundle to install my plugins when I pull in my dotfiles from Github for every machine.

I like the look of the new plugin but I'm just going over the process of installing it first on my Macbook Pro & it's quite an involved process so I'd rather leave it for a couple of weeks before I upgrade (I've got to check it against CentOS 5.8, 5.9 & 6.3, Debian Squeeze & Wheezy, Fedora 17, 18 & Rawhide, Lubuntu 12.10, OS X Snow Leopard & Ubuntu Precise & Quantal & I haven't got the time at the moment).

Any help appreciated...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.