Solved

VIM file names

Posted on 2011-02-22
5
309 Views
Last Modified: 2012-06-21
When I open a file and edit it ie: "vim_test.sql" using VIM, it gets saved as vim_test.sql~
So that now I have two files in the same place:
1. vim_test.sql
2. vim_test.sql~

Sometimes I'll end up with the above plus:
vim_test.sql~~

Why?
Is this so I can revert to an older version of my file. ie: VIM is providing this as a service?
Is there way to avoid this extra file creation?
0
Comment
Question by:claghorn
  • 3
  • 2
5 Comments
 
LVL 1

Expert Comment

by:hermidae
ID: 34953037
It's a backup file. Try to put this in your .vimrc file.

set nobackup
0
 
LVL 1

Expert Comment

by:hermidae
ID: 34953049
sorry.

And also:

set noswapfile
set nowritebackup  
0
 

Author Comment

by:claghorn
ID: 34953181
Its still doing it. I'm running on Windows.
I put those three entries in my _vimrc file @ C:\Program Files\Vim
0
 

Author Comment

by:claghorn
ID: 34953198
Here's the contents:

set nobackup
set noswapfile
set nowritebackup  
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin

set diffexpr=MyDiff()
function MyDiff()
  let opt = '-a --binary '
  if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
  if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
  let arg1 = v:fname_in
  if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
  let arg2 = v:fname_new
  if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
  let arg3 = v:fname_out
  if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
  let eq = ''
  if $VIMRUNTIME =~ ' '
    if &sh =~ '\<cmd'
      let cmd = '""' . $VIMRUNTIME . '\diff"'
      let eq = '"'
    else
      let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
    endif
  else
    let cmd = $VIMRUNTIME . '\diff'
  endif
  silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
endfunction

0
 
LVL 1

Accepted Solution

by:
hermidae earned 200 total points
ID: 34953354
Try to put it after the source.... lines
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org (http://seleniumhq.org) Go to that link and select download selenium in the right hand columnThat will then direct you to their downlo…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now