Link to home
Start Free TrialLog in
Avatar of claghorn
claghorn

asked on

VIM file names

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?
Avatar of hermidae
hermidae

It's a backup file. Try to put this in your .vimrc file.

set nobackup
sorry.

And also:

set noswapfile
set nowritebackup  
Avatar of claghorn

ASKER

Its still doing it. I'm running on Windows.
I put those three entries in my _vimrc file @ C:\Program Files\Vim
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

ASKER CERTIFIED SOLUTION
Avatar of hermidae
hermidae

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial