mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-04-15 08:09:11 +08:00
feat(windisk): add windisk_encoding
option
This commit is contained in:
parent
52c76a1147
commit
fcb9f0785a
@ -110,6 +110,15 @@ let g:spacevim_enable_bepo_layout = 0
|
||||
" <
|
||||
let g:spacevim_max_column = 120
|
||||
|
||||
""
|
||||
" @section windisk_encoding, options-windisk_encoding
|
||||
" @parentsection options
|
||||
" Setting the encoding of windisk info. by default it is `cp936`.
|
||||
" >
|
||||
" windisk_encoding = 'cp936'
|
||||
" <
|
||||
|
||||
let g:spacevim_windisk_encoding = 'cp936'
|
||||
|
||||
""
|
||||
" @section default_custom_leader, options-default_custom_leader
|
||||
|
@ -32,10 +32,22 @@ func! SpaceVim#plugins#windisk#open() abort
|
||||
endf
|
||||
|
||||
function! s:diskinfo() abort
|
||||
let dickinfo = systemlist('wmic LOGICALDISK LIST BRIEF')[1:]
|
||||
if !executable('wmic')
|
||||
call s:LOGGER.warn('windisk requires wmic.exe!')
|
||||
return []
|
||||
endif
|
||||
let rst = systemlist('wmic LOGICALDISK LIST BRIEF')
|
||||
if !empty(rst)
|
||||
let diskinfo = rst[1:]
|
||||
else
|
||||
let diskinfo = []
|
||||
endif
|
||||
let rst = []
|
||||
for line in dickinfo
|
||||
let info = split(s:ICONV.iconv(line, 'cp936', &enc))
|
||||
call s:LOGGER.debug('start to parse diskinfo!')
|
||||
for line in diskinfo
|
||||
call s:LOGGER.debug(line)
|
||||
let info = split(s:ICONV.iconv(line, g:spacevim_windisk_encoding, &enc))
|
||||
call s:LOGGER.debug('iconv ' . g:spacevim_windisk_encoding . ' result:' . string(info))
|
||||
if len(info) >= 4
|
||||
let diskid = info[0]
|
||||
let freespace = info[2]
|
||||
|
@ -77,9 +77,10 @@ CONTENTS *SpaceVim-contents*
|
||||
57. vim_help_language...............|SpaceVim-options-vim_help_language|
|
||||
58. vimcompatible.......................|SpaceVim-options-vimcompatible|
|
||||
59. warning_symbol.....................|SpaceVim-options-warning_symbol|
|
||||
60. windows_index_type.............|SpaceVim-options-windows_index_type|
|
||||
61. windows_leader.....................|SpaceVim-options-windows_leader|
|
||||
62. windows_smartclose.............|SpaceVim-options-windows_smartclose|
|
||||
60. windisk_encoding.................|SpaceVim-options-windisk_encoding|
|
||||
61. windows_index_type.............|SpaceVim-options-windows_index_type|
|
||||
62. windows_leader.....................|SpaceVim-options-windows_leader|
|
||||
63. windows_smartclose.............|SpaceVim-options-windows_smartclose|
|
||||
3. Configuration...........................................|SpaceVim-config|
|
||||
4. Commands..............................................|SpaceVim-commands|
|
||||
5. Functions............................................|SpaceVim-functions|
|
||||
@ -811,6 +812,14 @@ Set the warning symbol for SpaceVim's syntax maker. Default is '⚠'.
|
||||
warning_symbol = '!'
|
||||
<
|
||||
|
||||
==============================================================================
|
||||
WINDISK_ENCODING *SpaceVim-options-windisk_encoding*
|
||||
|
||||
Setting the encoding of windisk info. by default it is `cp936`.
|
||||
>
|
||||
windisk_encoding = 'cp936'
|
||||
<
|
||||
|
||||
==============================================================================
|
||||
WINDOWS_INDEX_TYPE *SpaceVim-options-windows_index_type*
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user