Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 08-01-2003, 09:25 AM   #1
LQ Newbie
Registered: May 2003
Location: Boise, Idaho
Posts: 6

Rep: Reputation: 0
Post VIM help

I installed vim on my work computer so I could actually have a good editor to work with. Whenever I make changes and save a file VIM creates a backup.

For Example:
If I make changes to and save "example.html" VIM will create a "example.html~" file in the document root.

I spent several hours doing some RTFM but I just don't have the time to read every bit of documentation that has ever been written about VIM. Like I said, I don't have this problem with the VIM I run from ETRM at home. Is this just a windows VIM thing? Any help will be rewarded with 40 virgins and a place at the right had of Jebus.
Old 08-01-2003, 09:48 AM   #2
Registered: Jun 2001
Location: Houston, TX, USA
Distribution: Debian
Posts: 569

Rep: Reputation: 31
Do you want it to not create a backup or what? I suggest you check out the "nobackup" page (for either case), by doing :h nobackup in vim.
Old 08-01-2003, 10:28 AM   #3
LQ Newbie
Registered: May 2003
Location: Boise, Idaho
Posts: 6

Original Poster
Rep: Reputation: 0
Post more backup issues

First of all, thank you for the advice. I am trying to get VIM to STOP making backups of all my files. My directories are getting packed with backup files that are not causing a space issue but are causing a file-management headache. I looked through the help files that you suggested and found the solution. If I do a :set nobackup from within VIM a backup is not made. However I tried to set this as a global settings by adding the line to my _vimrc file. This is how my file looks now.

set nocompatible
set shiftwidth=4
set tabstop=4
set wrap!
set nobackup
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
set diffexpr=MyDiff()
function MyDiff()
let opt = ''
if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
silent execute '!C:\Vim\vim61\diff -a ' . opt . v:fname_in . ' ' . v:fname_new . ' > ' . v:fname_out

It should do the same thing to have that set value in this file but it does not. With that value in there I am still getting backup files every time I save a file. Any other ideas???
Old 08-01-2003, 10:58 AM   #4
LQ Newbie
Registered: May 2003
Location: Boise, Idaho
Posts: 6

Original Poster
Rep: Reputation: 0
Post I found the fix

I figured it out but I thought I would post the results. The _vimrc file was using other config files in the fom of...

source $VIMRUNTIME/vimrc_example.vim

The vimrc_example.vim file had a line value for...

"set backup"

...which was turning the backup feature back on, even after I disabled it in the _vimrv file. So if anybody else has a problem make sure you check the other files that your _vimrc is sourced to. Thanks again for the help! Happy Hacking!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
encryption with Vim (vim -x) mikshaw Linux - Software 2 03-07-2007 09:00 AM
vim bluetwist Debian 2 08-01-2005 08:43 PM
Vim and C++ Dartelin Programming 4 09-16-2004 09:30 AM
^M and vim jrdioko Linux - Software 5 08-04-2004 11:36 PM
Better looking VIM? the_styler Linux - Newbie 5 04-04-2003 07:29 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:29 PM.

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