This commit is contained in:
ManjaroOne666 2018-09-25 15:24:27 +01:00
parent c6df006a61
commit e2b46a793c
1 changed files with 15 additions and 7 deletions

20
vimrc
View File

@ -1,3 +1,4 @@
" #plugins {{{ " #plugins {{{
if empty(glob('~/.vim/autoload/plug.vim')) if empty(glob('~/.vim/autoload/plug.vim'))
@ -149,6 +150,7 @@ runtime macros/matchit.vim
"}}} "}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" #plugin settings {{{ " #plugin settings {{{
@ -510,6 +512,7 @@ let g:instant_markdown_open_to_the_world = 1
"}}} "}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" #functions {{{ " #functions {{{
function! SetColor(name, fg, bg, fg_l, bg_l, style) abort"{{{ function! SetColor(name, fg, bg, fg_l, bg_l, style) abort"{{{
@ -605,25 +608,23 @@ endfunction"}}}
function! MyFoldText() "{{{ function! MyFoldText() "{{{
let l:linecount = v:foldend - v:foldstart - 1 let l:linecount = v:foldend - v:foldstart - 1
let l:line = getline(v:foldstart) let l:line = substitute(getline(v:foldstart), "\{\{\{", "", "")
let l:line = substitute(l:line, "\^\" ", "", "")
let l:postfix = ' +' . l:linecount . ' ' . v:folddashes . '|' let l:postfix = ' +' . l:linecount . ' ' . v:folddashes . '|'
while len(l:postfix) < 11 while len(l:postfix) < 11
let l:postfix = ' ' . l:postfix let l:postfix = ' ' . l:postfix
endwhile endwhile
" unicode characters counted as 2 digits in length - TODO find fix
" checkout strlen
" let l:postfix = ' •••••••••••• +' . l:linecount . ' ' . v:folddashes . '|'
let l:len_line = len(l:line) let l:len_line = len(l:line)
let l:len_postfix = len(l:postfix) let l:len_postfix = len(l:postfix)
" TODO use width of window maybe (i fit's less than 80)
if l:len_line + l:len_postfix <= 80 if l:len_line + l:len_postfix <= 80
let l:padding = ' ' . ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -'[l:len_line + l:len_postfix + 4:79] let l:padding = ' ' . ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -'[l:len_line + l:len_postfix + 4:79]
if l:padding[:-1] !== '-' if l:padding[:-1] !== '-'
let l:padding = ' ' . l:padding [0:-1] let l:padding = ' ' . l:padding [0:-1]
endif endif
let l:padding = substitute(l:padding, "-", "•", "g")
let l:foldtext = l:line . l:padding . l:postfix let l:foldtext = l:line . l:padding . l:postfix
else else
let l:foldtext = l:line[:76 - l:len_postfix] . '...' . l:postfix let l:foldtext = l:line[:76 - l:len_postfix] . '...' . l:postfix
@ -843,6 +844,7 @@ endfunction
"}}} "}}}
"}}} "}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" #settings {{{ " #settings {{{
scriptencoding utf-8 scriptencoding utf-8
@ -950,6 +952,7 @@ set listchars=eol:¬,tab:>-,trail:~,extends:>,precedes:<,space:·
set foldtext=MyFoldText() set foldtext=MyFoldText()
"}}} "}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" #mappings {{{ " #mappings {{{
let g:mapleader = ' ' let g:mapleader = ' '
@ -1060,6 +1063,7 @@ inoremap '; '';<Left><Left>
"}}} "}}}
"}}} "}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" #abbreviations {{{ " #abbreviations {{{
iabbrev adn and iabbrev adn and
@ -1067,6 +1071,7 @@ iabbrev waht what
iabbrev tehn then iabbrev tehn then
"}}} "}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" #autocommands {{{ " #autocommands {{{
@ -1135,6 +1140,7 @@ augroup END
"}}} "}}}
" }}} " }}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" #statusline {{{ " #statusline {{{
set statusline=%!GetStatus(1) set statusline=%!GetStatus(1)
@ -1318,6 +1324,7 @@ augroup END
"}}} "}}}
"}}} "}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" #tabline {{{ " #tabline {{{
if exists('+showtabline') if exists('+showtabline')
@ -1394,6 +1401,7 @@ if exists('+showtabline')
endif " exists("+showtabline") endif " exists("+showtabline")
"}}} "}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" #pymode {{{ " #pymode {{{
let g:pymode = 1 let g:pymode = 1
@ -1418,6 +1426,6 @@ let g:pymode_syntax_highlight_exceptions = 1
let g:pymode_syntax_slow_sync = 1 let g:pymode_syntax_slow_sync = 1
"}}} "}}}
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" vim: foldmethod=marker " vim: foldmethod=marker