Metadata-Version: 2.4
Name: spyder-tab-move
Version: 0.1.0
Summary: Move Spyder editor tabs left/right with keyboard shortcuts
Home-page: https://github.com/hruskamiro/spyder-tab-move
Author: Miroslav Hruska
Author-email: hruska.miro@gmail.com
License: MIT
Project-URL: Source, https://github.com/hruskamiro/spyder-tab-move
Project-URL: Issues, https://github.com/hruskamiro/spyder-tab-move/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: X11 Applications :: Qt
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Editors :: Integrated Development Environments (IDE)
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: spyder<7,>=5.4
Requires-Dist: qtpy
Dynamic: license-file

# spyder-tab-move

Move Spyder editor tabs left and right with keyboard shortcuts.

This package registers a Spyder plugin that adds two actions:
- `move_tab_left`
- `move_tab_right`

By default, it assigns:
- `Ctrl+Shift+PgUp` to move the current editor tab left
- `Ctrl+Shift+PgDown` to move the current editor tab right

## Tested and confirmed working

This plugin was tested in the following environment:
- OS: Linux (Ubuntu)
- Python: 3.8
- Spyder: 6.0.8

Notes:
- Supports Spyder `>=5.4,<7`.
- Shortcuts are registered in Spyder shortcut context `editor`.
- If a user had empty values for these actions, the plugin seeds defaults at startup.
- Shortcut assignment handles the Spyder 5 and Spyder 6 shortcut API difference.

## Installation

Inside the same environment where Spyder runs:

Install the latest released version from PyPI:

```bash
pip install spyder-tab-move
```

Or install directly from GitHub:

```bash
pip install "git+https://github.com/hruskamiro/spyder-tab-move.git@main"
```

Then restart Spyder.

## Verify plugin is loaded

In **Spyder Internal Console**:

```python
p = spy.window.get_plugin("spyder_tab_move")
print(p)
```

If loaded, `p` is not `None`.

Check actions and shortcuts:

```python
a1 = p.get_action("move_tab_left")
a2 = p.get_action("move_tab_right")
print(a1.shortcut().toString(), len(a1.associatedWidgets()))
print(a2.shortcut().toString(), len(a2.associatedWidgets()))
```

## Troubleshooting

- Shortcut does nothing:
  - Open multiple editor tabs (movement is a no-op with 0 or 1 tab).
  - Confirm keys in `Preferences > Keyboard shortcuts`.
  - Confirm focus is in the Editor.

- Force shortcuts from **Spyder Internal Console**:

```python
sc = spy.window.get_plugin("shortcuts")
sc.set_shortcut("Ctrl+Shift+PgUp", "move_tab_left", "editor")
sc.set_shortcut("Ctrl+Shift+PgDown", "move_tab_right", "editor")
sc.apply_shortcuts()
```

## License

MIT. See `LICENSE`.
