mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-03 01:00:05 +08:00
Improve terminal statusline (#2453)
* Improve terminal statusline * Fix rtp * Fix neovim support
This commit is contained in:
parent
01ab9d4805
commit
81e09ceae9
@ -14,7 +14,7 @@ call SpaceVim#custom#SPC('nnoremap', ['a', 'o'], 'call SpaceVim#dev#todo#list()'
|
|||||||
|
|
||||||
" after run make test, the vader will be downloaded to ./build/vader/
|
" after run make test, the vader will be downloaded to ./build/vader/
|
||||||
|
|
||||||
set rtp+=build/vader
|
let &runtimepath .= ',' . fnamemodify(g:_spacevim_root_dir, ':p:h:h') . '/build/vader'
|
||||||
|
|
||||||
" vader language specific key bindings
|
" vader language specific key bindings
|
||||||
|
|
||||||
|
@ -342,6 +342,15 @@ function! SpaceVim#layers#core#statusline#get(...) abort
|
|||||||
\ . s:winnr(1) . '%#SpaceVim_statusline_ia_SpaceVim_statusline_b#'
|
\ . s:winnr(1) . '%#SpaceVim_statusline_ia_SpaceVim_statusline_b#'
|
||||||
\ . s:lsep
|
\ . s:lsep
|
||||||
\ . '%#SpaceVim_statusline_b# Gista %#SpaceVim_statusline_b_SpaceVim_statusline_c#' . s:lsep . ' '
|
\ . '%#SpaceVim_statusline_b# Gista %#SpaceVim_statusline_b_SpaceVim_statusline_c#' . s:lsep . ' '
|
||||||
|
elseif &buftype ==# 'terminal'
|
||||||
|
let st = '%#SpaceVim_statusline_ia#'
|
||||||
|
\ . s:winnr(1) . '%#SpaceVim_statusline_ia_SpaceVim_statusline_b#'
|
||||||
|
\ . s:lsep
|
||||||
|
\ . '%#SpaceVim_statusline_b# Terminal %#SpaceVim_statusline_b_SpaceVim_statusline_c#' . s:lsep
|
||||||
|
if !empty(get(b:, '_spacevim_shell', ''))
|
||||||
|
let st .= '%#SpaceVim_statusline_c# %{b:_spacevim_shell} %#SpaceVim_statusline_c_SpaceVim_statusline_z#' . s:lsep
|
||||||
|
endif
|
||||||
|
return st
|
||||||
elseif &filetype ==# 'gina-status'
|
elseif &filetype ==# 'gina-status'
|
||||||
return '%#SpaceVim_statusline_ia#' . s:winnr(1) . '%#SpaceVim_statusline_ia_SpaceVim_statusline_b#' . s:lsep
|
return '%#SpaceVim_statusline_ia#' . s:winnr(1) . '%#SpaceVim_statusline_ia_SpaceVim_statusline_b#' . s:lsep
|
||||||
\ . '%#SpaceVim_statusline_b# Gina status %#SpaceVim_statusline_b_SpaceVim_statusline_c#' . s:lsep . ' '
|
\ . '%#SpaceVim_statusline_b# Gina status %#SpaceVim_statusline_b_SpaceVim_statusline_c#' . s:lsep . ' '
|
||||||
|
@ -153,6 +153,11 @@ function! s:open_default_shell() abort
|
|||||||
if s:default_shell ==# 'terminal'
|
if s:default_shell ==# 'terminal'
|
||||||
if exists(':terminal')
|
if exists(':terminal')
|
||||||
if has('nvim')
|
if has('nvim')
|
||||||
|
if s:SYSTEM.isWindows
|
||||||
|
let shell = empty($SHELL) ? 'cmd.exe' : $SHELL
|
||||||
|
else
|
||||||
|
let shell = empty($SHELL) ? 'bash' : $SHELL
|
||||||
|
endif
|
||||||
terminal
|
terminal
|
||||||
" @bug cursor is not cleared when open terminal windows.
|
" @bug cursor is not cleared when open terminal windows.
|
||||||
" in neovim-qt when using :terminal to open a shell windows, the orgin
|
" in neovim-qt when using :terminal to open a shell windows, the orgin
|
||||||
@ -175,6 +180,9 @@ function! s:open_default_shell() abort
|
|||||||
endif
|
endif
|
||||||
let s:term_buf_nr = term_start(shell, {'curwin' : 1, 'term_finish' : 'close'})
|
let s:term_buf_nr = term_start(shell, {'curwin' : 1, 'term_finish' : 'close'})
|
||||||
endif
|
endif
|
||||||
|
let b:_spacevim_shell = shell
|
||||||
|
" use WinEnter autocmd to update statusline
|
||||||
|
doautocmd WinEnter
|
||||||
let s:shell_win_nr = winnr()
|
let s:shell_win_nr = winnr()
|
||||||
let w:shell_layer_win = 1
|
let w:shell_layer_win = 1
|
||||||
setlocal nobuflisted nonumber norelativenumber
|
setlocal nobuflisted nonumber norelativenumber
|
||||||
|
@ -1154,12 +1154,12 @@ MAPPINGS
|
|||||||
|
|
||||||
Mode Key Function
|
Mode Key Function
|
||||||
-------------------------------------------------------------
|
-------------------------------------------------------------
|
||||||
normal SPC l m i Run maven clean install
|
normal SPC l m i run maven clean install
|
||||||
normal SPC l m I Run maven install
|
normal SPC l m I run maven install
|
||||||
normal SPC l m p Run one already goal from list
|
normal SPC l m p run one already goal from list
|
||||||
normal SPC l m r Run maven goals
|
normal SPC l m r run maven goals
|
||||||
normal SPC l m R Run one maven goal
|
normal SPC l m R run one maven goal
|
||||||
normal SPC l m t Run maven test
|
normal SPC l m t run maven test
|
||||||
|
|
||||||
Jump key bindings:
|
Jump key bindings:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user