FloatRun
FloatRun
是一个能够让你在浮动窗口中运行代码的最小化Neovim插件.
项目地址
https://github.com/StubbornVegeta/FloatRun
安装
对于Packer.nvim
用户:
use {
'StubbornVegeta/FloatRun',
config = function()
require 'module.floatrun'
end,
cmd = {'FloatRun'}
}
配置
在/lua/module/floatrun.lua
中写入以下配置:
local file = vim.api.nvim_buf_get_name(0)
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++ '..file .. ' -Wall -o ' .. vim.fn.expand('%<') .. ' && ./' .. vim.fn.expand('%<'),
['python'] = "python " .. file,
['lua'] = "luafile " .. file,
['sh'] = "sh " .. file,
}
}
用法:
:FloatRun