From 61b489ddf515ac27a7c6ea9ec329182df96e2b1f Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Sat, 23 Jun 2018 19:25:38 +0200 Subject: Fixed linux terminal support and changed some symbols --- vimrc-full | 75 +++++++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 50 insertions(+), 25 deletions(-) diff --git a/vimrc-full b/vimrc-full index 6e29373..e334071 100644 --- a/vimrc-full +++ b/vimrc-full @@ -46,11 +46,18 @@ if has("multi_byte") set encoding=utf-8 | " we need default UTF-8 encoding to use cool chars as line break and so on (see below) let &termencoding=&encoding | " once we use special chars we assume everybody uses a terminal supporting those + set fillchars= | " initialize empty fillchars + set listchars= | " initialize empty listchars + + if &term == "linux" + set fillchars+=vert:\│ | " cool vertical split char + else + set fillchars+=vert:\║ | " cool vertical split char + endif + set fillchars+=fold:\ | " - set fillchars+=vert:\║ | " cool vertical split char set fillchars+=diff:\ | " a white space gets used here - set listchars= | " initialize empty listchars set listchars+=extends:» | " symbols used when using :set list (which displays non-printable chars) set listchars+=precedes:« | " symbols used when using :set list (which displays non-printable chars) @@ -1032,8 +1039,6 @@ endfunction autocmd! ColorScheme * call ExtendColorTheme() -set termguicolors | " When on, uses highlight-guifg and highlight-guibg attributes in the terminal (=24bit color) incompatible with nvim -" set t_ut= " ====================================================================================================================== " CONVENIENCE: @@ -1126,7 +1131,7 @@ augroup status if(exists('w:color') && w:color == '') let w:color = 'NONE' endif - exec 'highlight '.retval.' gui=NONE guifg='.w:color + silent! exec 'highlight '.retval.' gui=NONE guifg='.w:color.' cterm=NONE ctermfg='.w:color return l:retval endfunction @@ -1152,30 +1157,31 @@ augroup status \ ."%#StatusLineHighlight#" \ ."%#".a:highlight_group."#" \ ."%(%w%h%q\ %{ModeString()}%)" - \ ."%-2{nr2char(0xe621)}" - \ ."%{(argc()>0\ ?\ argidx()+1.':'.argc().' '.nr2char(0xe621).' '\ :\ '')}" - \ ."%{winbufnr(0).' '.nr2char(0xe621)}" + \ .g:status_sym_sep_start.' ' + \ ."%{(argc()>0\ ?\ argidx()+1.':'.argc().' '.g:status_sym_sep_start.' '\ :\ '')}" + \ ."%{winbufnr(0).' '.g:status_sym_sep_start}" \ ."%{(&readonly\ ?\ '\ \ \ '\ :\ '')}" \ ."%{(&modified\ ?\ nr2char(0xF0C7).'\ '\ :\ '')\ }" - \ ."%{(haslocaldir() ?\ fnamemodify(getcwd(),\ ':.').' '.nr2char(0xe0b1)\ \:\ '')}\ " + \ ."%{(haslocaldir() ?\ ' '.fnamemodify(getcwd(),\ ':.').' '.nr2char(0xe0b1)\ \:\ '')}\ " \ ."%{(&buftype\ ==\ \"terminal\"\ ?\ b:term_title\ :\ substitute(expand('%:p'),\ '^'.getcwd(-1).'/*',\ '',\ ''))\ }" + \ ."%1(%)" \ ."%#".l:invert_group."#" - \ ."%{nr2char(0xE0B4)\ }" + \ .g:status_sym_end \ .'' \ ."%=" \ .'' \ ."%#".l:invert_group."#" - \ ."%{nr2char(0xE0B6)}" + \ .g:status_sym_start \ ."%#".a:highlight_group."#" \ ."%1(%)" \ ."%{(&filetype\ !=\ ''\ ?\ &filetype\ :\ &buftype)}" - \ ."%(\ %{nr2char(0xe621)}\ %)" - \ ."%{(&spell\ ?\ &spelllang.' '.nr2char(0xe621)\ :\ '')}" - \ ."%{(&fileencoding\ !=\ ''\ ?\ &fileencoding.' '.nr2char(0xe621)\ :\ '')}" - \ ."%{(&fileformat\ !=\ ''\ ?\ &fileformat\ :\ '')}" - \ ."%(\ %{nr2char(0xe621)}\ %)" + \ ."%(\ %{g:status_sym_sep_end}\ %)" + \ ."%{(&spell\ ?\ &spelllang.' '.g:status_sym_sep_end\ :\ '')}" + \ ."%{(&fileencoding\ !=\ ''\ ?\ &fileencoding.' '.g:status_sym_sep_end.' '\ :\ '')}" + \ ."%{(&fileformat\ !=\ ''\ ?\ ' '.&fileformat.' '\ :\ '')}" + \ .g:status_sym_sep_end.' ' \ ."%4l:%-3c" - \ ."%(\ %{nr2char(0xe621)}\ %)" + \ .g:status_sym_sep_end.' ' \ ."%-3p%%" endfunction @@ -1185,29 +1191,48 @@ augroup status \ ."%#".a:highlight_group."#" \ ."%3( \ %)" \ ."%{getcwd(-1)}" - \ ."%{nr2char(0xe621)}" - \ ."%(\ \ %{fugitive#head()}\ %)" + \ .g:status_sym_sep_start.' ' + \ ."%(\ ".g:symbol_branch."\ %{fugitive#head()}\ %)" \ ."%#".l:invert_group."#" - \ ."%{nr2char(0xE0B4)\ }" + \ .g:status_sym_end \ .'' \ ."%=" \ .'' \ ."%#".l:invert_group."#" - \ ."%{nr2char(0xE0B6)}" + \ .g:status_sym_start \ ."%#".a:highlight_group."#" \ ."%3(\ %)" \ ."%(%{v:servername}\ %{v:this_session}%)" - \ ."%{nr2char(0xe621)}" + \ .g:status_sym_sep_end.' ' \ ."%(\ \ %{tabpagenr()}/%{tabpagenr('$')}\ %)" \ ."%##" \ ."" " end endfunction - let g:group_active = "StatusLine" - let g:group_inactive = "StatusLineNC" - let g:group_tabline = "TabLine" + let g:symbol_branch = '' + let g:status_sym_start = '' + let g:status_sym_end = '' + let g:status_sym_sep_start = '' + let g:status_sym_sep_end = '' + + if &term == "linux" + let g:group_active = "StatusLineTerm" + let g:group_inactive = "StatusLineTermNC" + let g:group_tabline = "StatusLineTerm" + else + let g:symbol_branch = '' + + let g:group_active = "StatusLine" + let g:group_inactive = "StatusLineNC" + let g:group_tabline = "TabLine" + endif + function ApplyColorScheme() + " set termguicolors | " When on, uses highlight-guifg and highlight-guibg attributes in the terminal (=24bit color) incompatible with nvim + " set t_ut= + " + " " set up statusline, global and current window individually set statusline=%!UpdateStatus(g:group_inactive) setlocal statusline=%!UpdateStatus(g:group_active) -- cgit v1.2.3