/neovimacs.nvim

Vimacs for the Neovim era.

Primary LanguageVim ScriptGNU General Public License v2.0GPL-2.0

💥 Neovimacs

Neovimacs is vimacs for the neovim age.

This project ports the original vimacs scripts (emacs key emulation for vim) to neovim, along with some simplifications to the setup.

📦 Installation

  1. Prepare your shell by adding this to your startup (turn off and flow control, emacs uses them):
stty -ixon -ixoff
  1. Install the plugin with your favorite neovim package manager:
{
   "millerjason/neovimacs.nvim",
}
  1. Enjoy modeless editing throughout neovim

⚙️ Configuration

To install the plugin with custom options (lazy example provided):

{
   "millerjason/neovimacs.nvim",
   opts = {
     VM_Enabled = true,
     VM_StartInsert = false, -- Start in normal (not insert) mode
   },
}

✨ Options

  • VM_Enabled (default true): enabled vimacs (if not set, no modules will be loaded)
  • VM_StartInsert (default true): if set start in emacs insert mode instead of vim normal mode VM_UnixConsoleMetaSendsEsc (default false): also set Meta key (required in certain terminals, requires nvim >= 0.10)
  • TabIndentStyle: (default "emacs"): options for "emacs", "whitespace", and "startofline" tab indent behavior

Debugging

Warning: there are numerous nvim plugins that will introduce conflicting key mappings.

In addition to installing which-key, you can use the following nvim commands to help you track down key bindings and conflicts:

:verbose imap <C-n>   -- for insert mode
:verbose nmap <C-n>   -- for normal mode
:nmap <localleader>   -- to see leader commands
:WhichKey             -- see above

⚡️ Thanks and alternatives

  • vimacs (the OG version of Vimacs, made for vim)
  • nvimacs (a pure lua port of the basic emacs movements and buffer bindings)
  • vim-rsi (readline bindings are a similar subset)

🚀 Usage

Many of the emacs control and meta keys (movement, kill buffers, file operations, marking) will work while you're running vimacs in neovim. Neovim does not allow all bindings to work in all modes, although this module supports most of what is possible.

Plus you still get the full power of vim moded editing as well, so vimacs can be used as a module to transition you from emacs to vim until you have mastered the vim bindings.