Thursday, November 5, 2020

Re: [EXTERNAL] .swp files

Hello Kevin et al.,

There are also a few more things you could do to with Vim to "protect your work". First of all you can enable persistent undo. This will let you "go back in the past" of every text file you edit. When you will press "u" for undo Vim will revert the changes/edits that you made to the file. This StackExchange thread will provide you with more details: https://unix.stackexchange.com/questions/192212/vim-how-to-trace-back-all-changes-done-to-file-during-the-day. In short you may place the below settings into your .vimrc file:

" persistent undo {{{
" -------
if has("persistent_undo") && (v:version >= 704)

  set undodir=~/.vim/undodir
  set undofile
  set undolevels=1000
  set undoreload=10000

endif
" }}}

Second, you may enable Vim's backup feature. Please see the settings below. This way your back-up directory "backupdir" will contain the back-ups of your text files that you worked on. These files will have the name of <filename>~, i.e. the file name with a tilde at the end. When you will need to recover your work you will have to go to the back-up directory and rename the "tilde" file back into the original file. For example, if you work on a file "article.tex" your back-up file will be located in ~/tmp/article.tex~. In case your article.tex gets damaged or lost, you will be able to get the recovery version from ~/tmp/article.tex~ and rename it into the original article.tex.

" backup {{{
" ------
set backup
set backupdir=~/tmp
set directory=~/tmp
set writebackup
" }}}

Finally, if you don't know about it, yet there are plenty of version control software. For example Git. I would highly recommend you to learn it. Each project that you work on you may store in the separate repository on an online server, e.g. GitHub or GitLab. This repository can be private, if needed. It is a good practice to "commit" your changes to the Git repository at least daily. This way in the worst case you will only loose one day's work. I hope this helps. Thank you and have a good day ahead!

Best wishes,
Maxim

Maxim Abalenkov \\ maxim.abalenkov@gmail.com
+44 7 486 486 505 \\ http://mabalenk.gitlab.io

On 5 Nov 2020, at 23:21, Ruben Safir <ruben.safir@my.liu.edu> wrote:

On 11/5/20 4:19 PM, Kennedy, Marcus A. wrote:
A good backup system should provide more than the most recent copy.


PLEASE do not do this.  The swp files are already enough, if not too
much.  VIM is simple and works.  Leave it that way.  Let the user filing
this crazy complaint use openoffice (or learn good habits).



--
So many immigrant groups have swept through our town
that Brooklyn, like Atlantis, reaches mythological
proportions in the mind of the world - RI Safir 1998
http://www.mrbrklyn.com

DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002
http://www.nylxs.com - Leadership Development in Free Software
http://www2.mrbrklyn.com/resources - Unpublished Archive
http://www.coinhangout.com - coins!
http://www.brooklyn-living.com

Being so tracked is for FARM ANIMALS and and extermination camps,
but incompatible with living as a free human being. -RI Safir 2013

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/d52bd18c-750b-916d-0428-624ca74e9ff3%40my.liu.edu.

No comments: