Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

VIM file names

Posted on 2011-02-22
5
312 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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. …
Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

809 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