Sublime Forum

Ctrl+D is diff!

#1

I just discovered that hitting ^D Sublime Text shows me a diff of my file against the last saved version.

Where is this feature documented? How can I stay up-to-date with new features like this one?

I’m sure there are a thousand more that I am unaware of.

0 Likes

#2

+1 having features and not knowing about it is pretty useless

0 Likes

#3

That’s probably a plugin doing that. Ctrl+d is “find_under_expand” in a normal installation on Linux/Windows. Just check the default key bindings for features: ctrl+shift+p or cmd+shift+p and type key bindings.

0 Likes

#4

If you right click on a modified file you also get the option to see this (“Show Unsaved Changes…”)

0 Likes

#5

This is a nice feature. Reading a diff is ugly if there have been a lot of changes though. I wonder if a plugin to instead show something with appropriate highlighting in the text window would be possible (bonus points for selective undo!)

0 Likes

#6

I discovered this feature a while ago, though I don’t remember how and why.

Anway, the command can be found in Packages/Diff/diff.py (line 40) and is named “diff_changes”. (Just mentioned it here.)

0 Likes