Too many plugins use the default priority of 10 so they race/chase. Allow uses to configure the priorities and make sure that the defaults are documented.
74 lines
2.3 KiB
Text
74 lines
2.3 KiB
Text
execute 'source' expand( '<sfile>:p:h' ) . '/minimal_vimrc'
|
|
set noequalalways
|
|
|
|
function! s:CustomiseUI()
|
|
let wins = g:vimspector_session_windows
|
|
|
|
" Close the Variables window
|
|
if has( 'nvim' )
|
|
" No win_execute in neovim
|
|
call win_gotoid( wins.variables )
|
|
quit
|
|
else
|
|
call win_execute( wins.variables, 'q' )
|
|
endif
|
|
|
|
" Put the stack trace at the top of the "left bar" (rotate)
|
|
call win_gotoid( wins.stack_trace )
|
|
wincmd r
|
|
|
|
" Make the left column at least 70 chars
|
|
70wincmd |
|
|
|
|
" Make the code window at least 80 chars
|
|
call win_gotoid( wins.code )
|
|
80wincmd |
|
|
|
|
" Make the output window 10 lines high and right at the top of the screen
|
|
call win_gotoid( wins.output )
|
|
10wincmd _
|
|
wincmd K
|
|
endfunction
|
|
|
|
function s:SetUpTerminal()
|
|
let terminal_win = g:vimspector_session_windows.terminal
|
|
|
|
" Make the terminal window at most 80 columns wide, ensuring there is enough
|
|
" sapce for our code window (80 columns) and the left bar (70 columns)
|
|
|
|
" Padding is 2 for the 2 vertical split markers and 2 for the sign column in
|
|
" the code window.
|
|
let left_bar = 70
|
|
let code = 80
|
|
let padding = 4
|
|
let cols = max( [ min( [ &columns - left_bar - code - padding, 80 ] ), 10 ] )
|
|
call win_gotoid( terminal_win )
|
|
execute cols . 'wincmd |'
|
|
endfunction
|
|
|
|
function! s:CustomiseWinBar()
|
|
call win_gotoid( g:vimspector_session_windows.code)
|
|
aunmenu WinBar
|
|
nnoremenu WinBar.▷\ ᶠ⁵ :call vimspector#Continue()<CR>
|
|
nnoremenu WinBar.↷\ ᶠ¹⁰ :call vimspector#StepOver()<CR>
|
|
nnoremenu WinBar.↓\ ᶠ¹¹ :call vimspector#StepInto()<CR>
|
|
nnoremenu WinBar.↑\ ˢᶠ¹¹ :call vimspector#StepOut()<CR>
|
|
nnoremenu WinBar.❘❘\ ᶠ⁶ :call vimspector#Pause()<CR>
|
|
nnoremenu WinBar.□\ ˢᶠ⁵ :call vimspector#Stop()<CR>
|
|
nnoremenu WinBar.⟲\ ᶜˢᶠ⁵ :call vimspector#Restart()<CR>
|
|
nnoremenu WinBar.✕\ ᶠ⁸ :call vimspector#Reset()<CR>
|
|
endfunction
|
|
|
|
augroup TestUICustomistaion
|
|
autocmd!
|
|
autocmd User VimspectorUICreated call s:CustomiseUI()
|
|
autocmd User VimspectorTerminalOpened call s:SetUpTerminal()
|
|
autocmd User VimspectorUICreated call s:CustomiseWinBar()
|
|
augroup END
|
|
|
|
let g:vimspector_sign_priority = {
|
|
\ 'vimspectorBP': 3,
|
|
\ 'vimspectorBPCond': 2,
|
|
\ 'vimspectorBPDisabled': 1,
|
|
\ 'vimspectorPC': 999,
|
|
\ }
|