Skip to content

NeoVintageous - Reveal in Side Bar

You can reveal a file in the sidebar via a right mouse click and selecting Reveal in Side Bar, but why work so hard. Create a mapping:

vim
let mapleader=,
nnoremap <leader><leader> :RevealInSideBar<CR>

A new advanced reveal in side bar command was added in v1.31.0. Let's take a look at how to use it.

Advanced reveal side bar

The new reveal in side bar command does a number of things that the built-in Sublime Text command does not.

  1. Makes the side bar visible if it's not already visible
  2. Puts focus on the side bar

Here is an example using it in a mapping.

vim
let mapleader=,
nnoremap <leader><leader> :Neovintageous action=reveal_side_bar<CR>

To use the same mapping to put the focus back on the view, when the side bar has focus.

Menu → Preferences → Key Bindings

js
{
    "keys": [",", ","],
    "command": "focus_group",
    "args": {"group": 0},
    "context": [
        {"key": "control", "operand": "sidebar_tree"}
    ]
},

The reason the key binding is required is because NeoVintageous does not handle keys when the side bar has focus.

Pair it with a toggle side bar mapping to up your power user game.

I hope this has been helpful. Take it easy, my friends.

Further reading