About: Jump to file from CVSDiff output   Sponge Permalink

An Entity of Type : owl:Thing, within Data Space : 134.155.108.49:8890 associated with source dataset(s)

I always want to jump from the diff to the corresponding line in the original file. So I wrote a small script that does that, and put it in .vim/after/ftplugin/diff.vim Pressing Enter will execute that script. For the reverse operation (get a diff for the current buffer), see VimTip1030.

AttributesValues
rdfs:label
  • Jump to file from CVSDiff output
rdfs:comment
  • I always want to jump from the diff to the corresponding line in the original file. So I wrote a small script that does that, and put it in .vim/after/ftplugin/diff.vim Pressing Enter will execute that script. For the reverse operation (get a diff for the current buffer), see VimTip1030.
Version
  • 6(xsd:integer)
dbkwik:vim/property/wikiPageUsesTemplate
Previous
  • 490(xsd:integer)
Author
  • daniel kullmann
Complexity
  • basic
Created
  • 2003(xsd:integer)
ID
  • 492(xsd:integer)
NEXT
  • 493(xsd:integer)
Rating
  • 1(xsd:integer)
abstract
  • I always want to jump from the diff to the corresponding line in the original file. So I wrote a small script that does that, and put it in .vim/after/ftplugin/diff.vim Pressing Enter will execute that script. function! DiffJumpToFile() let a=line(".") " current line number let b=search("^\\(---\\|\\*\\*\\*\\) ", "b") " search for line like *** 478,489 *** let c=getline(b) " get this line as string let d=strpart(c, 4, match(c, ",")-4) " get the first line number (478) from that string let f=search("^\\(---\\|\\*\\*\\*\\) .*\ ", "b") " search for line like *** fileincvs.c .... let g=getline(f) " get this line as string let h=match (g, "\ ", 4) " look for end of filename (terminated by tab) in string let i=strpart(g, 4, h-4) " get the filename execute ":b " . i | " change to that file execute "normal " . (d+a-b-1) . "G" | " go to right line number endfunction nmap :call DiffJumpToFile() For the reverse operation (get a diff for the current buffer), see VimTip1030.
Alternative Linked Data Views: ODE     Raw Data in: CXML | CSV | RDF ( N-Triples N3/Turtle JSON XML ) | OData ( Atom JSON ) | Microdata ( JSON HTML) | JSON-LD    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3217, on Linux (x86_64-pc-linux-gnu), Standard Edition
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2012 OpenLink Software