17

I use Kate for coding and note-taking. Sometimes it crashes - often when I've got a lot open. Unsaved 'real' documents (eg, ones backed by files, that have been saved at some point) usually have a backup/autosave type recovery file, that more-or-less works. Unfortunately, I've gotten in the habit of using untitled buffers (eg, pressing Ctrln in Kate) to store temporary notes.

Kate just crashed and I lost half a dozen of these. Does Kate store backups for 'new' files anywhere? I checked, ~/.kde/share/apps/kate/ and didn't see anything obvious ...

kate-editor 3.8.5
KDE 4.8.5
Ubuntu 12.04 (Don't remember if Kubuntu or Ubuntu + KDE, in case that makes a difference)
hunter2
  • 397
  • 1
  • 3
  • 15
  • What made you think it's possible to recover? – daisy Mar 25 '13 at 08:09
  • How do I not have 'tumbleweed' for this? (I'd prefer an answer, just sayin ....) – hunter2 May 29 '13 at 07:48
  • Best place to ask for this feature is kde's bugzilla. – sendmoreinfo Jun 06 '13 at 21:12
  • Maybe, or Kate's or (K)Ubuntu's. Unless you had a specific link? – hunter2 Jun 07 '13 at 05:00
  • 1
    Yeah, guess I didn't catch what you meant - I was asking if this is an extant feature, not asking for it to be added. And, although it seems like it would be an easy one to add (the buffer is already somewhere, right?), for my purposes I think breaking a dumb habit is easier than submitting a feature request on this one. – hunter2 Jul 01 '13 at 09:49
  • @hunter2 I use Kate like you do on Kubuntu 12.04 and it almost never crashes. I had my first crash (since 12.04 beta came out around 16 months ago) about a week ago. Other than that episode (where Kate crashed twice) it had never crashed before and it has not crashed since. Maybe you need to investigate why Kate is crashing on you. – MountainX Jul 18 '13 at 23:20
  • @MountainX Yeah, fair point. I haven't had a crash in a while, though, and don't remember any particularly repeatable ways to make it crash. For me, I'm just trying to break/stay out of the habit (and mostly succeeding). I do have a couple other, more severe (whole-system) crash problems that I need to diagnose, but that's another issue ... – hunter2 Jul 19 '13 at 05:48
  • Unrelated to your topic, but since this result is high up on Google when you search "Kate crashes save", try installing kdelibs5-plugins with `sudo apt-get install kdelibs5-plugins` if Kate crashes whenever you try to save or open a file. – Pikamander2 Apr 18 '16 at 05:24

3 Answers3

16

Being one of the Kate Developers, I can explain the workflow like this:

When Kate or the system crashes, you loose all text buffers that were never saved. However, if you are working on a text file (that exists as file on disk), a swap file is created next to the file, called .filename.kate-swp. Now, if Kate starts again, Kate searches for these swap files. If found it replicates all edit actions that were recorded in this swap file, and your data is fully restored.

Rule of thumb: Always (and I repeat: alawys) work with files, not unsaved text buffers. That is good practice with everything you do on a Computer.

dhaumann
  • 621
  • 6
  • 9
  • 2
    Accepting this A, b/c I think you're confirming that I *can not* do what I asked (that I lose "all text buffers that were never saved"). Yes, it was a bad habit/practice, which I've mostly stopped doing. – hunter2 Jul 19 '14 at 15:10
  • 5
    “Rule of thumb: Always (and I repeat: alawys) work with files, not unsaved text buffers” — sorry, but I can't agree with that. You claim that features of specific software (or even bugs of specific software) should define patterns of a user's behavior. But in fact it should go the opposite way: patterns of the users' behavior should be taken into account when designing software. – sasha Oct 19 '20 at 16:12
  • 1
    Agreed, but currently fact is no one implemented this. We'd happily accept a patch, though! :) – dhaumann Oct 20 '20 at 19:57
  • 1
    I second @sasha. This could be a feature request. I note that Notepad++ does this, and I found it most useful. – sancho.s ReinstateMonicaCellio May 28 '21 at 09:08
0

first of all make all files visible (I mean hidden files) and try to search in the same dir files with "~" or like that.

ipeacocks
  • 251
  • 1
  • 2
  • 6
0

Without knowing anything about Kate in particular, I found [1] for vim. Both being unix programs, could there be something similar there?

(Just found similar unnamed file usage of another user.)

My sources:

[1]https://superuser.com/questions/195894/where-does-vim-gvim-macvim-keep-swap-files-for-unsaved-unnamed-buffers

mico
  • 701
  • 4
  • 9
  • 13
  • Yes, there *could*, and that's what I am/was hoping for. But they are entirely different programs, and the answers there do not *seem* to apply here. I tried to test what it said there (in particular, I hadn't seen "~/tmp/" before), with no luck. If you'd like, add more detail ... (Is there a specific reason to think one of those dirs works (and I'm blind - quite possible), or that KATE has a recovery feature I missed?) – hunter2 Jul 26 '13 at 03:42
  • 'Of course' I no longer have the original situation, nor am I in a hurry to replicate it. This time, my test was to create new buffers, put some gibberish in them, and check the directories mentioned. // (Although it would always be good to have the answer, the original situation was a few months ago, now, and I've tried to simply not let it happen again - at least take notes in a file that exists in a known location.) – hunter2 Jul 26 '13 at 03:47
  • Unfortunately, I don't have more knowledge on these programs. I just happened to find that post that somehow related. Bad luck that it did not serve the answer still. – mico Jul 26 '13 at 04:42