Skip to content

Easily customize lists of actions based on filetypes in nvim.

License

Notifications You must be signed in to change notification settings

Walcriz/action-lists.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Action lists

A simple plugin that offers a straightforward solution to create lists of actions that can dynamically adapt based on filetypes

Soft dependencies

Dressing and Telescope

Setup

require("action_lists").setup({
    lists = {
        simple = { -- A simple list of actions that can be used from any file
            actions = { -- Actions can have any name that can be used in lua tables
                test = 'echo "test"',
                tsupdate = 'TSUpdate',
                lua = 'lua print("From lua!")',

                func = function() -- Actions also support functions
                    print("Hello from a function")
                end,

                -- You can also have actions with spaces in them
                ["Action with space"] = 'echo "Action with space"',
            },
        },

        multiple = { -- A dynamic action list that contains sub lists
            all = { -- Sub list that can be used from any file
                actions = {
                    all = 'lua print("This can be ran from any file!")',
                },
            },
            go = { -- Sub list that only can be used from go files
                ft = { "go" },
                actions = {
                    run = 'lua print("This can only be ran from go files!")',
                },
            },
        },
    },
})

Open an action list

:OpenActionList <list>

" For example
:OpenActionList simple

About

Easily customize lists of actions based on filetypes in nvim.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published