VSCodeVim: Switch tabs with `gt` when Jupyter notebook is active tab?

37 Views Asked by At

Summary

When using Vim and Jupyter plugins in VSCode, how can I make the gT/gt commands cycle back/forth (the Vim default behavior) between open tabs when a Jupyter notebook is the active tab?

Detail

When editing most text files in VSCode using the VSCodeVim plugin, I can use the classic Vim command gT/gt to cycle back/forth between open tabs.

In the special case of Jupyter notebooks with the Jupyter plugin, these are rendered JSON documents comprising nested "cells" which complicates normal Vim-style navigation. When I cycle through tabs to a Jupyter notebook, the gt binding ceases to function, and I get "The key combination (G, T) is not a command" in the status bar.

EDIT: gT/gt does switch between tabs when I am within a Jupyter notebook and editing a cell. But when switching to a Jupyter notebook not in the cell-editing state (i.e. focus is at the notebook level), gT/gt ceases to work. I suppose since we are no longer in a text-editing mode, the Vim keybindings are not active.

Is there a way I can map/enable the Vim-style tab-switching behavior for the "notebook" level as well, when a Jupyter notebook is the active tab?

Versions

Software Version
MacOS 13.6.3
VSCode 1.87.0
Jupyter Extension v2024.2.0
Vim Extension v1.27.2
0

There are 0 best solutions below