Go to file
2022-05-17 00:00:38 -04:00
autoload merge!: cleanup the plugin 2022-04-25 17:59:33 -04:00
doc docs: update to add is_active 2022-05-17 00:00:38 -04:00
examples docs: make comments conform in case 2022-04-26 11:33:37 -04:00
lua/libmodal ref(Layer): utils.notify_error for unmapping errors 2022-05-16 23:53:40 -04:00
plugin merge!: cleanup the plugin 2022-04-25 17:59:33 -04:00
.gitignore Update imports 2020-05-01 17:15:12 -04:00
LICENSE.md Add license 2020-04-29 15:17:31 -04:00
README.md docs(README): make less wordy 2022-04-24 11:34:00 -04:00

nvim-libmodal

This is a rewrite of vim-libmodal using Neovim's Lua API. This project aims to be cross-compatable with vim-libmodal— with a few notable exceptions (see the FAQ).

Requirements

  • Neovim 0.7+.
  • vim-libmodal is not installed.

Installation

You can use packer.nvim (or any package manager) to install this plugin. The below example is for packer.nvim:

local install_path = vim.fn.stdpath('data')..'/site/pack/packer/opt/packer.nvim'

if not vim.loop.fs_stat(vim.fn.glob(install_path)) then
	os.execute('git clone https://github.com/wbthomason/packer.nvim '..install_path)
end

vim.api.nvim_command 'packadd packer.nvim'

return require('packer').startup {function(use)
	use {'wbthomason/packer.nvim', opt=true}
	use 'Iron-E/nvim-libmodal'
	-- use {'Username/mode-plugin', wants='nvim-libmodal'}
end}

Usage

The following plugins have been constructed using nvim-libmodal:

The following samples have been constructed using nvim-libmodal:

See docs for more information.

Statusline

You can add libmodal modes to your status line by using feline.nvim or galaxyline.nvim or . You can find my configuration for feline.nvim here and galaxyline.nvim here— both of which leverage nvim-libmodal's in the statusbar.

FAQ

nvim-libmodal vs. vim-libmodal

The following is a list of expressions that work in nvim-libmodal but not vim-libmodal:

  • require 'libmodal' in Lua.
    • vim-libmodal does not support interacting with it through Lua, you must use the Vimscript interface.

The following is a list of expressions that work in vim-libmodal but not nvim-libmodal:

  • call libmodal#Enter('FOO', funcref('bar'), baz) in Vimscript.
    • Lua does not support passing funcrefs from Vimscript. Try using the Lua interface instead.
  • call libmodal#Prompt('FOO', funcref('bar'), baz) in Vimscript.
    • Lua does not support passing funcrefs from Vimscript. Try using the Lua interface instead.