tabline update

This commit is contained in:
ManjaroOne666 2018-11-01 09:56:40 +00:00
parent 96a32337b1
commit fad2cc602b
1 changed files with 50 additions and 43 deletions

93
vimrc
View File

@ -454,6 +454,19 @@ let g:instant_markdown_open_to_the_world = 1
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" #functions {{{ " #functions {{{
function! DoInsertEnter() "{{{
" call SetColor('LineNr', '#262626', '', '#cccccc', '', '')
" call SetColor('CursorLineNr', '#bcbcbc', '', '#999999', '', 'bold')
endfunction
"}}}
function! DoInsertLeave() "{{{
" call SetColor('LineNr', '#3a3a3a', '', '#999999', '', '')
" call SetColor('CursorLineNr', '#767676', '', '#777777', '', 'bold')
endfunction
"}}}
function! SetColor(name, fg, bg, fg_l, bg_l, style) abort"{{{ function! SetColor(name, fg, bg, fg_l, bg_l, style) abort"{{{
if &background ==? 'dark' if &background ==? 'dark'
@ -825,14 +838,15 @@ function! SaveAndExecute(ex_command) abort "{{{
endfunction endfunction
"}}} "}}}
function! JsIncludeExpr(file) function! JsIncludeExpr(file)"{{{
" substitute(substitute(v:fname,'^[\\~@]\/','./',''),'^[\\~@]','./node_modules/','') " substitute(substitute(v:fname,'^[\\~@]\/','./',''),'^[\\~@]','./node_modules/','')
echom v:fname echom v:fname
return substitute(substitute(a:file,'^[\\~@]\/','./',''),'^[\\~@]','./node_modules/','') return substitute(substitute(a:file,'^[\\~@]\/','./',''),'^[\\~@]','./node_modules/','')
endfunction endfunction"}}}
"}}} "}}}
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
@ -847,7 +861,8 @@ endif
syntax on syntax on
set background=light set background=light
set fillchars=stl:\ ,stlnc:\ ,vert:\| " set fillchars=stl:\ ,stlnc:\ ,vert:│
set fillchars=stl:\ ,stlnc:\ ,vert:┃
colorscheme monotonous2 colorscheme monotonous2
set guioptions-=mTrLb set guioptions-=mTrLb
@ -919,7 +934,9 @@ set textwidth=180
set formatoptions=cq set formatoptions=cq
set wrapmargin=0 set wrapmargin=0
set foldcolumn=1 set cursorline
set foldcolumn=2
set signcolumn=yes set signcolumn=yes
set colorcolumn=80,120 set colorcolumn=80,120
@ -1134,14 +1151,23 @@ augroup linenumbering
augroup END augroup END
"}}} "}}}
" colorcolumns {{{ " WinEnter, WinLeave {{{
augroup colorcolumns augroup windowenteringleaving
autocmd! autocmd!
autocmd WinEnter * call SetColorColumn() autocmd WinEnter * call SetColorColumn()
autocmd WinEnter * set cursorline
autocmd WinLeave * setlocal colorcolumn=0 autocmd WinLeave * setlocal colorcolumn=0
autocmd WinLeave * set nocursorline
augroup END augroup END
"}}} "}}}
" InsertEnter, InsertLeave {{{
augroup insertenterleave
au!
au InsertEnter * call DoInsertEnter()
au InsertLeave * call DoInsertLeave()
augroup END
" Automatically reload .vimrc if chanaged {{{ " Automatically reload .vimrc if chanaged {{{
augroup myvimrc augroup myvimrc
autocmd! autocmd!
@ -1160,7 +1186,7 @@ augroup END
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" #statusline {{{ " #statusline {{{
set statusline=%!GetStatus(1) " set statusline=%!GetStatus(1)
function! GetStatus(isactive) abort "{{{ function! GetStatus(isactive) abort "{{{
" let l:linter = ale#statusline#Count(bufnr('')) " let l:linter = ale#statusline#Count(bufnr(''))
@ -1310,35 +1336,16 @@ function! GetStatus(isactive) abort "{{{
endfunction endfunction
"}}} "}}}
function! DoInsertEnter() "{{{ "augroup status "{{{
set cursorline " autocmd!
call SetColor('LineNr', '#262626', '', '#cccccc', '', '') " autocmd WinNew,WinEnter * setlocal statusline=%!GetStatus(1)
call SetColor('CursorLineNr', '#bcbcbc', '', '#999999', '', 'bold') " autocmd WinLeave * setlocal statusline=%!GetStatus(0)
endfunction " " autocmd WinNew * setlocal statusline=%!GetStatus(1)
" " autocmd InsertChange * setlocal statusline=%!GetStatus(1)
"augroup END
""}}}
"}}} "}}}
function! DoInsertLeave() "{{{
set nocursorline
call SetColor('LineNr', '#3a3a3a', '', '#999999', '', '')
call SetColor('CursorLineNr', '#767676', '', '#777777', '', 'bold')
endfunction
"}}}
augroup status "{{{
autocmd!
autocmd WinNew,WinEnter * setlocal statusline=%!GetStatus(1)
autocmd WinLeave * setlocal statusline=%!GetStatus(0)
" autocmd WinNew * setlocal statusline=%!GetStatus(1)
" autocmd InsertChange * setlocal statusline=%!GetStatus(1)
augroup END
"}}}
augroup statuscursorlines "{{{
au!
au InsertEnter * call DoInsertEnter()
au InsertLeave * call DoInsertLeave()
augroup END
"}}}
"}}} "}}}
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
@ -1363,9 +1370,8 @@ if exists('+showtabline')
let l:customtabline .= '%' . l:tabnumber . 'T' let l:customtabline .= '%' . l:tabnumber . 'T'
let l:customtabline .= (l:tabnumber == l:currenttabnum ? '%1*' : '%2*') let l:customtabline .= (l:tabnumber == l:currenttabnum ? '%1*' : '%2*')
let l:customtabline .= (l:tabnumber == l:currenttabnum ? '%#TabNumSel#' : '%#TabNum#') let l:customtabline .= (l:tabnumber == l:currenttabnum ? '%#TabLineNumSel#' : '%#TabLineNum#')
let l:customtabline .= ' ' . l:tabnumber let l:customtabline .= ' ' . l:tabnumber . ' '
let l:customtabline .= '%#TabSeparator#:'
let l:customtabline .= (l:tabnumber == l:currenttabnum ? '%#TabLineItemSel#' : '%#TabLineItem#') let l:customtabline .= (l:tabnumber == l:currenttabnum ? '%#TabLineItemSel#' : '%#TabLineItem#')
endif endif
@ -1393,18 +1399,14 @@ if exists('+showtabline')
let l:file = "''" let l:file = "''"
endif endif
let l:customtabline .= l:file . ' %#TabLineNoise# ' let l:customtabline .= l:file . ' '
let l:tabnumber = l:tabnumber + 1 let l:tabnumber = l:tabnumber + 1
endwhile endwhile
let l:customtabline .= '%T%#TabLineFill#%=' let l:customtabline .= '%T%#TabLineFill#%='
let l:customtabline .= '%#TabLineItemSel# %{fugitive#statusline()}%#TabSeparator# ' let l:customtabline .= '%#TabLineItemSel# %{fugitive#statusline()}% '
let l:customtabline .= '%#TabLineNoise# '
let l:customtabline .= '%#TabLineNoise# '
" let l:customtabline .= '%#TabSeparator# "%#TabLineItemSel#%{v:register}%#TabSeparator#" '
" let l:customtabline .= '%#TabLineNoise# '
let l:customtabline .= "%#TabLineItemSel# %{ObsessionStatus(fnamemodify(v:this_session,':t'),'---')} %*" let l:customtabline .= "%#TabLineItemSel# %{ObsessionStatus(fnamemodify(v:this_session,':t'),'---')} %*"
return l:customtabline return l:customtabline
@ -1415,6 +1417,11 @@ if exists('+showtabline')
set showtabline=2 set showtabline=2
set tabline=%!MyTabLine() set tabline=%!MyTabLine()
hi def link TabLineItem TabLine
hi def link TabLineItemSel TabLineSel
hi def link TabLineNum TabLine
hi def link TabLineNumSel TabLineSel
endif " exists("+showtabline") endif " exists("+showtabline")
"}}} "}}}