Map a few more keys to exit
Use a better name for window
Better use of setlocal and map <buffer>

It's now much harder to accidentally kill your session by exiting the window
oddly.