Skip to content

Toggle Side Bar

I will show you how to create a sidebar toggle mapping in NeoVintagous.

INFO

The NeoVintageous toggle sidebar command has been updated, see article for more details.

<leader>d

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:

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

In your key bindings:

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

It's as simple as that.

commanddescription
ctrl-k ctrl-btoggle side bar
ctrl-0give the focus to the side bar
Escreturn the focus to the view
h, j, k, l, and arrow keysnavigate side bar

Further reading