Currently I am using a notebook in front of an external display and I added a function to dwm with which I can essentially "push" all clients (windows) to the external display, which in turn sends all its clients to my notebook's display (or in other words it swaps all clients of one display with all clients of the other).
When I am coding I am always using bstack mode with vim on top and one or two terminals at the bottom. The external monitor is displaying documentation. If I have to look something up I just have to push vim + terminals away. If I am finished I pull them back. So my notebook display becomes my working display.