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:
parent
3f37136e44
commit
fc66298acd
21
autoload/SpaceVim/api/messletters.vim
Normal file
21
autoload/SpaceVim/api/messletters.vim
Normal 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
|
||||||
|
|
@ -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
|
@ -1 +1 @@
|
|||||||
let g:gruvbox_italic = 1
|
let g:gruvbox_italic = 0
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user