mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-03 00:30:05 +08:00
Enable fileformat icon
This commit is contained in:
parent
d80bdb55e1
commit
da1843fd03
@ -157,6 +157,10 @@ let g:spacevim_enable_cursorline = 1
|
||||
"
|
||||
let g:spacevim_statusline_separator = 'arrow'
|
||||
let g:spacevim_statusline_inactive_separator = 'arrow'
|
||||
|
||||
let g:spacevim_statusline_left_sections = ['winnr', 'filename', 'major mode', 'minor mode lighters', 'version control info']
|
||||
let g:spacevim_statusline_right_sections = ['fileformat', 'cursorpos']
|
||||
|
||||
""
|
||||
" Enable/Disable unicode symbols in statusline
|
||||
let g:spacevim_statusline_unicode_symbols = 1
|
||||
|
@ -15,6 +15,7 @@ let s:TIME = SpaceVim#api#import('time')
|
||||
let s:HI = SpaceVim#api#import('vim#highlight')
|
||||
let s:STATUSLINE = SpaceVim#api#import('vim#statusline')
|
||||
let s:VIMCOMP = SpaceVim#api#import('vim#compatible')
|
||||
let s:SYSTEM = SpaceVim#api#import('system')
|
||||
|
||||
" init
|
||||
let s:separators = {
|
||||
@ -66,6 +67,9 @@ let s:modes = {
|
||||
|
||||
let s:loaded_sections = ['syntax checking', 'major mode', 'minor mode lighters', 'version control info', 'cursorpos']
|
||||
|
||||
let s:loaded_sections_r = g:spacevim_statusline_right_sections
|
||||
let s:loaded_sections_l = g:spacevim_statusline_left_sections
|
||||
|
||||
function! s:battery_status() abort
|
||||
if executable('acpi')
|
||||
return ' ⚡' . substitute(split(system('acpi'))[-1], '%', '%%', 'g') . ' '
|
||||
@ -74,6 +78,16 @@ function! s:battery_status() abort
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
if g:spacevim_statusline_unicode_symbols == 1
|
||||
let g:_spacevim_statusline_fileformat = s:SYSTEM.fileformat()
|
||||
else
|
||||
let g:_spacevim_statusline_fileformat = &ff
|
||||
endif
|
||||
function! s:fileformat() abort
|
||||
return '%{" " . g:_spacevim_statusline_fileformat . " | " . (&fenc!=""?&fenc:&enc) . " "}'
|
||||
endfunction
|
||||
|
||||
function! s:check_mode() abort
|
||||
if mode() == 'n'
|
||||
return 'n'
|
||||
@ -302,7 +316,7 @@ function! s:active() abort
|
||||
if index(s:loaded_sections, 'battery status') != -1
|
||||
call add(rsec, s:battery_status())
|
||||
endif
|
||||
call add(rsec, '%{" " . &ff . " | " . (&fenc!=""?&fenc:&enc) . " "}')
|
||||
call add(rsec, s:fileformat())
|
||||
if index(s:loaded_sections, 'cursorpos') != -1
|
||||
call add(rsec, s:cursorpos())
|
||||
endif
|
||||
|
@ -445,7 +445,7 @@ COMMANDS *SpaceVim-commands*
|
||||
<
|
||||
|
||||
:SPReinstall *:SPReinstall*
|
||||
Command for reinstall plugin, support completion of plugin name.
|
||||
Command for reinstall plugin, support completion of plugin anme.
|
||||
|
||||
:SPInstall *:SPInstall*
|
||||
Command for install plugins.
|
||||
|
Loading…
Reference in New Issue
Block a user