From 2d99b2952df8f2b009e86b851627a3502ce78f62 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Sun, 13 May 2018 22:55:11 +0200 Subject: A little bit refactoring, switched Papercolor theme to light --- vimrc-full | 202 ++++++++++++++++++++++--------------------------------------- 1 file changed, 73 insertions(+), 129 deletions(-) diff --git a/vimrc-full b/vimrc-full index a4fb101..83b5c81 100644 --- a/vimrc-full +++ b/vimrc-full @@ -740,81 +740,6 @@ let g:tagbar_foldlevel = 99 nnoremap :TagbarToggle| " bind TagBar to hotkey F9 - -" LIGHTLINE: a fancy status line ======================================================================================= -" -set noshowmode | " mode will be shown twice, in lightline and below, so we want to deactivate one -set laststatus=2 | " required by AirLine and Lightline, without status line does not appear until a window split - -" Plug 'itchyny/lightline.vim' - -" lightline-buffer ui settings -" replace these symbols with ASCII characters if your environment does not support unicode -let g:lightline_buffer_logo = '' -let g:lightline_buffer_readonly_icon = '' -let g:lightline_buffer_modified_icon = '✭' -let g:lightline_buffer_git_icon = ' ' -let g:lightline_buffer_ellipsis_icon = '..' -let g:lightline_buffer_active_buffer_left_icon = ' ' -let g:lightline_buffer_active_buffer_right_icon = '' -" let g:lightline_buffer_separator_icon = 'XX' - -" lightline-buffer function settings -let g:lightline_buffer_show_bufnr = 0 -let g:lightline_buffer_rotate = 0 -let g:lightline_buffer_fname_mod = ':t' -let g:lightline_buffer_excludes = ['vimfiler'] -let g:lightline_buffer_maxflen = 30 -let g:lightline_buffer_maxfextlen = 3 -let g:lightline_buffer_minflen = 16 -let g:lightline_buffer_minfextlen = 3 -let g:lightline_buffer_reservelen = 20 - -" \ ['warnings', 'errors', 'syntastic'] -" \ 'left': [ [ 'bufferinfo' ], [ 'bufferbefore', 'buffercurrent', 'bufferafter' ], ], -let g:lightline = { - \ 'tabline': { - \ 'left': [ [ 'servername', 'sessionname' ] ], - \ 'right': [ [], ['gitbranch', 'tabnumber'] ], - \ }, - \ 'colorscheme': 'Tomorrow_Night', - \ 'separator': { 'left': "\uE0B4", 'right': "\uE0B6" }, - \ 'subseparator': { 'left': "\uE0b1", 'right': "\uE0b3" }, - \ 'inactive': { - \ 'left': [ [ 'pwd', 'relativepath'] ], - \ 'right': [] - \ }, - \ 'active': { - \ 'left': [ [ 'mode', 'register', 'paste' ], [ 'pwd', 'relativepath' ] , ['tagbar']], - \ 'right': [ [ 'lineinfo', 'percent' ], [ 'filetype', 'readonly', 'spell', 'fileencoding', 'fileformat' ] ] - \ }, - \ 'component': { - \ 'tagbar': '%{substitute(tagbar#currenttag("%s", "", "fs"), "\(.*\)", "", "")}', - \ 'ycmparent': '%{substitute(execute("YcmComplete GetParent"), "\(.*\)", "", "")}', - \ 'filename': '%t', - \ 'buffer_alt': '%{expand("#:t")}', - \ 'servername': ' %{v:servername}', - \ 'sessionname': '%{v:this_session}', - \ 'gitbranch': ' %{fugitive#head()}', - \ 'tabnumber': " %{tabpagenr()}/%{tabpagenr('$')}", - \ 'readonly': '%{&readonly ? "" : ""}', - \ 'register': '%{v:register}', - \ 'title': '%{getwinvar(0, "quickfix_title")}', - \ 'pwd': '%{fnamemodify(getcwd(), ":~")}', - \ 'relativepath': '%{fnamemodify(expand("%"), ":.")}' - \ }, - \ 'component_expand': { - \ 'buffercurrent': 'lightline#buffer#buffercurrent2', - \ 'syntastic': 'SyntasticStatuslineFlag', - \ }, - \ 'component_function': { - \ 'bufferinfo': 'lightline#buffer#bufferinfo', - \ 'warnings': 'youcompleteme#GetWarningCount', - \ 'errors': 'youcompleteme#GetErrorCount', - \ }, - \ } - - " Autocompleter: ===================================== if has("python") @@ -824,7 +749,7 @@ if has("python") " let g:UltiSnipsExpandTrigger = ''| " expands the snippet, be careful not to use elsewhere (ycm uses it by default, but it has been deactivated by g:ycm_key_list_select_completion) let g:UltiSnipsExpandTrigger = ''| " expands the snippet, be careful not to use elsewhere (ycm uses it by default, but it has been deactivated by g:ycm_key_list_select_completion) - let g:UltiSnipsJumpForwardTrigger = ''| + let g:UltiSnipsJumpForwardTrigger = ''| let g:UltiSnipsJumpBackwardTrigger = ''| "d let g:UltiSnipsJumpForwardTrigger = '' " let g:UltiSnipsJumpBackwardTrigger = '' @@ -1046,9 +971,9 @@ function! ExtendColorTheme() highlight! SpecialKey ctermfg=19 highlight! WhiteSpace ctermfg=19 - highlight! link TabLine LineNr - highlight! TabLineSel ctermbg=blue ctermfg=black - highlight! link TabLineFill LineNr + " highlight! link TabLine LineNr + " highlight! TabLineSel ctermbg=blue ctermfg=black + " highlight! link TabLineFill LineNr highlight! Search ctermbg=LightYellow ctermfg=black guibg=#fefd86 guifg=#222222 highlight! link WildMenu Search @@ -1161,15 +1086,19 @@ else let g:PaperColor_Theme_Options = { \ 'theme': { \ 'default': { - \ 'transparent_background': 1 + \ 'transparent_background': 0 \ } \ } \ } - set background=dark + set background=light colorscheme PaperColor endif + augroup status + set noshowmode | " mode will be shown twice, in lightline and below, so we want to deactivate one + set laststatus=2 | " required by AirLine and Lightline, without status line does not appear until a window split + function! CreateInvertGroup(highlight_group) if(synIDattr(hlID(a:highlight_group), "reverse")==1) let w:color=synIDattr(hlID(a:highlight_group), "fg#") @@ -1185,63 +1114,78 @@ augroup status return l:retval endfunction + function ModeString() + return get({ + \ 'n' : 'normal', + \ 'i' : 'insert', + \ 'R' : 'replace', + \ 'v' : 'visual', + \ "V" : 'visual line', + \ "\" : 'visual block', + \ 'c' : 'command', + \ 's' : 'select', + \ 'S' : 'select line', + \ "\" : 'select block', + \ 't' : 'terminal' + \ }, mode(), mode()) + endfunction + function! UpdateStatus(highlight_group) let l:invert_group = CreateInvertGroup(a:highlight_group) - return - \ "%#StatusLineHighlight#" . - \ "%#".a:highlight_group."#" . - \ "%{(&readonly\ ?\ '\ \ \ '\ :\ '')}" . - \ "%{(&modified\ ?\ nr2char(0xF0C7).'\ '\ :\ '')}" . - \ "%(%w%h%q\ %-8{mode(1)}%)" . - \ "%{nr2char(0xe621)}" . - \ "%(\ %{fnamemodify(getcwd(),\ ':~')}\ %)" . - \ "%{nr2char(0xf44a)}" . - \ "%(\ %f\ %)" . - \ "%#".l:invert_group."#" . - \ "%{nr2char(0xE0B4)\ }" . - \ '' . - \ "%=" . - \ '' . - \ "%#".l:invert_group."#" . - \ "%{nr2char(0xE0B6)}" . - \ "%#".a:highlight_group."#" . - \ "%1(%)" . - \ "%{\ &filetype}" . - \ "%(\ %{nr2char(0xe621)}\ %)" . - \ "%{&fileencoding}" . - \ "%(\ %{nr2char(0xe621)}\ %)" . - \ "%{&fileformat}" . - \ "%(\ %{nr2char(0xe621)}\ %)" . - \ "%4l:%-4c" . - \ "%-3p%%" . - \ '' " end ^ + return '' + \ ."%#StatusLineHighlight#" + \ ."%#".a:highlight_group."#" + \ ."%(%w%h%q\ %{ModeString()}%)" + \ ."%-2{nr2char(0xe621)}" + \ ."%{(&readonly\ ?\ '\ \ \ '\ :\ '')}" + \ ."%{(&modified\ ?\ nr2char(0xF0C7).'\ '\ :\ '')}" + \ ."%(\ %{fnamemodify(getcwd(),\ ':~')}\ %)" + \ ."%{nr2char(0xf44a)}" + \ ."%(\ %f\ %)" + \ ."%#".l:invert_group."#" + \ ."%{nr2char(0xE0B4)\ }" + \ .'' + \ ."%=" + \ .'' + \ ."%#".l:invert_group."#" + \ ."%{nr2char(0xE0B6)}" + \ ."%#".a:highlight_group."#" + \ ."%1(%)" + \ ."%{\ &filetype}" + \ ."%(\ %{nr2char(0xe621)}\ %)" + \ ."%{&fileencoding}" + \ ."%(\ %{nr2char(0xe621)}\ %)" + \ ."%{&fileformat}" + \ ."%(\ %{nr2char(0xe621)}\ %)" + \ ."%4l:%-4c" + \ ."%-3p%%" endfunction function! UpdateTabline(highlight_group) let l:invert_group = CreateInvertGroup(a:highlight_group) - return - \ "%#".a:highlight_group."#" . - \ "%3(\ %)" . - \ "%{nr2char(0xe621)}" . - \ "%(%{v:servername}\ %{v:this_session}%)" . - \ "%#".l:invert_group."#" . - \ "%{nr2char(0xE0B4)\ }" . - \ '' . - \ "%=" . - \ '' . - \ "%#".l:invert_group."#" . - \ "%{nr2char(0xE0B6)}" . - \ "%#".a:highlight_group."#" . - \ "%(\ \ %{fugitive#head()}\ %)" . - \ "%{nr2char(0xe621)}" . - \ "%(\ \ %{tabpagenr()}/%{tabpagenr('$')}\ %)" . - \ "%##" . - \ "" " end ^ + return '' + \ ."%#".a:highlight_group."#" + \ ."%3(\ %)" + \ ."%{nr2char(0xe621)}" + \ ."%(%{v:servername}\ %{v:this_session}%)" + \ ."%#".l:invert_group."#" + \ ."%{nr2char(0xE0B4)\ }" + \ .'' + \ ."%=" + \ .'' + \ ."%#".l:invert_group."#" + \ ."%{nr2char(0xE0B6)}" + \ ."%#".a:highlight_group."#" + \ ."%(\ \ %{fugitive#head()}\ %)" + \ ."%{nr2char(0xe621)}" + \ ."%(\ \ %{tabpagenr()}/%{tabpagenr('$')}\ %)" + \ ."%##" + \ ."" " end endfunction - let g:group_active = "StatusLine" + let g:group_active = "StatusLine" let g:group_inactive = "StatusLineNC" - let g:group_tabline = "TabLineSel" + let g:group_tabline = "TabLine" function ApplyColorScheme() " set up statusline, global and current window individually -- cgit v1.2.3