diff --git a/autoload/SpaceVim/plugins/highlight.vim b/autoload/SpaceVim/plugins/highlight.vim index 61c758bb0..201c70f54 100644 --- a/autoload/SpaceVim/plugins/highlight.vim +++ b/autoload/SpaceVim/plugins/highlight.vim @@ -6,6 +6,46 @@ " License: GPLv3 "============================================================================= +"" +" @section Symbol highlighter, plugins-symbol-highlighter +" @parentsection plugins +" SpaceVim supports highlighting current symbol on demand and add a transient +" state to easily navigate and rename these symbols. +" +" It is also possible to change the range of the navigation on the fly, the +" available ranges are: +" +" 1. buffer: the whole buffer +" 2. function: in current function +" 3. visible area: in current visible area of the buffer +" +" The default key binding to Highlight the symbol under the cursor is `SPC s h`. +" +" Navigation between the highlighted symbols can be done with the commands: +" > +" Key Bindings | Descriptions +" ------------ | ------------------------------------------- +" * | highlight current symbol and jump forwards +" # | highlight current symbol and jump backwards +" SPC s e | start iedit mode on current symbol +" SPC s h | highlight current symbol within default range +" SPC s H | highlight last symbol within default range +" < +" In highlight symbol transient state, the following key bindings can be used: +" > +" Key Bindings | Descriptions +" ------------- | ----------------------------------- +" e | start iedit mode +" n | go to next occurrence +" N / p | go to previous occurrence +" b | search occurrence in all buffers +" / | search occurrence in whole project +" | toggle highlight current occurrence +" r | change range +" R | go to home occurrence +" Any other key | leave the navigation transient state +" < + " TODO: {{{ " e: iedit " d/D: next previous definition diff --git a/doc/SpaceVim.txt b/doc/SpaceVim.txt index d63050385..1e4f05ee4 100644 --- a/doc/SpaceVim.txt +++ b/doc/SpaceVim.txt @@ -259,13 +259,14 @@ CONTENTS *SpaceVim-contents* 9. windows-and-tabs..................... |SpaceVim-usage-windows-and-tabs| 8. Plugins................................................. |SpaceVim-plugins| 1. Mapping Guide......................... |SpaceVim-plugins-mapping-guide| - 2. alternate................................. |SpaceVim-plugins-alternate| - 3. autosave................................... |SpaceVim-plugins-autosave| - 4. iedit......................................... |SpaceVim-plugins-iedit| - 5. runner....................................... |SpaceVim-plugins-runner| - 6. scrollbar................................. |SpaceVim-plugins-scrollbar| - 7. tab manager.............................. |SpaceVim-plugins-tabmanager| - 8. todo manager............................ |SpaceVim-plugins-todomanager| + 2. Symbol highlighter............... |SpaceVim-plugins-symbol-highlighter| + 3. alternate................................. |SpaceVim-plugins-alternate| + 4. autosave................................... |SpaceVim-plugins-autosave| + 5. iedit......................................... |SpaceVim-plugins-iedit| + 6. runner....................................... |SpaceVim-plugins-runner| + 7. scrollbar................................. |SpaceVim-plugins-scrollbar| + 8. tab manager.............................. |SpaceVim-plugins-tabmanager| + 9. todo manager............................ |SpaceVim-plugins-todomanager| 9. API......................................................... |SpaceVim-api| 1. clock............................................. |SpaceVim-api-clock| 2. cmdlinemenu................................. |SpaceVim-api-cmdlinemenu| @@ -6600,6 +6601,46 @@ following snippet: leader_guide_theme = 'whichkey' < +============================================================================== +SYMBOL HIGHLIGHTER *SpaceVim-plugins-symbol-highlighter* + +SpaceVim supports highlighting current symbol on demand and add a transient +state to easily navigate and rename these symbols. + +It is also possible to change the range of the navigation on the fly, the +available ranges are: + + 1. buffer: the whole buffer + 2. function: in current function + 3. visible area: in current visible area of the buffer + +The default key binding to Highlight the symbol under the cursor is `SPC s h`. + +Navigation between the highlighted symbols can be done with the commands: +> + Key Bindings | Descriptions + ------------ | ------------------------------------------- + * | highlight current symbol and jump forwards + # | highlight current symbol and jump backwards + SPC s e | start iedit mode on current symbol + SPC s h | highlight current symbol within default range + SPC s H | highlight last symbol within default range +< +In highlight symbol transient state, the following key bindings can be used: +> + Key Bindings | Descriptions + ------------- | ----------------------------------- + e | start iedit mode + n | go to next occurrence + N / p | go to previous occurrence + b | search occurrence in all buffers + / | search occurrence in whole project + | toggle highlight current occurrence + r | change range + R | go to home occurrence + Any other key | leave the navigation transient state +< + ============================================================================== ALTERNATE *SpaceVim-plugins-alternate* diff --git a/docs/documentation.md b/docs/documentation.md index cf4eaa312..6ddc69e11 100644 --- a/docs/documentation.md +++ b/docs/documentation.md @@ -2512,39 +2512,39 @@ Key bindings within repl buffer: ### Highlight current symbol -SpaceVim supports highlighting of the current symbol on demand and add a transient state to easily navigate and rename these symbols. +SpaceVim supports highlighting current symbol on demand and add a transient +state to easily navigate and rename these symbols. -It is also possible to change the range of the navigation on the fly to: +It is also possible to change the range of the navigation on the fly, the +available ranges are: -- buffer -- function -- visible area +1. buffer: the whole buffer +2. function: in current function +3. visible area: in current visible area of the buffer -To Highlight the current symbol under the cursor press `SPC s h`. +The default key binding to Highlight the symbol under the cursor is `SPC s h`. -Navigation between the highlighted symbols can be done with the commands: +| Key Bindings | Descriptions | +| ------------ | --------------------------------------------- | +| `*` | highlight current symbol and jump forwards | +| `#` | highlight current symbol and jump backwards | +| `SPC s e` | start iedit mode on current symbol | +| `SPC s h` | highlight current symbol within default range | +| `SPC s H` | highlight last symbol within default range | -| Key Bindings | Descriptions | -| ------------ | ---------------------------------------------------------------------------- | -| `*` | initiate navigation transient state on current symbol and jump forwards | -| `#` | initiate navigation transient state on current symbol and jump backwards | -| `SPC s e` | edit all occurrences of the current symbol | -| `SPC s h` | highlight the current symbol and all its occurrence within the current range | -| `SPC s H` | go to the last searched occurrence of the last highlighted symbol | +In highlight symbol transient state, the following key bindings can be used: -In highlight symbol transient state: - -| Key Bindings | Descriptions | -| ------------- | ------------------------------------------------------------- | -| `e` | edit occurrences (`*`) | -| `n` | go to next occurrence | -| `N` / `p` | go to previous occurrence | -| `b` | search occurrence in all buffers | -| `/` | search occurrence in whole project | -| `` | toggle highlight current occurrence | -| `r` | change range (function, display area, whole buffer) | -| `R` | go to home occurrence (reset position to starting occurrence) | -| Any other key | leave the navigation transient state | +| Key Bindings | Descriptions | +| ------------- | ------------------------------------ | +| `e` | start iedit mode | +| `n` | go to next occurrence | +| `N` / `p` | go to previous occurrence | +| `b` | search occurrence in all buffers | +| `/` | search occurrence in whole project | +| `` | toggle highlight current occurrence | +| `r` | change range | +| `R` | go to home occurrence | +| Any other key | leave the navigation transient state | ### Error handling