LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 03-02-2014, 09:27 AM   #1
Weapon S
Member
 
Registered: May 2011
Location: Netherlands
Distribution: Debian, Archlinux
Posts: 268
Blog Entries: 2

Rep: Reputation: 49
Post Customizing swapfiles and backups in Vim


Hi,
after noticing Vim writes to my flash drive constantly, I made some changes to my vimrc. I edited the global vimrc located in /etc/vim/ on Debian.
It's something I threw together while searching the net. Last part of vimrc:
Code:
[...]
" <-- My settings --
set tabstop=4
let user_swap_dir='/tmp/' . $USER
silent execute '!umask 002; mkdir ' . user_swap_dir
set directory=user_swap_dir//
silent execute '!umask 002; mkdir ~/.local'
silent execute '!umask 002; mkdir ~/.local/vim_backups'
set backupdir=~/.local/vim_backups//
set nowrap
set scrolloff=4
set title
set visualbell
" -- End of my settings -->

" Source a global configuration file if available
if filereadable("/etc/vim/vimrc.local")
  source /etc/vim/vimrc.local
endif
Now Vim is unable to create a swapfile, though the directories seem to be created. Sometimes this makes Vim bug out on me.
I'd like to have files to recover from in case of power failure. IIUC I actually need the swap file for that; and not the backup file like my settings assume at the moment.
Could somebody please help me understand what is going wrong, or just give me a solution on a silver platter?
 
Old 03-02-2014, 12:30 PM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
I'd try absolute paths instead of "~", but that's just "me".
I don't know the correct remedy.
 
  


Reply

Tags
swapfile, vim, vimrc


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
LXer: Customizing vim for development LXer Syndicated Linux News 0 03-30-2012 04:41 AM
LXer: Customizing vim and coloring the terminal in OpenSolaris 2009.06 LXer Syndicated Linux News 0 07-12-2009 11:10 AM
Editor comparison: vim VS vim-lite, Cleaning vim Ruler2112 *BSD 4 04-13-2009 04:26 PM
Customizing VIM JMJ_coder Linux - General 3 09-18-2007 09:15 AM
Mandrake 10.x - Gvim 'split open' corrupts opened files and leaves ghost swapfiles Xolo Linux - Software 0 05-23-2005 05:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration