Comments (12)
So here is what I came up with:
function! s:gl(buf, l1, l2)
if !exists(':Gllog')
return
endif
tab split
silent! execute a:l1 == 1 && a:l2 == line('$') ? '' : "'<,'>" 'Gllog'
call setloclist(0, insert(getloclist(0), {'bufnr': a:buf}, 0))
b #
lopen
xnoremap <buffer> o :call <sid>gld()<cr>
nnoremap <buffer> o <cr><c-w><c-w>
nnoremap <buffer> q :tabclose<cr>
call matchadd('Conceal', '^fugitive:///.\{-}\.git//')
call matchadd('Conceal', '^fugitive:///.\{-}\.git//\x\{7}\zs.\{-}||')
setlocal concealcursor=nv conceallevel=3 nowrap
endfunction
function! s:gld() range
let [to, from] = map([a:firstline, a:lastline], 'split(getline(v:val), "|")[0]')
execute 'tabedit' to
execute 'vsplit' from
windo diffthis
endfunction
command! -range=% GL call s:gl(bufnr(''), <line1>, <line2>)
:GL
will open a new tab, pressing o over a visual range of revisions will show the split diff between the top and the bottom.
EDIT: Added support for range
from gv.vim.
You can already do that with fugitive.vim.
from gv.vim.
Yes, but gitv makes it easy to compare revisions whilst browsing through the revisions.
from gv.vim.
You can list the commits for the current file only with :GV!
, but no, there's no such "file mode".
:Glog
from fugitive gives a similar view, so maybe we can think of a solution based on it.
Related? tpope/vim-fugitive#329
from gv.vim.
That sounds like what I'm looking for.
Thanks.
from gv.vim.
Also remembered that I liked that bit from gitv. I'll let you know if I come up with something.
from gv.vim.
Awesome, thanks.
from gv.vim.
Thanks! Did you add this to the code?
from gv.vim.
Haven't decided if I should add this to gv.vim or not. I currently have it on my vimrc.
from gv.vim.
It is an extra feature that adds functionality to the plugin why would you not?
Meanwhile I'll keep it in my vimrc.
Thanks.
from gv.vim.
Because in principle it's an extension of fugitive rather than gv.
from gv.vim.
Isn't that what GV is?
from gv.vim.
Related Issues (20)
- :GV outputs Unkown function: FugitiveShellCommand HOT 2
- Syntax is gone after FileType autocmd HOT 2
- Error `no previous directory` HOT 1
- How to open a commit with diffview.nvim? HOT 2
- Highlight log line that is currently open (or the last opened)
- :w creates a file named `p --graph` HOT 2
- fugitive#repo().tree() has been replaced by FugitiveFind(":/") HOT 1
- Fix tab completion with latest Fugitive HOT 2
- Reverse range in character class HOT 1
- Using <q> to quit disables command history editing <q-:> HOT 1
- Cursor cannot move over some commits HOT 1
- Question: fill location list with list of revisions passed as argument HOT 1
- reverse the commit order HOT 1
- Diff command/pager settings HOT 2
- Use author rather than commiter HOT 2
- :Gbrowse is deprecated in favor of :GBrowse, fix it to GBrowse? HOT 1
- Add mapping to open commit in preview window HOT 1
- VIRA-283: Syntax for code highlighting
- [Question] is it possible to auto show diff and changed files like agit.vim?
- Error after fugitive update
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gv.vim.