It's not a built-in feature
I don't think this is a built-in feature of Kate, so you will have to use some other kind of diff tool to do what you want.
I was also interested in a better answer to your question, so I did some research. There are some workarounds to do what you want...
Relevant StackOverflow question, basically about what you want to do:
How do I show the changes which have been staged?
Use a diff tool in Kate
- Use the built-in Terminal in Kate (Linux only)
For a similar diff
GUI to Kate, you can use KDE's "Kompare" which should be in the repos of most distros.
Kompare Manual
You can start Kompare from the terminal in Kate.
cd
to your local git repo, then
git diff --cached | kompare -o -
- Use the Build Plugin (cross-platform)
There is another, more convenient workaround to start Kompare in Kate, using the Build Plugin. This also works in the Windows version of Kate which has no terminal. It also saves you from having to type the commands into the terminal every time, shortening the action to open Kompare to the click of a button.
Here is an imgur album, describing the necessary steps.
Create an extension for Kate
It may be possible to create an extension for Kate to add the ability to use it as a diff tool, although this would certainly be a lot of work.
You could start here: Kate Manual, Chapter 6: Extending Kate
Other diff tools
There are many options and opinions on diff tools for Linux and windows, as you can see from these answers:
Graphical diff tools in Linux
"Diffuse" and "Meld" look pretty good.
Of course diff
can also be used from the command line. There are variations like vimdiff
and colordiff
with additional functionality.
Or use a different text editor
You could also try out some other full-featured GUI text editor with a diff feature or better extensibility. Some good cross-platform choices are:
- VS Code (official Microsoft version)
- VS Codium (FOSS version of VS Code)
- Atom
- Geany
Extensible editors for the command line are Vim and Emacs.
Side Note
As I found out in this old Gentoo Forum thread, there used to be an "External Tools" plugin for Kate that allowed you to add custom commands to kate that could be executed with a user-defined keyboard shortcut. It worked like this (maybe it will work again some day?):
Settings->Configure Kate->External Tools
Click New
Fill in some label
For the script, enter these two lines:
cd %directory
git diff --cached | kompare -o -
Executable: kompare
Save: Current Document
CMI: "name"
Too bad that the "External Tools" plugin has been discontinued...
KDE is looking for a Maintainer to reintroduce this useful feature...