Skip to content

Termify is a simple Neovim plugin that enables you to run and read the output of a script in a disposable popup window.

License

Notifications You must be signed in to change notification settings

dgyurov/termify.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

                 ____  ____  ____  _  _  __  ____  _  _ 
                (_  _)(  __)(  _ \( \/ )(  )(  __)( \/ )
                  )(   ) _)  )   // \/ \ )(  ) _)  )  / 
                 (__) (____)(__\_)\_)(_/(__)(__)  (__/  
           

termify.nvim

What is Termify?

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.

Table of Contents

Showcase

Running a Dart file

showcase-dart.mp4

Running a Markdown file

An example of previewing markdown files via the wonderful Glow reader.

showcase-markdown.mp4

Installation

Using vim-plug

Plug 'dgyurov/termify.nvim'

Using dein

call dein#add('dgyurov/termify.nvim')

Using packer.nvim

use 'dgyurov/termify.nvim' 

Configuration

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
}

Usage

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 }
)

Credits

Made with love and tears on a Chromebook tablet.

About

Termify is a simple Neovim plugin that enables you to run and read the output of a script in a disposable popup window.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages