Need help with tig-explorer.vim?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

iberianpig
148 Stars 11 Forks MIT License 80 Commits 6 Opened issues

Description

Vim plugin to use Tig as a git client. Seamless switching between vim and Tig with opening in the same buffer.

Services available

!
?

Need anything else?

Contributors list

# 33,428
touchpa...
libinpu...
Linux
solidit...
51 commits
# 525,834
Vim
vim-plu...
Neovim
neovim-...
3 commits
# 166,900
Clojure
CSS
nrepl
leining...
3 commits
# 80,314
HTML
golang-...
yaml-pa...
Neovim
2 commits
# 231,991
Vim
CSS
HTML
license...
2 commits
# 150,566
Neovim
dispatc...
coc
Vue.js
1 commit
# 287,297
python3
type-ch...
Vim
hal
1 commit

tig-explorer.vim

Vim plugin to use Tig as a git client. * Seamless switching between Vim and Tig * Adding buffer in the same process not a child of Tig process. * Open files in tabs or in vertically / horizontal split windows on Vim from Tig * Dynamically defining keymaps on Tig * Support Vim8 / NeoVim terminal * Open diff-mode side by side at the selected commit from Tig

https://gyazo.com/181fef546cced7ca6dc651dff59cd1bf

Requirement

  • tig(https://github.com/jonas/tig)

Installation

" vim-plug
Plug 'iberianpig/tig-explorer.vim'

" NeoBundle NeoBundle 'iberianpig/tig-explorer.vim'

NOTE: If you use Neovim, you have to add the dependency to the plugin bclose.vim:

" vim-plug
Plug 'rbgrouleff/bclose.vim'

" NeoBundle NeoBundle 'rbgrouleff/bclose.vim'

Usage

Keymap on Tig

Following commands are available on tig launched from tig-explorer ``` e, : edit on existing tab : edit on new tab : edit with vsplit window : edit with split window

o: open with commit on existing tab t: open with commit on new tab v: open with commit with vsplit window s: open with commit with split window ```

When a commit is available (in main, blame, tree, refs view) view, the version of the file corresponding to this commit will be open instead of the version in the working directory. Split versions will open the two buffer in diff mode.

Customize Keymap on Tig

Following keymap is defined as defaut

let g:tig_explorer_keymap_edit_e  = 'e'
let g:tig_explorer_keymap_edit    = ''
let g:tig_explorer_keymap_tabedit = ''
let g:tig_explorer_keymap_split   = ''
let g:tig_explorer_keymap_vsplit  = ''

let g:tig_explorer_keymap_commit_edit = 'o' let g:tig_explorer_keymap_commit_tabedit = 't' let g:tig_explorer_keymap_commit_split = 's' let g:tig_explorer_keymap_commit_vsplit = 'v'

Keymap on Vim

Add following script to ~/.vimrc

" open tig with current file
nnoremap T :TigOpenCurrentFile

" open tig with Project root path nnoremap t :TigOpenProjectRootDir

" open tig grep nnoremap g :TigGrep

" resume from last grep nnoremap r :TigGrepResume

" open tig grep with the selected word vnoremap g y:TigGrep"

" open tig grep with the word under the cursor nnoremap cg ::TigGrep

" open tig blame with current file nnoremap b :TigBlame

Other options

By default tig-explorer will use the builtin terminal if available. To force launching tig-explorer as shell command you can add the following to ~/.vimrc

" don't use builtin terminal
let g:tig_explorer_use_builtin_term=0

Support

Patreon

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.