Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/notomo/piemenu.nvim
Pie menu plugin for neovim
https://github.com/notomo/piemenu.nvim
neovim neovim-plugin
Last synced: 3 months ago
JSON representation
Pie menu plugin for neovim
- Host: GitHub
- URL: https://github.com/notomo/piemenu.nvim
- Owner: notomo
- License: mit
- Created: 2021-07-24T05:24:18.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-22T11:31:52.000Z (7 months ago)
- Last Synced: 2024-04-22T12:49:34.530Z (7 months ago)
- Topics: neovim, neovim-plugin
- Language: Lua
- Homepage:
- Size: 163 KB
- Stars: 94
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# piemenu.nvim
piemenu.nvim is a circular menu plugin for Neovim (nightly).
## Example
```lua
vim.opt.mouse = "a"local group = vim.api.nvim_create_augroup("piemenu_setting", {})
vim.api.nvim_create_autocmd({ "FileType" }, {
group = group,
pattern = { "piemenu" },
callback = function()
vim.o.mousemoveevent = true
vim.keymap.set("n", "", [[lua require("piemenu").highlight()]], { buffer = true })
vim.keymap.set("n", "", [[lua require("piemenu").highlight()]], { buffer = true })
vim.keymap.set("n", "", [[lua require("piemenu").finish()]], { buffer = true })
vim.keymap.set("n", "", [[lua require("piemenu").cancel()]], { buffer = true })
end,
})vim.keymap.set("n", "", [[lua require("piemenu").start("example")]])
require("piemenu").register("example", {
menus = {
{
text = "📋 copy",
action = function()
vim.cmd.normal({ args = { "yy" }, bang = true })
end,
},
{
text = "📝 paste",
action = function()
vim.cmd.normal({ args = { "p" }, bang = true })
end,
},
{
text = "✅ save",
action = function()
vim.cmd.write()
end,
},
{
text = "👉 goto file",
action = function()
vim.cmd.normal({ args = { "gF" }, bang = true })
end,
},
{
text = "📚 help",
action = function()
vim.cmd.help(vim.fn.expand(""))
end,
},
{
text = "❌ close",
action = function()
vim.cmd.quit()
end,
},
},
})-- start by gesture.nvim (optional)
local piemenu = require("piemenu")
local gesture = require("gesture")
gesture.register({
name = "open pie menu",
inputs = { gesture.up() },
action = function(ctx)
piemenu.start("gesture_example", { position = ctx.last_position })
end,
})piemenu.register("gesture_example", {
menus = {
{
text = "🆕 new tab",
action = function()
vim.cmd.tabedit()
end,
},
{
text = "🏠 open vimrc",
action = function()
vim.cmd.edit(vim.env.MYVIMRC)
end,
},
{
text = "🔃 reload",
action = function()
vim.cmd.edit({ bang = true })
end,
},
{
text = "😃 smile",
action = function()
vim.cmd.smile()
end,
},
},
})
```