Skip to content

zschreur/telescope-jj.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

telescope-jj.nvim

A Telescope picker for Jujutsu repos.

Setup

Using lazy.nvim

'zschreur/telescope-jj.nvim'

Using vim-plug

Plug 'zschreur/telescope-jj.nvim'

Using dein

call dein#add('zschreur/telescope-jj.nvim')

Using packer.nvim

use {
  'zschreur/telescope-jj.nvim'
}

Load the extension in your config with:

telescope.load_extension("jj")

Example

{
    "zschreur/telescope-jj.nvim",
    config = function()
        telescope.load_extension "jj"
    end,
},

Usage

-- opts is optional telescope picker options

telescope.extensions.jj.conflict(opts) -- list files with conflicts
telescope.extensions.jj.diff(opts) -- list files with differences (like jj status)
telescope.extensions.jj.files(opts) -- list all files in repo

Git fallback

The example below includes a fallback to the default git_files picker if the jj picker fails.

local builtin = require("telescope.builtin")
local telescope = require("telescope")

telescope.load_extension("jj")

local vcs_picker = function(opts)
    local jj_pick_status, jj_res = pcall(telescope.extensions.jj.files, opts)
    if jj_pick_status then
        return
    end

    local git_files_status, git_res = pcall(builtin.git_files, opts)
    if not git_files_status then
        error("Could not launch jj/git files: \n" .. jj_res .. "\n" .. git_res)
    end
end

vim.keymap.set("n", "<C-p>", vcs_picker, {})

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages