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

Add box api

This commit is contained in:
wsdjeg 2017-02-27 23:40:55 +08:00
parent 7684509eeb
commit 74ac6ab4b6
2 changed files with 61 additions and 18 deletions

View File

@ -0,0 +1,45 @@
let s:box = {}
scriptencoding utf-8
" http://jrgraphix.net/r/Unicode/2500-257F
" json should be a list of items which have same keys
function! s:drawing_table(json) abort
if empty(a:json)
return []
endif
if &encoding ==# 'utf-8'
let top_left_corner = '╭'
let top_right_corner = '╮'
let bottom_left_corner = '╰'
let bottom_right_corner = '╯'
let side = '│'
let top_bottom_side = '─'
let middle = '┼'
let top_middle = '┬'
let left_middle = '├'
let right_middle = '┤'
let bottom_middle = '┴'
else
let top_left_corner = '*'
let top_right_corner = '*'
let bottom_left_corner = '*'
let bottom_right_corner = '*'
let side = '|'
let top_bottom_side = '-'
let middle = '*'
let top_middle = '*'
let left_middle = '*'
let right_middle = '*'
let bottom_middle = '*'
endif
let table = []
let col = len(keys(a:json[0]))
endfunction
function! SpaceVim#api#file#get() abort
return deepcopy(s:box)
endfunction

View File

@ -22,38 +22,36 @@ let $NVIM_TUI_ENABLE_CURSOR_SHAPE=2
"silent! let &t_SR = "\<Esc>]50;CursorShape=2\x7"
"silent! let &t_EI = "\<Esc>]50;CursorShape=0\x7"
" dark0 + gray
let g:terminal_color_0 = "#282828"
let g:terminal_color_8 = "#928374"
let g:terminal_color_0 = '#282828'
let g:terminal_color_8 = '#928374'
" neurtral_red + bright_red
let g:terminal_color_1 = "#cc241d"
let g:terminal_color_9 = "#fb4934"
let g:terminal_color_1 = '#cc241d'
let g:terminal_color_9 = '#fb4934'
" neutral_green + bright_green
let g:terminal_color_2 = "#98971a"
let g:terminal_color_10 = "#b8bb26"
let g:terminal_color_2 = '#98971a'
let g:terminal_color_10 = '#b8bb26'
" neutral_yellow + bright_yellow
let g:terminal_color_3 = "#d79921"
let g:terminal_color_11 = "#fabd2f"
let g:terminal_color_3 = '#d79921'
let g:terminal_color_11 = '#fabd2f'
" neutral_blue + bright_blue
let g:terminal_color_4 = "#458588"
let g:terminal_color_12 = "#83a598"
let g:terminal_color_4 = '#458588'
let g:terminal_color_12 = '#83a598'
" neutral_purple + bright_purple
let g:terminal_color_5 = "#b16286"
let g:terminal_color_13 = "#d3869b"
let g:terminal_color_5 = '#b16286'
let g:terminal_color_13 = '#d3869b'
" neutral_aqua + faded_aqua
let g:terminal_color_6 = "#689d6a"
let g:terminal_color_14 = "#8ec07c"
let g:terminal_color_6 = '#689d6a'
let g:terminal_color_14 = '#8ec07c'
" light4 + light1
let g:terminal_color_7 = "#a89984"
let g:terminal_color_15 = "#ebdbb2"
nnoremap <nowait> <FocusGained> <Nop>
nnoremap <nowait> <FocusLost> <Nop>
let g:terminal_color_7 = '#a89984'
let g:terminal_color_15 = '#ebdbb2'
augroup Terminal
au!
au TermOpen * let g:last_terminal_job_id = b:terminal_job_id | IndentLinesDisable