4

kate editor (default kate package on Ubuntu 14.04).

  • Is there a shortcut to "fold/unfold all"?

I found an option in View menu, but it doesn't work as needed.

artm
  • 17,291
  • 6
  • 38
  • 54

2 Answers2

4

I'm one of the Kate developers: Folding toplevel nodes should work as expected through the menu View > Code Folding > Fold Toplevel Nodes.

In the upcoming KDE Frameworks 5.27 release, KTextEditor will additionally have the entry View > Code Folding > Unfold Toplevel Nodes, see this commit.

So right now, you have to wait for the next KDE Frameworks update, which will be released mid of October 2016.

PS: Ubuntu 14.04 is really old. You should consider updating to a more recent version of KDE, best Plasma 5.8 which has long term support (LTS).

dhaumann
  • 1,590
  • 13
  • 25
  • I have a new question for kate on Ubuntu 16.04 - would appreciate if you can have a look: http://stackoverflow.com/questions/40315795/kate-ubuntu-16-04-does-not-have-tab-plugin – artm Oct 29 '16 at 11:09
  • Hello @dhaumann. I am happy to know you are a Kate developper. There is something I have always missed in Kate/Kdevelop: the ability to fold-by-level (somehwat like we have in Notepad++). I can recall I tried the KDE forums some years ago but I has no time to go deeper in code and my request seems to have gathered no much attention. Do you think it would be possible, easy and worth to implement such feature now? Thanks! – j4x Jun 27 '17 at 12:40
  • Hello, I cannot get code folding to work on Kate editor, "show folding markers" is selected, however nothing appears. Could you please help? – Andrew Hardiman Jul 20 '18 at 16:08
  • Far too few information: Maybe highlighting is disabled. Which language? Which version, ... – dhaumann Jul 21 '18 at 18:48
  • @dhaumann, apologies for the late reply, this did not flag up anywhere. The version I am using is 17.12.3. The language is Intel x86 (NASM). `Tools > Highlighting > Assembler` is set to `Intel x86 (NASM)`. As is `Tools > Mode > Assembler`. `View > Code Folding > Show Folding Markers` is selected (ticked). There is a left hand-border showing the line numbers, and a blank column, within the same border, adjacent to the line numbers, which is where I would expect to see the folding markers. Many Thanks. – Andrew Hardiman Aug 19 '18 at 09:03
  • It works! But I am working with LaTeX, and the problem is that Kate does not recognize many of the tags of LaTeX. So, as an example, the \section{} and \subsection{} do not fold, just because Kate does not see those features of LaTeX. How would it be possible to have a better support for LaTeX? – Fabio Nov 07 '22 at 14:43
1

I think you are asking about code folding in Kate if so ,Please try the following shortcuts :

  1. Collapse One Local Level Ctrl+-
  2. Expand One Local Level Ctrl++
  3. Collapse Top level Ctrl+Shift+-
  4. Expand Top level Ctrl+Shift++
thepiyush13
  • 1,321
  • 1
  • 8
  • 9
  • 1
    For some reason, these seem to affect my font size rather than folding, any idea why? thanks. – artm Dec 01 '15 at 04:25
  • Have you modified any shortcuts in the kate settings ? if not I am afraid you might have to change the kate`s default settings file , take a look here : http://ubuntuforums.org/showthread.php?t=967123 – thepiyush13 Dec 01 '15 at 04:31