From 89bf0a5c240b1efbb3f0c29e470def53f63ba931 Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Tue, 10 Jan 2017 14:00:44 +0100 Subject: [PATCH] New option: g:startify_fortune_use_unicode References #261. --- autoload/startify/fortune.vim | 2 +- doc/startify.txt | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/autoload/startify/fortune.vim b/autoload/startify/fortune.vim index 9b7b2d3..45ce8df 100644 --- a/autoload/startify/fortune.vim +++ b/autoload/startify/fortune.vim @@ -127,7 +127,7 @@ endfunction " Function: s:draw_box {{{1 function! s:draw_box(lines) abort let longest_line = max(map(copy(a:lines), 'len(v:val)')) - if &encoding == 'utf-8' + if &encoding == 'utf-8' && get(g:, 'startify_fortune_use_unicode') let top_left_corner = '╭' let top_right_corner = '╮' let bottom_left_corner = '╰' diff --git a/doc/startify.txt b/doc/startify.txt index 200ea32..aa1384a 100644 --- a/doc/startify.txt +++ b/doc/startify.txt @@ -92,7 +92,6 @@ default values. |g:startify_custom_header| |g:startify_enable_special| |g:startify_list_order| - |g:startify_relative_path| |g:startify_skiplist| |g:startify_update_oldfiles| @@ -104,7 +103,9 @@ default values. |g:startify_disable_at_vimenter| |g:startify_enable_unsafe| |g:startify_files_number| + |g:startify_fortune_use_unicode| |g:startify_padding_left| + |g:startify_relative_path| |g:startify_skiplist_server| |g:startify_use_env| @@ -329,6 +330,21 @@ Example: \ escape(fnamemodify($HOME, ':p'), '\') .'mysecret.txt', \ ] < +------------------------------------------------------------------------------ + *g:startify_fortune_use_unicode* +> + let g:startify_fortune_use_unicode = 0 +< +By default, the fortune header uses ASCII characters, because they work for +everyone. If you set this option to 1 and your 'encoding' is "utf-8", Unicode +box-drawing characters will be used instead. + +This is not the default, because users of East Asian languages often set +'ambiwidth' to "double" or make their terminal emulator treat characters of +ambiguous width as double width. Both would make the drawed box look funny. + +For more information: http://unicode.org/reports/tr11 + ------------------------------------------------------------------------------ *g:startify_padding_left* >