mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-02 22:30:04 +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/
|
||||
|
||||
set rtp+=build/vader
|
||||
let &runtimepath .= ',' . fnamemodify(g:_spacevim_root_dir, ':p:h:h') . '/build/vader'
|
||||
|
||||
" 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: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'
|
||||
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 . ' '
|
||||
|
@ -153,6 +153,11 @@ function! s:open_default_shell() abort
|
||||
if s:default_shell ==# 'terminal'
|
||||
if exists(':terminal')
|
||||
if has('nvim')
|
||||
if s:SYSTEM.isWindows
|
||||
let shell = empty($SHELL) ? 'cmd.exe' : $SHELL
|
||||
else
|
||||
let shell = empty($SHELL) ? 'bash' : $SHELL
|
||||
endif
|
||||
terminal
|
||||
" @bug cursor is not cleared when open terminal windows.
|
||||
" in neovim-qt when using :terminal to open a shell windows, the orgin
|
||||
@ -175,6 +180,9 @@ function! s:open_default_shell() abort
|
||||
endif
|
||||
let s:term_buf_nr = term_start(shell, {'curwin' : 1, 'term_finish' : 'close'})
|
||||
endif
|
||||
let b:_spacevim_shell = shell
|
||||
" use WinEnter autocmd to update statusline
|
||||
doautocmd WinEnter
|
||||
let s:shell_win_nr = winnr()
|
||||
let w:shell_layer_win = 1
|
||||
setlocal nobuflisted nonumber norelativenumber
|
||||
|
@ -1154,12 +1154,12 @@ MAPPINGS
|
||||
|
||||
Mode Key Function
|
||||
-------------------------------------------------------------
|
||||
normal SPC l m i Run maven clean install
|
||||
normal SPC l m I Run maven install
|
||||
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 one maven goal
|
||||
normal SPC l m t Run maven test
|
||||
normal SPC l m i run maven clean install
|
||||
normal SPC l m I run maven install
|
||||
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 one maven goal
|
||||
normal SPC l m t run maven test
|
||||
|
||||
Jump key bindings:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user