From f6abca6d2940a5238c8e6ed498f22ea5b46a3806 Mon Sep 17 00:00:00 2001 From: itchyny Date: Thu, 12 Sep 2013 13:00:23 +0900 Subject: [PATCH] improve doc (ref #35) --- README.md | 18 ++++++++++++++ autoload/lightline.vim | 4 +-- doc/lightline.txt | 55 +++++++++++++++++++++++++++++++++--------- 3 files changed, 64 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 6dd23f7..5264162 100644 --- a/README.md +++ b/README.md @@ -226,6 +226,24 @@ let g:lightline = { +If the triangles do not appear (but you get some spaces or weird characters like <bf> or ¿), firstly try adding +```vim +scriptencoding utf-8 +``` +to the head of your `.vimrc`. +Still you have weird characters, use the unicode numbers. For powerline font +users: +```vim + \ 'separator': { 'left': "\ue0b0", 'right': "\ue0b2" }, + \ 'subseparator': { 'left': "\ue0b1", 'right': "\ue0b3" } +``` +For vim-powerline font users: +```vim + \ 'separator': { 'left': "\u2b80", 'right': "\u2b82" }, + \ 'subseparator': { 'left': "\u2b81", 'right': "\u2b83" } +``` + + Almost all of things go well with the patched font but if the triangle looks weird: ![lightline.vim - tutorial](https://raw.github.com/wiki/itchyny/lightline.vim/image/tutorial/22.png) diff --git a/autoload/lightline.vim b/autoload/lightline.vim index 392382c..dc4bfc7 100644 --- a/autoload/lightline.vim +++ b/autoload/lightline.vim @@ -3,7 +3,7 @@ " Version: 0.0 " Author: itchyny " License: MIT License -" Last Change: 2013/09/10 20:38:31. +" Last Change: 2013/09/11 15:08:32. " ============================================================================= let s:save_cpo = &cpo @@ -320,7 +320,7 @@ function! lightline#tabline() endfunction function! lightline#tabs() - let [t, l, x, y, z, u, d] = [tabpagenr(), tabpagenr('$'), [], [], [], '...', min([max([winwidth('.') / 40, 2]), 8])] + let [t, l, x, y, z, u, d] = [tabpagenr(), tabpagenr('$'), [], [], [], '...', min([max([winwidth(0) / 40, 2]), 8])] for i in range(1, l) call add(i + \ 'separator': { 'left': "\ue0b0", 'right': "\ue0b2" }, + \ 'subseparator': { 'left': "\ue0b1", 'right': "\ue0b3" } +< +For |vim-powerline| font users: +> + \ 'separator': { 'left': "\u2b80", 'right': "\u2b82" }, + \ 'subseparator': { 'left': "\u2b81", 'right': "\u2b83" } +< +See |lightline-problem-8| for more detail. ============================================================================== FUNCTION *lightline-function* Exposed functions for lightline.vim. @@ -778,7 +789,7 @@ Problem 7: |lightline-problem-7| patched font. Problem 8: |lightline-problem-8| - Triangles look weird. + Triangles do not appear. Triangles look weird. Problem 9: |lightline-problem-9| Where can I find the list of all the cool characters for patched fonts? @@ -917,8 +928,30 @@ Problem 7: *lightline-problem-7* |vim-powerline|. Problem 8: *lightline-problem-8* - Triangles look weird. + Triangles do not appear. Triangles look weird. + If the triangles do not appear (but you get some spaces or + weird characters like or ¿), firstly try adding +> + scriptencoding utf-8 +< + to the head of your .vimrc(_vimrc). Still you have weird + characters, use the unicode numbers. For |powerline| font + users: +> + \ 'separator': { 'left': "\ue0b0", 'right': "\ue0b2" }, + \ 'subseparator': { 'left': "\ue0b1", 'right': "\ue0b3" } +< + For |vim-powerline| font users: +> + \ 'separator': { 'left': "\u2b80", 'right': "\u2b82" }, + \ 'subseparator': { 'left': "\u2b81", 'right': "\u2b83" } +< + The full list of unicode numbers for fancy characters is shown + in |lightline-problem-9|. + + If the triangles are shown in appropriate characters but the + colors do not look correctly, see the following. If you are using iTerm2, change the following settings. + set Profiles>Colors>Minimum contrast to the Lowest. @@ -931,13 +964,13 @@ Problem 9: *lightline-problem-9* Where can I find the list of all the cool characters for patched fonts? Default powerline vim-powerline - separator.left '' '' '⮀' - separator.right '' '' '⮂' - subseparator.left '|' '' '⮁' - subseparator.right '|' '' '⮃' - branch symbol -- '' '⭠' - readonly symbol -- '' '⭤' - linecolumn symbol -- '' '⭡' + separator.left '' '' (\ue0b0) '⮀' (\u2b80) + separator.right '' '' (\ue0b2) '⮂' (\u2b82) + subseparator.left '|' '' (\ue0b1) '⮁' (\u2b81) + subseparator.right '|' '' (\ue0b4) '⮃' (\u2b83) + branch symbol -- '' (\ue0a0) '⭠' (\u2b60) + readonly symbol -- '' (\ue0a2) '⭤' (\u2b64) + linecolumn symbol -- '' (\ue0a1) '⭡' (\u2b81) Problem 10: *lightline-problem-10* Cool statusline disappears on |unite|, |vimfiler| and |vimshell|