1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 13:10:04 +08:00

Add messletters api

This commit is contained in:
wsdjeg 2017-02-26 00:11:08 +08:00
parent 3f37136e44
commit fc66298acd
4 changed files with 34 additions and 3 deletions

View File

@ -0,0 +1,21 @@
scriptencoding utf-8
let s:chars = {}
" type :
" 0: 1 ➛ ➊
" 1: 1 ➛ ➀
" 2: 1 ➛ ⓵
function! s:bubble_num(num, type) abort
let list = []
call add(list,['➊', '➋', '➌', '➍', '➎', '➏', '➐', '➑', '➒', '➓'])
call add(list,['➀', '➁', '➂', '➃', '➄', '➅', '➆', '➇', '➈', '➉'])
call add(list,['⓵', '⓶', '⓷', '⓸', '⓹', '⓺', '⓻', '⓼', '⓽', '⓾'])
return list[a:type][a:num-1]
endfunction
let s:chars['bubble_num'] = function('s:bubble_num')
function! SpaceVim#api#messletters#get() abort
return deepcopy(s:chars)
endfunction

View File

@ -0,0 +1,4 @@
function! airline#extensions#tabline#formatters#spacevim#format(bufnr, buffers)
let id = SpaceVim#api#messletters#get().bubble_num(a:bufnr, 0)
return fnamemodify(bufname(a:bufnr), id . ':t')
endfunction

View File

@ -1 +1 @@
let g:gruvbox_italic = 1 let g:gruvbox_italic = 0

View File

@ -5,8 +5,14 @@ let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tmuxline#enabled = 1 let g:airline#extensions#tmuxline#enabled = 1
let g:Powerline_sybols = 'unicode' let g:Powerline_sybols = 'unicode'
let g:airline#extensions#tabline#buffer_idx_mode = 1 let g:airline#extensions#tabline#buffer_idx_mode = 1
let g:airline#extensions#tabline#buffer_nr_show = 1 let g:airline#extensions#tabline#buffer_idx_format = {}
let g:airline#extensions#tabline#buffer_nr_format = '%s:' for i in range(9)
call extend(g:airline#extensions#tabline#buffer_idx_format, {i : SpaceVim#api#import('messletters').bubble_num(i, 1). ' '})
endfor
unlet i
let g:airline#extensions#tabline#formatter = 'spacevim'
"let g:airline#extensions#tabline#buffer_nr_show = 1
"let g:airline#extensions#tabline#buffer_nr_format = '%s:'
let g:airline#extensions#tabline#fnamemod = ':t' let g:airline#extensions#tabline#fnamemod = ':t'
let g:airline#extensions#tabline#fnamecollapse = 1 let g:airline#extensions#tabline#fnamecollapse = 1
let g:airline#extensions#tabline#fnametruncate = 0 let g:airline#extensions#tabline#fnametruncate = 0