emcl.nvim
emcl.nvim copied to clipboard
Make the cursor move like Emacs in the command line of Neovim
emcl.nvim
Yet another plugin to use Emacs shortcut in Neovim's command line.
What's this?
This is a port of vim-emacscommandline written in Lua for Neovim. Pros/Cons for the original are below.
- Pros
-
- emcl.nvim has tests for all funcs.
- emcl.nvim is written in Lua, so it is more readable and extensible than Vimscript.
- Cons
-
- emcl.nvim does not work on Vim ;( This is for Neovim only.
Installation
Vim packages
git clone https://github.com/delphinus/emcl.nvim \
~/.local/share/nvim/site/pack/foo/start/emcl.nvim
And in your init.lua……
require("emcl").setup {}
packer.nvim
use {
"delphinus/emcl.nvim",
config = function()
require("emcl").setup {}
end,
}
Mappings
You can change these mappings below or use some ones only. See doc for the
detail or options (type :h emcl in Neovim).
| Feature | Default mapping |
|---|---|
| ForwardChar | <C-f> |
| BackwardChar | <C-b> |
| BeginningOfLine | <C-a> |
| EndOfLine | <C-e> |
| OlderMatchingCommandLine | <C-p> |
| NewerMatchingCommandLine | <C-n> |
| FirstLineInHistory | <M-<> |
| LastLineInHistory | <M->> |
| SearchCommandLine | <C-r> |
| AbortCommand | <C-g> |
| ForwardWord | <M-f> |
| BackwardWord | <M-b> |
| DeleteChar | <Del>, <C-d> |
| BackwardDeleteChar | <BS>, <C-h> |
| KillWord | <M-d> |
| DeleteBackwardsToWhiteSpace | <C-w> |
| BackwardKillWord | <M-BS> |
| TransposeChar | <C-t> |
| TransposeWord | <M-t> |
| Yank | <C-y> |
| Undo | <C-_>, <C-x><C-y> |
| YankLastArg | <M-.>, <M-_> |
| ToggleExternalCommand | <C-z> |
Todo
- [ ] Tests for TransposeWord
- TransposeWord may have bugs.