1 *Powerline.txt* For Vim version 7.3. Last change: 2011 Nov 23
5 \_____ \______ _ _____________ / /'__' ___ ____
6 | ___/ _ \ \/ \/ / __ \_ ___\ / | |/ \_/ __ \
7 | | | (_) \ _ / ___/| | / /__| | | \ ___/
8 '___' \____/ \/ \/ \___ |__' /___ /'__'__| /\___ \
14 ==============================================================================
15 CONTENTS *Powerline-contents*
17 1. Introduction ....................... |Powerline-introduction|
18 2. Usage .............................. |Powerline-usage|
19 3. Requirements ....................... |Powerline-requirements|
20 3.1 Recommended settings ........... |Powerline-recommended-settings|
21 4. Configuration ...................... |Powerline-configuration|
22 4.1 Powerline_cache_file ........... |Powerline_cache_file|
23 4.1.1 Clearing the cache ....... |:PowerlineClearCache|
24 4.2 Powerline_cache_enabled ........ |Powerline_cache_enabled|
25 4.3 Powerline_symbols .............. |Powerline_symbols|
26 4.3.1 Compatible symbols ....... |Powerline-symbols-compatible|
27 4.3.2 Fancy symbols ............ |Powerline-symbols-fancy|
28 4.4 Powerline_theme ................ |Powerline_theme|
29 4.5 Powerline_colorscheme .......... |Powerline_colorscheme|
30 5. Fonts .............................. |Powerline-fonts|
31 6. Customization ...................... |Powerline-customization|
32 6.1 Basic customization ............ |Powerline-basic-customization|
33 6.2 Advanced customization ......... |Powerline-advanced-customization|
34 6.2.1 Colorschemes ............. |Powerline-cust-colorschemes|
35 6.2.2 Functions ................ |Powerline-cust-functions|
36 6.2.3 Segments ................. |Powerline-cust-segments|
37 6.2.4 Themes ................... |Powerline-cust-themes|
38 7. License ............................ |Powerline-license|
39 8. Known issues ....................... |Powerline-known-issues|
40 9. Contributing ....................... |Powerline-contributing|
42 ==============================================================================
43 1. Introduction *Powerline* *Powerline-introduction*
45 Powerline is a utility plugin which allows you to create better-looking, more
46 functional vim statuslines.
48 ==============================================================================
49 2. Usage *Powerline-usage*
51 Powerline is automatically enabled when it's installed, either by unzipping
52 the provided archive or by adding it as a Pathogen/Vundle bundle.
54 ==============================================================================
55 3. Requirements *Powerline-requirements*
57 Powerline has been developed and tested in vim 7.3, but it should run without
58 any problems in vim 7.2. The default configuration requires a Unix-like system
61 The plugin only works with vim running in an 88/256-color terminal or gvim.
63 Vi-compatible mode must be disabled.
65 ------------------------------------------------------------------------------
66 3.1 Recommended settings *Powerline-recommended-settings*
68 The following configuration options should be set in your |vimrc|: >
70 set nocompatible " Disable vi-compatibility
71 set laststatus=2 " Always show the statusline
72 set encoding=utf-8 " Necessary to show unicode glyphs
74 Note: If you're using an 88/256-color terminal but still don't see the colored
75 statusline, you may have to set the following option as well: >
77 set t_Co=256 " Explicitly tell vim that the terminal supports 256 colors
79 ==============================================================================
80 4. Configuration *Powerline-configuration*
82 Powerline will work fine without any user configuration, but default behavior
83 can be overridden by setting configuration variables globally in your |vimrc|
86 ------------------------------------------------------------------------------
87 4.1 Powerline_cache_file *Powerline_cache_file*
89 By default Powerline caches all the statuslines and colors in a cache file in
90 the plugin's directory (or the vim directory, depending on the installation
93 It's recommended that you enable the cache, as this dramatically improves vim
94 startup time after the cache file has been generated (the plugin usually loads
95 within ~100ms without the cache and ~1ms with the cache).
97 Note: The default cache filename includes the current theme, colorscheme and
98 symbol settings in order to tie the cache file your current configuration, so
99 the cache file will be regenerated when you change any settings. This may
100 leave several old cache files in your vim folder, and these may safely be
103 Defaults: "<plugin_directory>/Powerline_<theme>_<colorscheme>_<symbols>.cache"
105 ------------------------------------------------------------------------------
106 4.1.1 Clearing the cache *:PowerlineClearCache*
108 Powerline provides a command to easily clear the cache after changing your
109 settings or updating your theme. Simply run the following command to clear
110 your cache, and restart vim afterwards: >
114 ------------------------------------------------------------------------------
115 4.2 Powerline_cache_enabled *Powerline_cache_enabled*
117 It's possible to disable statusline caching by setting this option to 0. This
118 is mostly useful when developing statuslines.
122 ------------------------------------------------------------------------------
123 4.3 Powerline_symbols *Powerline_symbols*
125 This option defines which set of symbols and dividers you want to use. There
126 are currently three available options: "compatible", "unicode" and "fancy".
129 compatible Doesn't use any special characters.
130 unicode Simulates icons and arrows using similar unicode glyphs.
131 fancy Custom icons and arrows. Requires a patched font.
133 Symbols can be inserted into statuslines by using the following variables
134 (just insert the variables as text in your segments):
136 VARIABLE DESCRIPTION ~
137 $BRANCH Inserts a branch symbol
138 $RO Inserts a read-only symbol
139 $FT Inserts a filetype symbol
140 $LINE Inserts a line number symbol
142 Default: "compatible"
144 ------------------------------------------------------------------------------
145 4.3.1 Compatible symbols *Powerline-symbols-compatible*
147 These symbols will work in any configuration, and do not require a special
148 font to work. This option will replace the fancy icons with plain text, and
149 the pointy dividers with straight lines.
151 ------------------------------------------------------------------------------
152 4.3.2 Fancy symbols *Powerline-symbols-fancy*
154 These symbols require a custom font to work. A font patcher is provided for
155 adding the required symbols to any outline font and some bitmap fonts, see
156 |Powerline-fonts| and the provided README file for usage details.
158 ------------------------------------------------------------------------------
159 4.4 Powerline_theme *Powerline_theme*
161 This option defines the theme Powerline uses. The available themes are located
162 in autoload/Powerline/Themes/.
166 ------------------------------------------------------------------------------
167 4.5 Powerline_colorscheme *Powerline_colorscheme*
169 This option defines the colorscheme Powerline uses. The available colorschemes
170 are located in autoload/Powerline/Colorschemes/.
174 ==============================================================================
175 5. Fonts *Powerline-fonts*
179 ==============================================================================
180 6. Customization *Powerline-customization*
182 There are currently two ways of customizing Powerline: Basic customization
183 using a couple of functions to insert and remove existing segments from the
184 statusline, and advanced customization using your own autoload files. The
185 customization features of Powerline allow you to create your own statuslines
186 without ever touching the original source code.
188 ------------------------------------------------------------------------------
189 6.1 Basic customization *Powerline-basic-customization*
191 Powerline provides the following functions to alter the default statusline
192 look. These functions should be called from your |vimrc| file or another file
193 which is sourced at vim startup.
195 Note: These functions are currently applied to all statuslines, so if you
196 insert a segment after a segment which is present in many statuslines (e.g.
197 the "filename" segment), all the statuslines will have the inserted segment.
198 This behavior may be changed in a future version of Powerline.
200 Note: Remember to clear your cache with |:PowerlineClearCache| after changing
205 " Insert the charcode segment after the filetype segment
206 call Pl#Theme#InsertSegment('charcode', 'after', 'filetype')
208 " Replace the scrollpercent segment with the charcode segment
209 call Pl#Theme#ReplaceSegment('scrollpercent', 'fileinfo')
211 *Pl#Theme#InsertSegment*
212 Pl#Theme#InsertSegment({newsegment}, {location}, {targetsegment})
214 This function inserts {newsegment} before or after {targetsegment}. The
215 {location} parameter specifies the location of the new segment, valid values
216 are "before" and "after". You can see all the available segments in
217 autoload/Powerline/Segments.vim and the files specified in
218 |Powerline-cust-segments|.
220 Pl#Theme#RemoveSegment({targetsegment}) *Pl#Theme#RemoveSegment*
222 This function removes the {targetsegment} segment entirely.
224 Pl#Theme#ReplaceSegment({oldsegment}, {newsegment}) *Pl#Theme#ReplaceSegment*
226 This function replaces {oldsegment} with {newsegment}.
228 ------------------------------------------------------------------------------
229 6.2 Advanced customization *Powerline-advanced-customization*
231 Because Powerline utilizes vim's autoload functionality, you can easily create
232 your own segments, themes, functions and colorschemes without touching the
233 original source code. This is a bit more complex than using the utility
234 functions, but it allows you to do a lot more with your statusline.
236 Your custom autoload files should be stored in your |runtimepath| (usually in
237 "~/.vim/autoload/Powerline/*").
239 Note: Remember to clear your cache with |:PowerlineClearCache| after changing
242 6.2.1 Colorschemes *Powerline-cust-colorschemes*
243 ------------------------------------------------------------------------------
245 Colorschemes should be stored as separate files in
246 {runtimepath}/autoload/Powerline/Colorschemes/.
256 6.2.2 Functions *Powerline-cust-functions*
257 ------------------------------------------------------------------------------
259 Functions should be stored as separate files in
260 {runtimepath}/autoload/Powerline/Functions/.
270 6.2.3 Segments *Powerline-cust-segments*
271 ------------------------------------------------------------------------------
273 Segments should be stored as separate files in
274 {runtimepath}/autoload/Powerline/Segments/.
284 6.2.4 Themes *Powerline-cust-themes*
285 ------------------------------------------------------------------------------
287 Themes should be stored as separate files in
288 {runtimepath}/autoload/Powerline/Themes/.
298 ==============================================================================
299 7. License *Powerline-license*
301 Creative Commons Attribution-ShareAlike 3.0 Unported
303 http://creativecommons.org/licenses/by-sa/3.0/
305 ==============================================================================
306 8. Known issues *Powerline-known-issues*
308 See the issue tracker at
309 https://github.com/Lokaltog/vim-powerline/issues
311 ==============================================================================
312 9. Contributing *Powerline-contributing*
314 If you experience any bugs or have feature requests, please open an issue on
315 GitHub. Fork the source repository on GitHub and send a pull request if you
316 have any code improvements.
318 Author: Kim Silkebækken <kim.silkebaekken+vim@gmail.com>
319 Source repository: https://github.com/Lokaltog/vim-powerline
321 ==============================================================================
322 vim:tw=78:sw=4:ts=8:ft=help:norl: