Skip to content

Telescope picker to browse changed files between your current branch and a selected branch

License

Notifications You must be signed in to change notification settings

freestingo/telescope-changed-files

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

telescope-changed-files

This extension will allow you to select for a branch and browse all changed files between your current branch and the selected branch, while previewing diffs for each file.

Install

Configure telescope like this:

-- Lua
local cf_actions = require('telescope').extensions.changed_files.actions

require('telescope').setup {
  pickers = {
    git_branches = {
      mappings = {
        i = {
          ["<a-c>"] = cf_actions.find_changed_files
        }
      }
    }
  }
}

require('telescope').load_extension('changed_files')

This will add a custom mapping only active inside the git_branches builtin Telescope picker while in insert-mode (check :h telescope.setup for more info about custom pickers configuration).

Usage example (following previous config)

  • :Telescope git_branches (or whatever mapping you already set it to)
  • move your selection above the branch you want to reference
  • press <A-c>
  • git_branches picker will close, and the custom changed-files picker will open

General notes

It should be obvious, even after a quick glance at the source code, that I don't really know what the hell I'm doing here. This is my first ever project in lua, but I can already see some additions that would be good for this project (i.e. better and fancier filename viewing). As fun as writing this code was, I have neither the time nor the inclination to give it any more thought starting from the very moment I will press "Commit changes" (aka 30 seconds from now). So, needless to say PRs are very welcome.

About

Telescope picker to browse changed files between your current branch and a selected branch

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 100.0%