Giter Site home page Giter Site logo

telescope-cc.nvim's Introduction

telescope-cc.nvim

A Telescope integration of Conventional Commits.

demo

Installation

# vim-plug
Plug 'olacin/telescope-cc.nvim'

# packer
use 'olacin/telescope-cc.nvim'

# lazy.nvim
{ "olacin/telescope-cc.nvim" }

Usage

# As a command
:Telescope conventional_commits

# As a lua function
require('telescope').extensions.conventional_commits.conventional_commits()

Configuration

You can customize action on selection within Telescope setup() function.

telescope.setup({
    ...
    extensions = {
        conventional_commits = {
            theme = "ivy", -- custom theme
            action = function(entry)
                -- entry = {
                --     display = "feat       A new feature",
                --     index = 7,
                --     ordinal = "feat",
                --     value = feat"
                -- }
                vim.print(entry)
            end,
            include_body_and_footer = true, -- Add prompts for commit body and footer
        },
    },
})

telescope.load_extension("conventional_commits")

Default action

Default action is cc_actions.commit and can be found here.

Include body and footer

The easiest way is to add include_body_and_footer within telescope setup like shown above.

If however you wish to do something more advanced, you can create a command to initiate the extension with the include_body_and_footer flag.

local function create_conventional_commit()
    local actions = require("telescope._extensions.conventional_commits.actions")
    local picker = require("telescope._extensions.conventional_commits.picker")
    local themes = require("telescope.themes")

    -- if you use the picker directly you have to provide your theme manually
    picker({
        action = actions.prompt,
        include_body_and_footer = true,
        -- theme = themes["get_ivy"]() -- ivy theme
    })
end

vim.keymap.set(
  "n",
  "cc",
  create_conventional_commit,
  { desc = "Create conventional commit" }
)

telescope-cc.nvim's People

Contributors

joaovfsousa avatar olacin avatar olacin-dd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

telescope-cc.nvim's Issues

theme option not working

For some reason unknown to me, all telescope extensions work with the theme option, except telescope-cc.
Everything in the extension seems to work as it should, except this option.

This is my configuration:

{
  defaults = {
        ...
  },

  extensions = {
        fzf = {
          fuzzy = true,
          override_generic_sorter = true,
          override_file_sorter = true,
          case_mode = "smart_case",
        },
        conventional_commits = {
          theme = "dropdown",
          action = function()
            local actions = require "telescope._extensions.conventional_commits.actions"
            return actions.prompt
          end,
          include_body_and_footer = true,
        },
        ["ui-select"] = {
          require("telescope.themes").get_dropdown {},
        },
        file_browser = {
          theme = "dropdown",
          hijack_netrw = true,
        },
  },
}

Edit: It works fine running :Telescope conventional_commits theme=dropdown

Fails when used with `dressing.nvim`

dressing.nvim replaces native vim.ui.input.

When plugin is called, two input windows are overlaid or even replaced and nothing happens after entering.

It seems like it's impossible to have two dressing input windows at the time.

Example Screencast?

This looks interesting can you post a short showcase? Would help me understand how this works, if I can do without it or if this will boost my productivity.

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.