Keyboard shortcut for cycling through tabs


#1

In Sublime Text ctrl+tab and ctrl+shift+tab cycle through the current open tabs (forward and backwards). This seems to be missing from Atom and I can’t see any keyboard functionality that replicates this. (sure I can do command+num but that’s not always the most useful)


Switching tabs with keyboard
#2

That was the very first thing I fixed. Go to the Atom menu > Open Your Keymap and add:

'body':
  'ctrl-tab': 'pane:show-next-item'
  'ctrl-shift-tab': 'pane:show-previous-item'

Note that this will cycle in the displayed order, not the most recently used order like ST does.


#3

thanks @tekkub that’s almost too easy.


#4

Why is this not the default? I know some apps use Cmd+Opt+Left and Right, but most apps (browsers, editors) that I’m aware of use Ctrl+Tab and Ctrl+Shift+Tab, so shouldn’t Atom too?


#5

It’s a pretty common tab switching convention in OSX to use Cmd+Shift+{ and Cmd+Shift+} to switch between tabs, which is what it uses by default. This is what basically all web browsers use, which is where I spend most of my time with tabs, so the muscle memory is hard to kick. Changing this in Sublime Text 2 was the first thing I did. :smile:


#6

Looks like browsers support multiple “defaults”, because Ctrl+Tab and Ctrl+Shift+Tab are supported everywhere as well :wink: I’m not saying it should replace the current bindings, but I think it makes sense as an addition.


#7

Easily fixed, for sure. Not sure why anyone would prefer Ctrl-Tab and Ctrl-Shift-Tab over Cmd-Shift-{ and Cmd-Shift-}. There’s a lot more finger acrobatics involved in hitting Ctrl-Tab and Ctrl-Shift-Tab, IMO. :wink:


#8

With Caps Lock mapped to Ctrl, Ctrl+Tab and Ctrl+Shift+Tab are one handed shortcuts with pretty much no acrobatics needed here :). The downside is that they don’t work on some keyboards, because those 3 keys have a ghosted key in them (Apple USB keyboards are an example of this. You can’t hit Caps Lock, Shift and Tab at the same time, the keyboard won’t send the 3 signals)


#9

Yeah, remapping caps lock to ctrl is always the first thing I do when I get a new machine. That said, hitting Ctrl-Shift-Tab at once requires twisting my hand in a way that’s sort of uncomfortable. I guess you wouldn’t have to if you just smash them with your pinky. :wink:


#10

I must be used to it by now. Don’t know if that is a good thing :wink:


#11

When I’m tab-nav’in around my hand usually isn’t on the home row. I tend to hold down ctrl and shift with my thumb and tap tab with my index.


#12

It’s worth noting that cmd+shift+{ and } might not be commonly known on non-English keyboard layouts. I for one had never heard of it until now (Swedish).

Thanks for the mapping @tekkub! I see the point of the English way to do it, but I’m still learning to code using an English layout.


#13

I would really like to be able to cycle between most recently used files. Usually super helpful when editing 2 files and switching between them too often


#14

@Alfreddd I recently pushed a package called tab-switcher which does this.


#15

I made a package to scatch that itch: https://atom.io/packages/tab-history
It’s my first plugin, probably a bit buggy.


#16

Similar : https://atom.io/packages/tab-switcher

I use neither as I have learnt to be okay with tab cycling like the browser for now :heart:


#17

I found this package. ctrl-last-tab. It uses ctrl-tab to go to the most recent tab.


#18

You can always use cmd + any numeric key corresponding to the # of your open tab in Atom. This functionality is also the same in most web browsers. Hope that helps.


#19

any idea of how to cycle through different tabs when shown in a splitted window? alt + Number just switch between the tabs on the same side of the split.


#20

hi, I’ve done this before and it worked for me, but now on a brand new installation of Atom, it doesn’t work… whyyy??

'body':
  'ctrl-tab': 'pane:show-next-item'