![]() Registered Member ![]()
|
Hi all,
I am trying to add functionality to Kate but although I see documentation I am missing some info to start. As an example, I'd like to create a script to surround the selected text in the editor with underscores, so it's in italics in a Markdown document, and then assign a shortcut Ctrl-Shift-I to that script. First of all, I am on Ubuntu 20 with XFCE, using Kate 19.12.3 with KatePart 5.68.0. The $XDG_DATA_HOME variable is not set and I cannot find anything on indentation. I have one instance of katepart5 and that is the folder /usr/share/katepart5 which has a sub folder scripts that is empty. Under Tools > Scripts there are Emmet, Navigation, Quick Coding, and Editing. And there is Tools > External Tools, which I see are configured in the Setting > Configure Kate > External Tools. My questions are: Using the kjs/KateScript/javascript sounded easiest, but where do the files go? I assume these will show up under Scripts. Is that correct? Is there a way to group any more scripts like Emmet, Navigation, etc.? Shouldn't the scripts already in the menu be somewhere on disc? I also read this: "Developing an indenter requires reloading the scripts to see whether the changes behave appropriately. Instead of restarting the application, simply switch to the command line and invoke the command reload-scripts." That "the command line" - is that Tools > Focus Terminal? It will show a docked window but no terminal there. Reloading scripts without having to close and reopen Kate would be very nice, of course. I hope someone can help give me a few tips on how to get started. |
![]() Registered Member ![]()
|
Hello! I also like to add commands to Kate.
Scripts (*.js files) must be placed in the directory ~/.local/share/katepart5/script/commands For convenience, I created a link to it inside Documents folder. You can of course create groups for your scripts. This is set in the script itself:
https://docs.kde.org/stable5/en/applica ... pting.html |
![]() Registered Member ![]()
|
This refers to the Command line from the View menu (F7). Try to press F7 and enter help or help list. |
![]() Registered Member ![]()
|
I made a draft, saved it as a file ~/.local/share/katepart5/script/commands/markdown.js and run command reload-scripts - it works!
|
Registered users: allirion, Baidu [Spider], Bing [Bot], duns, Google [Bot], Ignacio Serantes, markhm, mfraser, rblackwell, Sogou [Bot], Termy, terra, thunder422, tubbadu, Yahoo [Bot]