I’m going to show you how to create a sidebar toggle mapping in NeoVintagous.


In my example below I’m going to map to <leader>d, where my “mapleader” is a comma character. All together it means I use ,d to toggle the side bar. You can map to whatever key sequence is good for you.

Mapping it

In your vintageousrc file:

let mapleader=,
nnoremap <leader>d :Neovintageous action=toggle_side_bar<CR>

In your key bindings:

        "keys": [",", "d"],
        "command": "neovintageous",
        "args": { "action": "toggle_side_bar" },
        "context": [
            { "key": "control", "operand": "sidebar_tree" }

It’s as simple as that.

command description
ctrl-k ctrl-b toggle side bar
ctrl-0 give the focus to the side bar
Esc return the focus to the view
h, j, k, l, and arrow keys navigate side bar

Further reading