Skip to content

Instantly share code, notes, and snippets.

View soheil's full-sized avatar

Soheil Yasrebi soheil

View GitHub Profile
@soheil
soheil / git-diff-by-line.md
Last active December 11, 2020 03:07
Git diff by line in Sublime Text

This allows you to simply select the lines and press CMD+L to see the diff. Create a file named git-log.py in your Sublime Packages/User directory with:

import sublime
import sublime_plugin

class GitLogLineCommand(sublime_plugin.WindowCommand):
    def run(self, reverse=False):
        view = self.window.active_view()
 sel = view.sel()[0]