From 3c1ac36e6e31be642780e33353a97dec41e2c054 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Sun, 23 Aug 2020 12:27:03 +0100 Subject: [PATCH] Add some instructions for cutomising the unicode signs --- README.md | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 64 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index db6e025..1f21681 100644 --- a/README.md +++ b/README.md @@ -1353,17 +1353,31 @@ Vimsector uses them, they will not be replaced. So to customise the signs, define them in your `vimrc`. * `vimspectorBP`: A breakpoint. +* `vimspectorBPCond`: A conditional breakpoint. * `vimspectorBPDisabled`: A disabled breakpoint * `vimspectorPC` The program counter, i.e. current line. -For example, to use some unicode symbols, you could put this in your `vimrc`: +The default symbols are the equivalent of something like the following: ```viml -sign define vimspectorBP text=🔴 texthl=Normal -sign define vimspectorBPDisabled text=🔵 texthl=Normal -sign define vimspectorPC text=🔶 texthl=SpellBad +sign define vimspectorBP text=\ ● texthl=WarningMsg +sign define vimspectorBPCond text=\ ◆ texthl=WarningMsg +sign define vimspectorBPDisabled text=\ ● texthl=LineNr +sign define vimspectorPC text=\ ▶ texthl=MatchParen ``` +If the signs don't display properly, your font probably doesn't contain these +glyphs. You can easily change them by deifining the sign in your vimrc. For +example, you could put this in your `vimrc` to use some simple ASCII symbols: + +```viml +sign define vimspectorBP text=>> texthl=WarningMsg +sign define vimspectorBPCond text=>> texthl=WarningMsg +sign define vimspectorBPDisabled text=>> texthl=LIneNr +sign define vimspectorPC text=-> texthl=MatchParen +``` + + ## Changing the default window sizes > ***Please Note***: This cusomiation API is ***unstable***, meaning that it may @@ -1463,6 +1477,50 @@ In addition, the following key is added when triggering the * `g:vimspector_session_windows.terminal`: Window ID of the terminal window +## Customising the WinBar + +You can even customise the WinBar buttons by simply running the usual `menu` +(and `unmanu`) commands. + +By default, Vimspector uses something a bit like this: + +```viml +nnoremenu WinBar.■\ Stop :call vimspector#Stop() +nnoremenu WinBar.▶\ Cont :call vimspector#Continue() +nnoremenu WinBar.▷\ Pause :call vimspector#Pause() +nnoremenu WinBar.↷\ Next :call vimspector#StepOver() +nnoremenu WinBar.→\ Step :call vimspector#StepInto() +nnoremenu WinBar.←\ Out :call vimspector#StepOut() +nnoremenu WinBar.⟲: :call vimspector#Restart() +nnoremenu WinBar.✕ :call vimspector#Reset() +``` + +If you prefer a different layout or if the unicode symbols don't render +correctly in your font, you can customise this in the `VimspectorUICreated` +autocommand, for example: + +```viml +func! CustomiseUI() + call win_gotoid( g:vimspector_session_windows.code ) + " Clear the existing WinBar created by Vimspector + nunmenu WinBar + " Cretae our own WinBar + nnoremenu WinBar.Kill :call vimspector#Stop() + nnoremenu WinBar.Continue :call vimspector#Continue() + nnoremenu WinBar.Pause :call vimspector#Pause() + nnoremenu WinBar.Step\ Over :call vimspector#StepOver() + nnoremenu WinBar.Step\ In :call vimspector#StepInto() + nnoremenu WinBar.Step\ Out :call vimspector#StepOut() + nnoremenu WinBar.Restart :call vimspector#Restart() + nnoremenu WinBar.Exit :call vimspector#Reset() +endfunction + +augroup MyVimspectorUICustomistaion + autocmd! + autocmd User VimspectorUICreated call s:CustomiseUI() +augroup END +``` + ## Example There is some example code in `support/custom_ui_vimrc` showing how you can use @@ -1533,6 +1591,8 @@ hi link jsonComment Comment but in theory a single gadget can supply multiple `adapter` configs. Typically this happens when a `gadget` supplies different `adapter` config for, say remote debugging, or debugging in a container, etc. +8. The signs and winbar display funny symbols. How do i fix them? See + [this](#changing-the-default-signs) and [this](#customising-the-winbar) # Motivation