I feel like I say this every month, but it’s already time for another edition of T-SQL Tuesday. This months blog party is hosted by Kenneth Fisher (B|T) and he’s looking for tips & tricks, but nothing DBMS related. As you might already know, I love shortcuts and tips & tricks – so I was really excited to see this prompt. First, because I easily found a few I wanted to share, but secondly, I can’t wait to read about everyone else’s tips & tricks.
I had a hard time narrowing this down to just one shortcut, so I’ve picked three – but they fit together nicely. First, I have to let you in on a small secret:
I’m a tab hoarder
Whether it’s chrome or SSMS, I cannot help myself when it comes to opening new tabs. It’s not uncommon for me to have so many chrome tabs open that you can only see the logos.
I even got called out by my good friend Andrew (B|T) this last week:
... how many tabs did you have open? Hopefully it didn't look like @jpomfret's Chrome browser😂— Andrew Wickham (@awickham) June 1, 2020
My tips & tricks are focused around managing tabs, and they work in all browsers (at least all that I have on my laptop. Chrome, Edge, IE11).
Ctrl + Tab– Switch tabs
Ctrl + W- Close a tab
Ctrl + Shift + T- Reopen the last closed tab
The first two are pretty self-explanatory, but the third one deserves a special mention. I’m sure it’s happened to everyone- you close a tab and the instant it’s gone, you realise you actually needed that one. Well
Ctrl + Shift + T to the rescue. This shortcut will revive that last closed tab from the dead and the magic here is if you keep pressing it, it’ll keep opening tabs you shut previously.
In fact, if you close an entire browser window full of 20 tabs (that I’m sure you need all of) and in another browser window you press
Ctrl + Shift + T, like magic, all the tabs come back to you.
Now I started off using these shortcuts in internet browsers, but then I discovered they work in my favourite code editor as well. All three of the keyboard shortcuts above work in VSCode, so now you can easily switch between scripts with
Ctrl + Tab, close a script with
Ctrl + W and then reopen it with
Ctrl + Shift + T.
I love this crossover functionality, and I feel like it adds so much when you can open a program and it works in a way that you’re used to.