2014-01-25 16:19:47 +01:00
|
|
|
|
***************
|
|
|
|
|
Tips and tricks
|
|
|
|
|
***************
|
2013-02-07 12:32:34 +01:00
|
|
|
|
|
|
|
|
|
Vim
|
|
|
|
|
===
|
|
|
|
|
|
|
|
|
|
Useful settings
|
|
|
|
|
---------------
|
|
|
|
|
|
2014-01-25 16:19:47 +01:00
|
|
|
|
You may find the following vim settings useful when using the Powerline
|
2013-02-07 12:32:34 +01:00
|
|
|
|
statusline:
|
|
|
|
|
|
|
|
|
|
.. code-block:: vim
|
2014-01-25 16:19:47 +01:00
|
|
|
|
|
2013-02-07 12:32:34 +01:00
|
|
|
|
set laststatus=2 " Always display the statusline in all windows
|
2014-08-14 20:50:27 +02:00
|
|
|
|
set showtabline=2 " Always display the tabline, even if there is only one tab
|
2013-02-07 12:32:34 +01:00
|
|
|
|
set noshowmode " Hide the default mode text (e.g. -- INSERT -- below the statusline)
|
2013-03-25 09:03:44 +01:00
|
|
|
|
|
2014-08-03 00:43:13 +02:00
|
|
|
|
.. _tips-and-tricks-urxvt:
|
|
|
|
|
|
2014-08-03 00:22:16 +02:00
|
|
|
|
Rxvt-unicode
|
|
|
|
|
============
|
|
|
|
|
|
2013-03-25 09:03:44 +01:00
|
|
|
|
Terminus font and urxvt
|
2014-08-03 00:22:16 +02:00
|
|
|
|
-----------------------
|
2013-03-25 09:03:44 +01:00
|
|
|
|
|
2014-08-03 00:22:16 +02:00
|
|
|
|
The Terminus fonts does not have the powerline glyphs and unless someone submits
|
|
|
|
|
a patch to the font author, it is unlikely to happen. However, Andre Klärner
|
|
|
|
|
came up with this work around: In your ``~/.Xdefault`` file add the following::
|
2013-03-25 09:03:44 +01:00
|
|
|
|
|
2014-08-03 00:22:16 +02:00
|
|
|
|
urxvt*font: xft:Terminus:pixelsize=12,xft:Inconsolata\ for\ Powerline:pixelsize=12
|
2013-03-25 09:03:44 +01:00
|
|
|
|
|
2014-08-03 00:22:16 +02:00
|
|
|
|
This will allow urxvt to fallback onto the Inconsolata fonts in case it does not
|
|
|
|
|
find the right glyphs within the terminus font.
|
2013-04-23 17:02:39 +02:00
|
|
|
|
|
|
|
|
|
Source Code Pro font and urxvt
|
2014-08-03 00:22:16 +02:00
|
|
|
|
------------------------------
|
2013-04-23 17:02:39 +02:00
|
|
|
|
|
2014-08-03 00:22:16 +02:00
|
|
|
|
Much like the terminus font that was mentioned above, a similar fix can be
|
|
|
|
|
applied to the Source Code Pro fonts.
|
2013-04-23 17:02:39 +02:00
|
|
|
|
|
2014-08-03 00:22:16 +02:00
|
|
|
|
In the ``~/.Xdefaults`` add the following::
|
2013-04-23 17:02:39 +02:00
|
|
|
|
|
2014-08-03 00:22:16 +02:00
|
|
|
|
URxvt*font: xft:Source\ Code\ Pro\ Medium:pixelsize=13:antialias=true:hinting=true,xft:Source\ Code\ Pro\ Medium:pixelsize=13:antialias=true:hinting=true
|
2013-04-23 17:02:39 +02:00
|
|
|
|
|
2014-08-03 00:22:16 +02:00
|
|
|
|
I noticed that Source Code Pro has the glyphs there already, but the pixel size
|
|
|
|
|
of the fonts play a role in whether or not the > or the < separators showing up
|
|
|
|
|
or not. Using font size 12, glyphs on the right hand side of the powerline are
|
2014-09-20 15:40:33 +02:00
|
|
|
|
present, but the ones on the left don’t. Pixel size 14, brings the reverse
|
2014-08-03 00:22:16 +02:00
|
|
|
|
problem. Font size 13 seems to work just fine.
|
2014-08-19 20:12:33 +02:00
|
|
|
|
|
|
|
|
|
Reloading powerline after update
|
|
|
|
|
================================
|
|
|
|
|
|
|
|
|
|
Once you have updated powerline you generally have the following options:
|
|
|
|
|
|
|
|
|
|
#. Restart the application you are using it in. This is the safest one. Will not
|
|
|
|
|
work if the application uses ``powerline-daemon``.
|
|
|
|
|
#. For shell and tmux bindings (except for zsh with libzpython): do not do
|
|
|
|
|
anything if you do not use ``powerline-daemon``, run ``powerline-daemon
|
|
|
|
|
--replace`` if you do.
|
|
|
|
|
#. Use powerline reloading feature.
|
|
|
|
|
|
|
|
|
|
.. warning::
|
|
|
|
|
This feature is an unsafe one. It is not guaranteed to work always, it may
|
|
|
|
|
render your Python constantly error out in place of displaying powerline
|
|
|
|
|
and sometimes may render your application useless, forcing you to
|
|
|
|
|
restart.
|
|
|
|
|
|
|
|
|
|
*Do not report any bugs occurred when using this feature unless you know
|
|
|
|
|
both what caused it and how this can be fixed.*
|
|
|
|
|
|
|
|
|
|
* When using zsh with libzpython use
|
|
|
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
|
|
|
|
|
powerline-reload
|
|
|
|
|
|
|
|
|
|
.. note:: This shell function is only defined when using libzpython.
|
|
|
|
|
|
|
|
|
|
* When using IPython use
|
|
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
|
|
%powerline reload
|
|
|
|
|
|
|
|
|
|
* When using Vim use
|
|
|
|
|
|
|
|
|
|
.. code-block:: Vim
|
|
|
|
|
|
|
|
|
|
py powerline.reload()
|
|
|
|
|
" or (depending on Python version you are using)
|
|
|
|
|
py3 powerline.reload()
|