LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 07-19-2011, 05:13 PM   #1
ADX
Member
 
Registered: Jul 2011
Location: 127.0.0.1
Distribution: Slackware64-13.37
Posts: 47

Rep: Reputation: 0
Question Basic question concerning vim


Here's what is going on; I'll open any file in vim to edit, and then when I'm finished and I enter ":wq", instead of saving the file I was editing, vim creates another by the same name with a tilde.

Any solutions?
 
Old 07-19-2011, 05:19 PM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,592
Blog Entries: 2

Rep: Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047
Vim actually is saving your file, but also creates a backup of the old file. That is the file with the tilde.
 
Old 07-19-2011, 05:22 PM   #3
Nermal
Member
 
Registered: Jan 2009
Distribution: Debian
Posts: 59
Blog Entries: 2

Rep: Reputation: 6
Code:
bash$ ls ~/tmp
bash$ vim ~/tmp/test.txt
<edit file and :wq or :x out of vim>
bash$ ls ~/tmp
test.txt
bash$ vim ~/tmp/test.txt
<edit file and :wq or :x out of vim>
bash$ ls ~/tmp
test.txt
test.txt~
something like that? the ~ version is a backup. search "vim turn off backup" at a search engine of your choice, that should help.
 
Old 07-19-2011, 07:27 PM   #4
ADX
Member
 
Registered: Jul 2011
Location: 127.0.0.1
Distribution: Slackware64-13.37
Posts: 47

Original Poster
Rep: Reputation: 0
Figured it out, thanks for the help.

Last edited by ADX; 07-19-2011 at 07:34 PM.
 
Old 07-19-2011, 07:30 PM   #5
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,592
Blog Entries: 2

Rep: Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047
Just create a .vimrc in your home-folder and add that option.
 
  


Reply

Tags
saving, vim


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
basic html question - download link to files on my webpage question Davno Linux - Server 5 12-25-2009 07:24 AM
Editor comparison: vim VS vim-lite, Cleaning vim Ruler2112 *BSD 4 04-13-2009 04:26 PM
Basic VIM question tambrao Linux - Newbie 1 09-07-2006 04:33 PM
vim question xtremeclones Linux - General 2 07-07-2006 01:58 PM
vi/vim question kiley_rodgers Slackware 1 06-18-2003 09:15 AM


All times are GMT -5. The time now is 10:34 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration