____ ____ ____ _ _ __ ____ _ _
(_ _)( __)( _ \( \/ )( )( __)( \/ )
)( ) _) ) // \/ \ )( ) _) ) /
(__) (____)(__\_)\_)(_/(__)(__) (__/
termify.nvim
is a simple plugin for Neovim, written completely in Lua.
It provides the capability to run any script directly in your favorite editor
and displays the output in a disposable pop-up window. Termify is customizable
and allows to be extended to any scripting runtime.
showcase-dart.mp4
An example of previewing markdown files via the wonderful Glow reader.
showcase-markdown.mp4
Using vim-plug
Plug 'dgyurov/termify.nvim'
Using dein
call dein#add('dgyurov/termify.nvim')
Using packer.nvim
use 'dgyurov/termify.nvim'
Termify comes with the following default configuration:
{
-- A table which has file types as keys and executable as value
-- Note: The executables should be already installed on your system and
-- be capable of accepting a file path as an argument. The file path will be
-- supplied by Termify.
supportedFiletypes = {
['swift'] = "swift",
['dart'] = "dart",
['python'] = "python",
['lua'] = "lua",
['md'] = "glow",
},
-- Key that can be used to close the Termify window.
closeMappings = { '<esc>', 'q' },
-- Border style of the Termify window.
-- Possible values: 'none', 'single', 'double', 'rounded', 'solid', 'shadow'
borderStyle = 'rounded'
}
You can override any of the default values by calling the setup function.
require 'termify'.setup {
-- You can pass your configuration here
}
You can open Termify by calling the following Lua function:
require 'termify'.run()
For you convenience you can consider binding it to a keymap. The following keymap for example will save the current file and then run it in Termify.
vim.api.nvim_set_keymap(
'n',
'<leader>p',
'<cmd>silent w<CR><cmd>lua require"termify".run()<CR>',
{ noremap = true }
)
Made with love and tears on a Chromebook tablet.