mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-03 02: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
|
||||||
|
@ -1135,46 +1135,46 @@ MAPPINGS
|
|||||||
|
|
||||||
Mode Key Function
|
Mode Key Function
|
||||||
-------------------------------------------------------------
|
-------------------------------------------------------------
|
||||||
normal SPC l g A generate accessors
|
normal SPC l g A generate accessors
|
||||||
normal SPC l g s generate setter accessor
|
normal SPC l g s generate setter accessor
|
||||||
normal SPC l g g generate getter accessor
|
normal SPC l g g generate getter accessor
|
||||||
normal SPC l g a generate setter and getter accessor
|
normal SPC l g a generate setter and getter accessor
|
||||||
normal SPC l g t generate toString function
|
normal SPC l g t generate toString function
|
||||||
normal SPC l g e generate equals and hashcode function
|
normal SPC l g e generate equals and hashcode function
|
||||||
normal SPC l g c generate constructor
|
normal SPC l g c generate constructor
|
||||||
normal SPC l g C generate default constructor
|
normal SPC l g C generate default constructor
|
||||||
insert <c-j>s generate setter accessor
|
insert <c-j>s generate setter accessor
|
||||||
insert <c-j>g generate getter accessor
|
insert <c-j>g generate getter accessor
|
||||||
insert <c-j>a generate getter and setter accessor
|
insert <c-j>a generate getter and setter accessor
|
||||||
visual SPC l g s generate setter accessor
|
visual SPC l g s generate setter accessor
|
||||||
visual SPC l g g generate getter accessor
|
visual SPC l g g generate getter accessor
|
||||||
visual SPC l g a generate setter and getter accessor
|
visual SPC l g a generate setter and getter accessor
|
||||||
|
|
||||||
Maven key bindings:
|
Maven key bindings:
|
||||||
|
|
||||||
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:
|
||||||
|
|
||||||
Mode Key Function
|
Mode Key Function
|
||||||
-------------------------------------------------------------
|
-------------------------------------------------------------
|
||||||
normal SPC l j a jump to alternate file
|
normal SPC l j a jump to alternate file
|
||||||
|
|
||||||
REPL key bindings:
|
REPL key bindings:
|
||||||
|
|
||||||
Mode Key Function
|
Mode Key Function
|
||||||
-------------------------------------------------------------
|
-------------------------------------------------------------
|
||||||
normal SPC l s i start a jshell inferior REPL process
|
normal SPC l s i start a jshell inferior REPL process
|
||||||
normal SPC l s b send buffer and keep code buffer focused
|
normal SPC l s b send buffer and keep code buffer focused
|
||||||
normal SPC l s l send line and keep code buffer focused
|
normal SPC l s l send line and keep code buffer focused
|
||||||
normal SPC l s s send selection text and keep code buffer focused
|
normal SPC l s s send selection text and keep code buffer focused
|
||||||
<
|
<
|
||||||
CODE FORMATTING
|
CODE FORMATTING
|
||||||
To make neoformat support java file, you should install uncrustify. or
|
To make neoformat support java file, you should install uncrustify. or
|
||||||
|
Loading…
Reference in New Issue
Block a user