LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-16-2014, 05:30 PM   #1
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Change in Vim persistent undo behavior?


I just installed a new-used machine with 64 bit Slackware from -current and noted a difference in the behavior of Vim - it litters my filesystem with .filename.un~ files!

These are persistent undo files, a feature that was introduced with Vim 7.3.

I have several machines installed from -current earlier this year that do not act this way (Vim-7.4.050), but the -current Vim-7.4.258 does create the files by default. (I often install from -current but do not follow it closely).

vim --version shows that both were built with +persistent_undo, and it is supposed to be disabled by default, but I do not see where it is enabled in either the global or local vimrc, so I do not know why it is suddenly turned on??!!

Just wondering if anyone else noticed, or maybe it was a feature change and I missed the memo?

Easy enough to kill it...

Code:
In ~/.vimrc OR /usr/share/vim/vimrc

set noundofile

Last edited by astrogeek; 08-16-2014 at 06:16 PM.
 
Old 08-16-2014, 06:10 PM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263

Original Poster
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
There is indeed a change to the global vimrc (must have crossed my fingers or eyes the first time):

Code:
# sdiff -s vimrc-258 vimrc-050
" Last change:  2014 Feb 05                                   | " Last change:  2011 Apr 15
  set backup            " keep a backup file (restore to prev |   set backup            " keep a backup file
  set undofile          " keep an undo file (undo changes aft <
So this comes from upstream.

I am surprised no one else has noticed it, surely I am not the last, lonely vim user?

Last edited by astrogeek; 08-16-2014 at 06:17 PM.
 
Old 08-16-2014, 06:47 PM   #3
jstg
Member
 
Registered: Apr 2006
Distribution: Slackware
Posts: 59

Rep: Reputation: 37
I've always put
Code:
set undodir=$HOME/.vim/undo
in my ~/.vimrc so I never noticed the change.
 
1 members found this post helpful.
Old 08-16-2014, 07:06 PM   #4
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
I confirm that vim v. 7.4.50 doesn't enable undofile by default...
Thanks for letting us know

Last edited by keefaz; 08-16-2014 at 07:09 PM.
 
1 members found this post helpful.
Old 08-16-2014, 07:45 PM   #5
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263

Original Poster
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Quote:
Originally Posted by jstg View Post
I've always put
Code:
set undodir=$HOME/.vim/undo
in my ~/.vimrc so I never noticed the change.
I guess I have been on the other end of that equation, I do not use it and have always relied on it being disabled by default, so the change hit me in the head!

Actually, because they are hidden files I had not noticed them on the new machine. But I used it to organize and re-master some of my older installation notes then tarred them up and sent them to another machine where I did notice them. The other machine had 7.4.050 on it so it really confused me at first because I knew I had the same ~/.vimrc and could not reproduce them!

Quote:
Originally Posted by keefaz View Post
I confirm that vim v. 7.4.50 doesn't enable undofile by default...
Thanks for letting us know
Thanks for the confirmation.

It is a small but important change - one more config to tweak on new installs!
 
Old 08-17-2014, 05:43 AM   #6
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018
Quote:
Originally Posted by astrogeek View Post
It is a small but important change - one more config to tweak on new installs!
Up until recently, I've pretty much been an elvis guy, but "Thank you very much, huh-huh-huh" for the warning. I'll likely be using vim in future as I'm planning on moving to utf-8.

I'll have to add a .vimrc to my post-install /etc/skel customisations to go with the .Xresources, .bashrc, and other essentials I stick in there.
 
Old 08-17-2014, 12:07 PM   #7
saxa
Senior Member
 
Registered: Aug 2004
Location: Nova Gorica, Salvador
Distribution: Slackware
Posts: 1,211

Rep: Reputation: 295Reputation: 295Reputation: 295
I usually put in .vimrc file the line:

set nobackup
 
Old 08-17-2014, 01:51 PM   #8
audriusk
Member
 
Registered: Mar 2011
Location: Klaipėda, Lithuania
Distribution: Slackware
Posts: 360

Rep: Reputation: 199Reputation: 199
Quote:
Originally Posted by saxa View Post
I usually put in .vimrc file the line:

set nobackup
'backup' is for making backup before overwriting a file. It is not related to 'undofile' which saves undo history for a file, so you can quit Vim, open the file you were editing again and undo the recent changes as if Vim was never closed. See undo-persistence.
 
Old 08-17-2014, 02:24 PM   #9
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263

Original Poster
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Quote:
Originally Posted by GazL View Post
Up until recently, I've pretty much been an elvis guy, but "Thank you very much, huh-huh-huh" for the warning. I'll likely be using vim in future as I'm planning on moving to utf-8.

I'll have to add a .vimrc to my post-install /etc/skel customisations to go with the .Xresources, .bashrc, and other essentials I stick in there.
I am a Vim/UTF-8 kind of guy, I think you'll like it (but no sequined suits please!).

I already include a fairly extensive .vimrc in my /etc/skel, plus a custom colors.vim so just added the set noundofile line to the vim configs.

In fact, I maintain a centrally managed collection of post-install notes, configs and scripts that I deploy as my second action for all new installs (the first action is ln -s /usr/bin/vim /usr/bin/vi). My collection has grown extensively from some original notes with Mandrake 7.2 but I have never specifically updated it for 64 bit Slackware and had decided to do so with this machine. In the process I updated and cleaned up many things, and extensively changed my base font setup.

It was only after I had archived those changes and sent them back to the master repo that I noticed all the undo files. When I figured out what had happened I found them pretty much everywhere on the new machine. Not a feature I can appreciate!

So in the end I guess my update exercise was a success, including identifying this new addition to my list...

You are the first to mention /etc/skel for a long time. I rarely see mention of it and my impression is that most people only ever use defaults for .Xresources, ~/.*rc files, etc.. It would be interesting to know and maybe share some of the specific adaptations out there in the wild. Would the new SlackDocs wiki be an appropriate place for something like that I wonder?

Last edited by astrogeek; 08-17-2014 at 02:33 PM.
 
Old 08-17-2014, 06:06 PM   #10
saxa
Senior Member
 
Registered: Aug 2004
Location: Nova Gorica, Salvador
Distribution: Slackware
Posts: 1,211

Rep: Reputation: 295Reputation: 295Reputation: 295
@audriusk, ups I misunderstood the initial question.
 
Old 08-18-2014, 04:52 AM   #11
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018Reputation: 5018
Quote:
Originally Posted by astrogeek View Post
You are the first to mention /etc/skel for a long time. I rarely see mention of it and my impression is that most people only ever use defaults for .Xresources, ~/.*rc files, etc.. It would be interesting to know and maybe share some of the specific adaptations out there in the wild. Would the new SlackDocs wiki be an appropriate place for something like that I wonder?
I suspect most people only ever create the one user for their systems, so /etc/skel really doesn't buy them anything over popping the dotfiles into their $HOME directly. And yes, you're probably right that most users will just stick with defaults unless some issue forces them to make a change.

While I'm sure we could all pick up a few tips here and there from each others dotfiles, I'm not sure slackdocs is the place for that sort of stuff: much of what goes into them is down to personal preference and there's no "right answer". IMO it would just clutter the wiki up. I think sharing this sort of stuff with people is something that is probably best left to personal blog posts.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange vim startup behavior when accessed via cygwin ssh nicklaszlo Linux - Desktop 4 03-13-2010 10:49 PM
Strange Vim behavior in ubuntu, # goes to start of line. exodist Linux - Software 1 11-26-2008 08:59 PM
vim :gui trick and undo-trick dazdaz Linux - Software 3 09-10-2007 02:45 PM
annoying vim behavior pauloco Linux - Software 0 09-27-2005 12:10 PM
can't undo language change - Evolution & Pan under KDE3.2 redwine Linux - Software 1 04-24-2004 04:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration