Kate and `switch` in menu under right

Hi.

RMB on word and if word is in list in Kate configuration:

True / False

true / false

On / Off

Mark / Unmark

etc.

Should switch in place that word with the other one.

Another idea: goto in text:

goto:352345234

dobleclick on it (or RMB menu) and Kate jump to:

here:352345234

Probably can be done with scripts?

Radek Glebicki

Your post is tough to understand, I assume you don’t know how markdown or formatting works…


Radek
11h

Hi.

RMB on word and if word is in list in Kate configuration:

True / False

true / false

On / Off

Mark / Unmark

etc.

Try to explain what this means in English, it makes no sense to me.

The context menu (from RMB) has many options.

Well you can simply copy the text 352345234 and then press CtrlF and paste that text to find it in your document.

For Kate scripting, you can start with the Kate Handbook… you can extend Kate with JavaScript scripting and C++ plugins.

But hold on, maybe there’s a gap in documentation…

https://userbase.kde.org/Kate/Scripting

if you don’t understand I am sorry. And those colors so pretty. Good job.

Radek Glebicki

1 Like

Ok. I did it with bash and External tools:

#!/bin/bash
# name: trueFalse.bsh

if [[ $1 == "True" ]] ; then
	echo -n False
	exit
fi
if [[ $1 == "False" ]] ; then
	echo -n True
	exit
fi

then in External tools:

Blue is (Output), I think from Polish will be: Replace selected text

And then I add to Toolbar:

Double click on True or False, is selected and then click button and is switching.

And there is on the left side: Jump2line

#!/bin/bash
# name: kateJump2line.bsh

myVAR=$(wl-paste)

if [[ $myVAR =~ ^[0-9]+$ ]] ; then # checking if myVAR is number
	kate -l $myVAR
fi

In terminal in Kate I have option click to mark and copy to clipboard then I click on number of line with error in terminal, number is copy to Clipboard and push button and Kate jumping to line with error. Very useful.

Radek Glebicki

1 Like