pedantics in the neovim fold text
This commit is contained in:
parent
3c4d334a7e
commit
455fc99aa7
|
@ -24,7 +24,7 @@ filetype plugin on
|
||||||
set number
|
set number
|
||||||
|
|
||||||
"makes the ruler show how many lines away a given line is from your cursor
|
"makes the ruler show how many lines away a given line is from your cursor
|
||||||
"set relativenumber
|
set relativenumber
|
||||||
|
|
||||||
"displays the coordinates of your cursour in the statusbar
|
"displays the coordinates of your cursour in the statusbar
|
||||||
set ruler
|
set ruler
|
||||||
|
@ -87,7 +87,7 @@ filetype plugin on
|
||||||
|
|
||||||
"folding stuff TODO: implement other folding methods.
|
"folding stuff TODO: implement other folding methods.
|
||||||
"give a bit of margin space for fold number
|
"give a bit of margin space for fold number
|
||||||
set foldcolumn=3
|
set foldcolumn=4
|
||||||
|
|
||||||
set foldenable
|
set foldenable
|
||||||
|
|
||||||
|
@ -105,14 +105,14 @@ filetype plugin on
|
||||||
"make sure that comment are counted in indent folding!
|
"make sure that comment are counted in indent folding!
|
||||||
set foldignore=
|
set foldignore=
|
||||||
set fillchars="fold:-"
|
set fillchars="fold:-"
|
||||||
"set the fold text for this method, in most cases, the line just above our fold is what we want, so we wont put any text into it. just level and linecount. TODO
|
"set the fold text for this method, in most cases, the line just above our fold is what we want, so we wont put any text into it. just level and linecount.
|
||||||
function! Minimal_foldtext()
|
function! Minimal_foldtext()
|
||||||
let lines_count = v:foldend - v:foldstart
|
let lines_count = v:foldend - v:foldstart
|
||||||
let lines_count_text = '+' . v:folddashes . '| ' . printf("%10S" , lines_count) . ' lines |'
|
let lines_count_text = '+' . v:folddashes . '| ' . printf("%10S" , lines_count) . ' lines |'
|
||||||
let line_level_text = '| ' . printf("%5S" , 'level ' . v:foldlevel) . ' |'
|
let line_level_text = '| ' . printf("%8S" , 'level ' . v:foldlevel) . ' |'
|
||||||
let fold_text_end = line_level_text . repeat('-',8)
|
let fold_text_end = line_level_text . repeat('-',8)
|
||||||
let fold_text_length = strlen(lines_count_text . fold_text_end) + &foldcolumn
|
let fold_text_length = strlen(lines_count_text . fold_text_end) + &foldcolumn
|
||||||
return lines_count_text . repeat('-' , winwidth(0) - fold_text_length) . fold_text_end
|
return lines_count_text . repeat('-' , winwidth(0) - fold_text_length - 4) . fold_text_end
|
||||||
endfunction
|
endfunction
|
||||||
set foldtext=Minimal_foldtext()
|
set foldtext=Minimal_foldtext()
|
||||||
endif
|
endif
|
||||||
|
|
Loading…
Reference in a new issue