I’d like a keyboard shortcut to act in the same way as the toobar button “show sidebars”:

  • If the sidebar is open, it hides it

  • If the sidebar is closed, it opens to the last used sidebar

This page, Keyboard shortcuts - Perform common Firefox tasks quickly only describes how to toggle individual sidebars. History, bookmarks etc. So depending what is open you have to use unique shortcuts.

Is it possible?

I <3 FF but they are really stingy about the keyboard shortcuts.