mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-03 02:20:05 +08:00
feat(statusline): add totallines
section
close https://github.com/SpaceVim/SpaceVim/issues/4567
This commit is contained in:
parent
f34717d8ab
commit
e9e849b16c
@ -592,6 +592,24 @@ let g:spacevim_statusline_left_sections = ['winnr', 'filename', 'major mode',
|
|||||||
\ 'search count',
|
\ 'search count',
|
||||||
\ 'syntax checking', 'minor mode lighters',
|
\ 'syntax checking', 'minor mode lighters',
|
||||||
\ ]
|
\ ]
|
||||||
|
""
|
||||||
|
" @section statusline_right_sections, options-statusline_right_sections
|
||||||
|
" @parentsection options
|
||||||
|
" Define the right section of statusline in active windows. By default:
|
||||||
|
" >
|
||||||
|
" statusline_right_sections = [
|
||||||
|
" 'fileformat',
|
||||||
|
" 'cursorpos',
|
||||||
|
" 'percentage'
|
||||||
|
" ]
|
||||||
|
" <
|
||||||
|
"
|
||||||
|
" The following sections can be used in this option:
|
||||||
|
" - fileformat: the format of current file
|
||||||
|
" - cursorpos: the corsur position
|
||||||
|
" - percentage: the percent of current page
|
||||||
|
" - totallines: the total lines of current buffer
|
||||||
|
|
||||||
""
|
""
|
||||||
" Define the right section of statusline in active windows. By default:
|
" Define the right section of statusline in active windows. By default:
|
||||||
" >
|
" >
|
||||||
|
@ -171,6 +171,9 @@ function! s:modes() abort
|
|||||||
return m . ' '
|
return m . ' '
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:totallines() abort
|
||||||
|
return ' %L '
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! s:percentage() abort
|
function! s:percentage() abort
|
||||||
return ' %P '
|
return ' %P '
|
||||||
@ -304,6 +307,7 @@ let s:registed_sections = {
|
|||||||
\ 'minor mode lighters' : function('s:modes'),
|
\ 'minor mode lighters' : function('s:modes'),
|
||||||
\ 'cursorpos' : function('s:cursorpos'),
|
\ 'cursorpos' : function('s:cursorpos'),
|
||||||
\ 'percentage' : function('s:percentage'),
|
\ 'percentage' : function('s:percentage'),
|
||||||
|
\ 'totallines' : function('s:totallines'),
|
||||||
\ 'time' : function('s:time'),
|
\ 'time' : function('s:time'),
|
||||||
\ 'date' : function('s:date'),
|
\ 'date' : function('s:date'),
|
||||||
\ 'whitespace' : function('s:whitespace'),
|
\ 'whitespace' : function('s:whitespace'),
|
||||||
|
@ -71,16 +71,18 @@ CONTENTS *SpaceVim-contents*
|
|||||||
51. snippet_engine.....................|SpaceVim-options-snippet_engine|
|
51. snippet_engine.....................|SpaceVim-options-snippet_engine|
|
||||||
52. statusline_iseparator.......|SpaceVim-options-statusline_iseparator|
|
52. statusline_iseparator.......|SpaceVim-options-statusline_iseparator|
|
||||||
53. statusline_left_sections.|SpaceVim-options-statusline_left_sections|
|
53. statusline_left_sections.|SpaceVim-options-statusline_left_sections|
|
||||||
54. statusline_separator.........|SpaceVim-options-statusline_separator|
|
54. statusline_right_sections
|
||||||
55. statusline_unicode.............|SpaceVim-options-statusline_unicode|
|
..................................|SpaceVim-options-statusline_right_sections|
|
||||||
56. terminal_cursor_shape.......|SpaceVim-options-terminal_cursor_shape|
|
55. statusline_separator.........|SpaceVim-options-statusline_separator|
|
||||||
57. vim_help_language...............|SpaceVim-options-vim_help_language|
|
56. statusline_unicode.............|SpaceVim-options-statusline_unicode|
|
||||||
58. vimcompatible.......................|SpaceVim-options-vimcompatible|
|
57. terminal_cursor_shape.......|SpaceVim-options-terminal_cursor_shape|
|
||||||
59. warning_symbol.....................|SpaceVim-options-warning_symbol|
|
58. vim_help_language...............|SpaceVim-options-vim_help_language|
|
||||||
60. windisk_encoding.................|SpaceVim-options-windisk_encoding|
|
59. vimcompatible.......................|SpaceVim-options-vimcompatible|
|
||||||
61. windows_index_type.............|SpaceVim-options-windows_index_type|
|
60. warning_symbol.....................|SpaceVim-options-warning_symbol|
|
||||||
62. windows_leader.....................|SpaceVim-options-windows_leader|
|
61. windisk_encoding.................|SpaceVim-options-windisk_encoding|
|
||||||
63. windows_smartclose.............|SpaceVim-options-windows_smartclose|
|
62. windows_index_type.............|SpaceVim-options-windows_index_type|
|
||||||
|
63. windows_leader.....................|SpaceVim-options-windows_leader|
|
||||||
|
64. windows_smartclose.............|SpaceVim-options-windows_smartclose|
|
||||||
3. Configuration...........................................|SpaceVim-config|
|
3. Configuration...........................................|SpaceVim-config|
|
||||||
4. Commands..............................................|SpaceVim-commands|
|
4. Commands..............................................|SpaceVim-commands|
|
||||||
5. Public functions.....................................|SpaceVim-functions|
|
5. Public functions.....................................|SpaceVim-functions|
|
||||||
@ -740,6 +742,24 @@ Define the left section of statusline in active windows. By default:
|
|||||||
]
|
]
|
||||||
<
|
<
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
STATUSLINE_RIGHT_SECTIONS *SpaceVim-options-statusline_right_sections*
|
||||||
|
|
||||||
|
Define the right section of statusline in active windows. By default:
|
||||||
|
>
|
||||||
|
statusline_right_sections = [
|
||||||
|
'fileformat',
|
||||||
|
'cursorpos',
|
||||||
|
'percentage'
|
||||||
|
]
|
||||||
|
<
|
||||||
|
|
||||||
|
The following sections can be used in this option:
|
||||||
|
fileformat: the format of current file
|
||||||
|
cursorpos: the corsur position
|
||||||
|
percentage: the percent of current page
|
||||||
|
totallines: the total lines of current buffer
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
STATUSLINE_SEPARATOR *SpaceVim-options-statusline_separator*
|
STATUSLINE_SEPARATOR *SpaceVim-options-statusline_separator*
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user