Skip to content

StubbornVegeta/FloatRun

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 

Repository files navigation

FloatRun

FloatRun is a minimize Neovim plugin that lets you run your code in float window.

FloatRunToggle

FloatRunToggle

FloatTermToggle

FloatTermToggle

Installation && Configuration

Packer.nvim:

use {
        'StubbornVegeta/FloatRun',
        config = function()
            require 'module.floatrun'
        end,
        cmd = {'FloatRunToggle', 'FloatTermToggle'}
    }

Write the following configuration into ~/.config/nvim/lua/module/floatrun.lua:

require("FloatRun").setup{
    ui = {
        border = "single",
        float_hl = "Normal",
        border_hl = "FloatBorder",
        blend = 0,
        height = 0.8,
        width = 0.8,
        x = 0.5,
        y = 0.5
    },
    run_command = {
        ['cpp'] = 'g++ -std=c++11 %s -Wall -o {} && {}',
        ['python'] = "python %s",
        ['lua'] = "lua %s",
        ['sh'] = "sh %s",
        [''] = "",
    }
}

lazy.nvim

{
  "StubbornVegeta/FloatRun",
  cmd = { "FloatRunToggle", "FloatTermToggle" },
  opts = function()
    return {
      ui = {
        border = "single",
        float_hl = "Normal",
        border_hl = "FloatBorder",
        blend = 0,
        height = 0.5,
        width = 0.9,
        x = 0.5,
        y = 0.5,
      },
      run_command = {
        cpp = "g++ -std=c++11 %s -Wall -o {} && {}",
        python = "python %s",
        lua = "lua %s",
        sh = "sh %s",
        [""] = "",
      },
    }
  end,
  keys = {
    { "<F5>", "<cmd>FloatRunToggle<cr>" },
    { "<F2>", mode = { "n", "t" }, "<cmd>FloatTermToggle<cr>" },
  },
}

Usage:

:FloatRunToggle
:FloatTermToggle

Refer

About

A minimize plugin running code in float window

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages