Skip to main content

Spyder Vim plugin

Project description

Spyder Okvim

Window tests codecov

Spyder plugin for running Vim commands in the code editor.

Please do not open issues on the Spyder GitHub after installing Okvim.

If you run into problems, uninstall Okvim and try again.

Known Issues

  • Okvim does not work when the Spyder editor is undocked from the main window.

Overview

  • Supported Vim motions include hjkl, ^u, %, iw, i(, /, n, N, ; and more.

  • You can combine operators with motions. Examples: diw, di(, c%, c/foo, cn, ygg, d2w, 2d2W and more.

  • Spyder commands such as running a selection, formatting, and toggling comments are also available.

  • Macro support is experimental.

Movements Combination Spyder command
movement gif combination gif spyder cmd gif

Installation

You can install this plugin either directly from PyPI or locally.

Install from PyPI

pip install spyder-okvim

Install Locally

To install from a local copy:

pip install -U .

Note

If spyder-vim is installed, uninstall it first to avoid conflicts:

pip uninstall spyder-vim

Modes

The following modes are supported:

  • Normal
  • Visual
  • Visual Line

Actions

The following actions are supported:

  • x, s, r
  • C, D, S
  • dd, cc, yy
  • <<, >>
  • p, P
  • d{motion}, c{motion}
  • <{motion}, >{motion}
  • gu{motion}, gU{motion} g~{motion}, ~
  • u, ^R
  • J
  • .

Motions

The following motions are supported:

  • hjkl
  • 0, ^, $
  • w, W, b, e
  • iwW, i()[]{}bB, i'"
  • G, g
  • :{number}
  • ^D, ^U, ^F, ^B
  • HLM
  • %
  • f, F, t, T, ;, ,
  • /, N, n
  • Enter, Space, Backspace
  • easymotion

Mark

Use m{mark} to set a mark at the current cursor position and ' or ` to jump back to it. Uppercase marks are saved in Spyder's configuration folder so they persist across sessions.

Vim keys

  • ^A : Add [count] to number
  • ^X : Subtract [count] to number
  • K : Inspect current object
  • gd : Go to definition.
  • gt, gT : Cycle to next/previous file.
  • zz, zt, tb : Cursor line to some locations of screen.
  • ZZ : Save and close current file.
  • q, @: macro

Special keys

  • f : autoformat the curruent file
  • b : toggle a breakpoint
  • r : run the selection or current line in the console.
  • enter : run cell and advance
  • p : Spyder switcher
  • s : Spyder symbol switcher
  • [d : go to previous warning/error
  • ]d : go to next warning/error
  • gc{motion} : toggle comments (works in visual mode)
    • gcc : toggle the comment for the current line

Vim Surround

  • Supported surroundings: '"()[]{}bB

The following actions are supported:

  • ys{motion}{surroundings} in normal mode: add surroundings in pairs.
  • ds{surroundings} in normal mode: delete surroundings in pairs.
  • cs{surroundings}{surroundings} in normal mode: change surroundings in pairs.
  • S{surroundings} in visual mode: add surroundings in pairs.

Fuzzy path finder

Press Ctrl+p to open the fuzzy path finder. Use ^p, ^n, ^f, ^b, ^u, and ^d to navigate the list.

fuzzy path finder

Config page

config page

Easymotion

easymotion

EasyMotion commands work with any operator that accepts a motion.

Motion Command Description
<leader><leader> w Start of word forwards
<leader><leader> b Start of word backwards
<leader><leader> j Start of line forwards
<leader><leader> k Start of line backwards
<leader><leader> f <char> Find character forwards
<leader><leader> F <char> Find character backwards

Search two characters (like vim-sneak)

Jump to any location specified by two characters.

Works across lines, with operators (including repeat .), motion-repeat (; and ,), and visual mode.

Press s followed by two characters. For operators use z because s belongs to vim-surround.

When there are matches in another group, hints appear around the group. sneak

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spyder_okvim-0.10.1.tar.gz (79.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

spyder_okvim-0.10.1-py3-none-any.whl (97.2 kB view details)

Uploaded Python 3

File details

Details for the file spyder_okvim-0.10.1.tar.gz.

File metadata

  • Download URL: spyder_okvim-0.10.1.tar.gz
  • Upload date:
  • Size: 79.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for spyder_okvim-0.10.1.tar.gz
Algorithm Hash digest
SHA256 d44ee26ba8b104b2f87d8bcf016a534bddc174ff1eb32a5dfbb650cbe1a2ea07
MD5 48939df81eaf93356975b4491db50927
BLAKE2b-256 0e89a32f86c7bb30eed8a0b4b3564778c68d11164ffc211f3327665764efda79

See more details on using hashes here.

File details

Details for the file spyder_okvim-0.10.1-py3-none-any.whl.

File metadata

  • Download URL: spyder_okvim-0.10.1-py3-none-any.whl
  • Upload date:
  • Size: 97.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for spyder_okvim-0.10.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0af3b5181c8be60f3f44c5e7b1ca235e657e352f1f6b1165d2c802b979a12ff8
MD5 98beda1df846cf14bc104023d6a452ef
BLAKE2b-256 85c820904b8a20fc4cd9275b381c1a00f9dead447afd620291d600560a81d692

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page