https://github.com/kurama622/floatrun
A minimize plugin running code in float window
https://github.com/kurama622/floatrun
floating-window nvim nvim-lua nvim-lua-plugin nvim-plugin
Last synced: 23 days ago
JSON representation
A minimize plugin running code in float window
- Host: GitHub
- URL: https://github.com/kurama622/floatrun
- Owner: Kurama622
- License: gpl-3.0
- Created: 2022-06-29T10:44:17.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-08-31T04:44:29.000Z (9 months ago)
- Last Synced: 2024-09-03T16:37:35.952Z (9 months ago)
- Topics: floating-window, nvim, nvim-lua, nvim-lua-plugin, nvim-plugin
- Language: Lua
- Homepage:
- Size: 31.3 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## FloatRun
`FloatRun` is a minimize Neovim plugin that lets you run your code in float window.### FloatRunToggle
### FloatTermToggle
### Installation && Configuration
#### Packer.nvim:
```lua
use {
'Kurama622/FloatRun',
config = function()
require 'module.floatrun'
end,
cmd = {'FloatRunToggle', 'FloatTermToggle'}
}
```Write the following configuration into `~/.config/nvim/lua/module/floatrun.lua`:
```lua
require("FloatRun").setup{
ui = {
relative = "editor", -- win / editor
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",
-- ['lua'] = "luafile %s", -- for nvim's built-in cmd
['sh'] = "sh %s",
[''] = "",
}
}
```#### lazy.nvim
```lua
{
"Kurama622/FloatRun",
cmd = { "FloatRunToggle", "FloatTermToggle" },
opts = function()
return {
ui = {
relative = "editor", -- win / editor
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",
-- lua = "luafile %s", -- for nvim's built-in cmd
sh = "sh %s",
[""] = "",
},
}
end,
keys = {
{ "", mode = { "n", "t" }, "FloatRunToggle" },
{ "", mode = { "n", "t" }, "FloatTermToggle" },
{ "", mode = { "n", "t" }, "FloatTerm" }, -- always create a new terminal
{ "", mode = "t", "FloatTermNext" }, -- switch next terminal
{ "", mode = "t", "FloatTermPrev" }, -- switch prev terminal
},
}
```### Usage:
```
:FloatRunToggle
:FloatTermToggle
```### Refer
- [fm-nvim](https://github.com/is0n/fm-nvim/)