ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Actual​Vim

by lunixbochs ST3

Sublime Text 3 input mode using Neovim

Labels input, vim

Details

  • 0.9.11
  • github.​com
  • github.​com
  • 2 months ago
  • 57 minutes ago
  • 5 months ago

Installs

  • Total 3K
  • Win 1K
  • OS X 1K
  • Linux 729
Aug 20 Aug 19 Aug 18 Aug 17 Aug 16 Aug 15 Aug 14 Aug 13 Aug 12 Aug 11 Aug 10 Aug 9 Aug 8 Aug 7 Aug 6 Aug 5 Aug 4 Aug 3 Aug 2 Aug 1 Jul 31 Jul 30 Jul 29 Jul 28 Jul 27 Jul 26 Jul 25 Jul 24 Jul 23 Jul 22 Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8 Jul 7 Jul 6
Windows 0 4 7 10 9 7 10 4 5 13 13 11 14 6 8 2 8 10 7 10 20 10 3 12 20 11 17 11 11 10 5 7 9 8 5 2 7 4 17 12 9 10 2 11 7 7
OS X 1 6 20 2 13 7 8 4 8 6 10 20 13 10 4 10 8 14 6 13 9 12 3 13 7 18 22 11 6 8 2 8 5 7 13 7 2 12 4 5 10 5 10 7 6 2
Linux 2 2 10 2 8 9 1 3 7 8 7 7 8 5 7 1 3 2 9 6 5 3 4 5 6 6 5 9 6 6 8 4 6 3 6 5 7 4 3 4 4 5 4 2 5 8

Readme

Source
raw.​githubusercontent.​com

ActualVim

Everything you like about using Sublime Text 3, and everything you like about typing in vim.

Actual uses an embedded Neovim instance to accurately manipulate each Sublime Text buffer as though you were editing the text directly in vim, while the Sublime Text interface, features, and plugins continue to work (see end of README for caveats).

This isn't a remote terminal UI like gvim and other vim frontends. Text modification and selections are bidirectionally synced into the actual Sublime Text UI.

Why?

Sublime looks way better than your terminal and has a rich plugin ecosystem.

Other Sublime vim emulation plugins, including the built-in Vintage, are only rough approximations of the functionality of vim itself. They are missing features or behave differently than the real thing.

With ActualVim, you can use your own vimrc, plugins, and any real vim motions/commands, because it is vim behind the scenes, and bidirectional sync means Sublime Text and the native OS interface still works too.

Usage

This plugin requires Neovim to be installed, but should otherwise work on all Sublime Text 3 platforms (tested primarily on Windows and macOS).

Clone ActualVim to the path found in Preferences -> Browse Packages... or sublime.packages_path(). Usually found here:

  • macOS: ~/Library/Application Support/Sublime Text 3/Packages/
  • Linux: ~/.config/sublime-text-3/Packages/
  • Windows: %APPDATA%/Sublime Text 3/Packages/

You can set the Neovim path by opening Preferences: ActualVim Settings using the command palette (cmd+shift+p or ctrl+shift+p) or via Preferences -> Package Settings -> ActualVim Settings.

ActualVim launches a single Neovim embedded instance and multiplexes each Sublime view into a separate buffer.

If the plugin doesn't work (a horizontal underline cursor appears when ActualVim kicks in), check the Sublime Text console for errors and make sure you set the Neovim path. Barring that, file an issue.

Misc

On OS X 10.7+, you should do defaults write com.sublimetext.3 ApplePressAndHoldEnabled -bool false to enable key repeat.

You can run ActualVim: Disable or ActualVim: Enable via the command pallete to toggle the input mode without losing vim state.

Caveats

Currently broken Sublime Features:

  • Multiple Selection (#8).
  • Auto-popups while typing, like completion (#57) and snippet suggestions (#94).
  • Sublime's undo isn't coalesced properly while in vim mode (it's one character at a time: #44).

Surfacing vim's UI (like the status bar) still needs some love, but I have some good ideas for making it look beautiful (better than your terminal) using Sublime's embedded HTML Phantom views.

Extremely large files will see a performance hit until neovim supports change deltas. The large_file_disable command mitigates this by disabling ActualVim for larger files (with configurable cutoff).