diff options
| author | Franck Cuny <franckcuny@gmail.com> | 2016-07-02 20:04:59 -0700 |
|---|---|---|
| committer | Franck Cuny <franckcuny@gmail.com> | 2016-07-02 20:04:59 -0700 |
| commit | 8f187c573954b6c8d1650ac33a164c52e032ac16 (patch) | |
| tree | c605d0cf51d272393006e5486bfdc24984cf801f /_posts/2008-12-05-vim-and-git.md | |
| parent | Update some posts to make the tests pass. (diff) | |
| download | lumberjaph-8f187c573954b6c8d1650ac33a164c52e032ac16.tar.gz | |
Stop using Jekyll.
Moving away from Jekyll to Hugo. This commit clean up the old files to
prepare for the migration.
Diffstat (limited to '_posts/2008-12-05-vim-and-git.md')
| -rw-r--r-- | _posts/2008-12-05-vim-and-git.md | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/_posts/2008-12-05-vim-and-git.md b/_posts/2008-12-05-vim-and-git.md deleted file mode 100644 index e9c9370..0000000 --- a/_posts/2008-12-05-vim-and-git.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -layout: post -summary: In which I share another snippet of code for vim. -title: vim and git -type: codex ---- - -idea from [Ovid's journal](http://use.perl.org/use.perl.org/_Ovid/journal/37966.html) (ovid is full of really good ideas for vim): - -to get a quick git diff in my vim session, put this in your .vimrc - -{% highlight vim %} -map ,gh :call SourceDiff() " gh for git history - -function! SourceDiff() - let filename = bufname("%") - let command = 'git log -5 --pretty=format:"%h - (%ar) %an - %s" "'.filename.'"' - let result = split( system(command), "\n" ) - - if empty(result) - echomsg("No past revisions for " . filename) - return - endif - - " get the list of files - let revision = PickFromList('revision', result) - - if strlen(revision) - let items = split(revision, " ") - execute '!git diff ' . items[0] . ' -- "' . filename .'" | less' - endif -endfunction -{% endhighlight %} - -the output looks like this: - - Choose a revision: - 1: ea0bb4d - (3 days ago) franck cuny - fix new_freq - 2: a896ac7 - (5 weeks ago) franck cuny - fix typo - 3: c9bc5fd - (5 weeks ago) franck cuny - update test - 4: e9de4be - (5 weeks ago) franck cuny - change the way we rewrite and check an existing url - 5: 3df1fd6 - (7 weeks ago) franck cuny - put id category - -You choose the revision you want to check the diff against, and you got a (colorless) diff in your vim buffer. |
