A small tool to help you temporarily clone repositories to navigate in nvim.
Motivation: Navigating code via Github or derivatives is annoying, most developers whom use nvim will surely have a local workflow for navigating code which is superior to browser based methods.
This plugin offers the following functionality:
- Clone repos into a temporary data folder (via
TmpcloneClone) - Navigate those repositories with all nvim tooling (via
TmpcloneOpen) - Remove cloned repos when they are no longer needed (via
TmpcloneRemove) - (TODO Roadmap) Seemlessly switch working directories between "local" files and cloned repositories by meddling with the working directory under the hood.
A normal workflow would be cloning a repository via TmpcloneClone, opening it up with
TmpcloneOpen and however long later get rid of it via TmpcloneRemove.
Install with your favorite Neovim package manager, here is and example using
packer.nvim.
use {'danielhp95/tmpclone-nvim',
requires = {'nvim-lua/plenary.nvim', 'nvim-telescope/telescope.nvim'},
}Be sure to call require("tmpclone").setup function before using tmpclone.
if you wish to change the default configuration or register the user commands.
Defaults and options are presented here:
require("tmpclone").setup({
datadir = vim.fn.stdpath('data') .. '/tmpclone-data'
})Some basic keymaps for both vimscript and lua could be:
nnoremap <leader>tc :TmpcloneClone<cr> " Or :lua require("tmpclone.core").clone()<cr>
nnoremap <leader>to :TmpcloneOpen<cr> " Or :lua require("tmpclone.core").open_repo()<cr>
nnoremap <leader>tr :TmpcloneRemove<cr> " Or :lua require("tmpclone.core").remove_repo()<cr>[ ] - Seemlessly switch working directories between "local" files and cloned repositories by meddling with the working directory under the hood.