Giter Site home page Giter Site logo

profiles.nvim's Introduction

profiles.nvim

This plugin allows you to easily access commands that you want to run for the project at hand.

Be it builds, tests, running the project, or whatever.

Lazy setup

return {
    "mbwilding/profiles.nvim",
    dependencies = {
        "nvim-lua/plenary.nvim",
        "nvim-telescope/telescope.nvim",
        "akinsho/nvim-toggleterm.lua"
    },
    config = function()
        local profiles = require("profiles")

        -- Select from your profiles in '.nvim'
        vim.keymap.set("n", "<leader>p", function()
            profiles.select_profile()
        end, { desc = "Profiles: Select Local" })

        -- Select from generic profiles (tailored via file patterns)
        vim.keymap.set("n", "<leader>P", function()
            profiles.select_default_profile()
        end, { desc = "Profiles: Select Default" })
    end,
}

Example

Here is an example profile in the .nvim directory sitting in the current working directory: .nvim/Example.lua

For example, this will show as Example in the Profiles list in Telescope.

return {
    -- Terminal commands will open in ToggleTerm
    -- Specify which terminal will run what set of commands
    terminal_commands = {
        [1] = {
            "dotnet restore",
            "dotnet build",
        },
        [2] = {
            "echo 'Hello, World!'"
        }
    },
    -- OS commands will open a program
    -- For example, a web page if you are spinning up an API
    os_commands = {
        "calc.exe",
        "notepad.exe"
    },
    -- Environment Variables
    -- This will set the environment vars prior to running the commands
    environment_vars = {
        ["THIS_IS_THE_KEY"] = "This is the value",
        ["THIS_IS_ALSO_A_KEY"] = "This is also a value",
    }
}

profiles.nvim's People

Contributors

mbwilding avatar

Stargazers

Yuta Katayama avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.