>
----------------------------- Uma nova maneira de fazer negócio TabWay, o tablet da Itautec. Uma combinação entre o melhor do hardware, software e serviços para otimizar seus negócios. www.itautec.com.br/tabway ----------------------------- -----Original Message----- > From: [email protected] [mailto:[email protected]] On Behalf > Of Ben Fritz > Sent: quinta-feira, 26 de janeiro de 2012 13:46 > To: vim_use > Subject: Re: swap file directory > > > > On Jan 25, 12:29 pm, Damian Rodriguez Sanchez > <[email protected]> wrote: > > Hello, > > > > I stated to use a new computer where, as I expected for a default > behaviour, > > swap files are created in the current directory on a given screen or > window. > > But that happens only for the first file opened for a given screen or > > window. If I split the window (:sp or :vsp) and open different files on > each > > split, those files will have their corresponding swap files created > > somewhere else (/var/tmp). > > > > I tried specifying a specific directory for swap file in my .vimrc > inserting > > a line such as: > > > > set directory=~/.vim/swap_files// > > > > but it had effect only for the main file edited. Swap files for > subsequent > > files edited on each split continue to be created on /var/tmp. > > > > Does anybody know what I have to do to have only one location for all > swap > > files? > > > > You shouldn't need to do anything special. By default Vim will create > the swap files in the same directory as the edited file, for all > files. If this is not working, then Vim either cannot write to the > directory containing the file for some reason, or your 'directory' > option is being changed by some autocmd or plugin without your > knowing. Try using :verbose set directory? to see what it is set to > and from where when you discover that your swap file is not being > written where you expect. Also check that you have permissions to > create files in the directory you're editing files in. > > -- > You received this message from the "vim_use" maillist. > Do not top-post! Type your reply below the text you are replying to. > For more information, visit http://www.vim.org/maillist.php Thank you Ben! It was the default /etc/vimrc configuration that was changing my 'directory' option. For some reason it thinks it's a good idea to create swap files somewhere else for files that are edited from medias mounted on /media and /mnt: autocmd BufNewFile,BufReadPre /media/*,/mnt/* set directory=~/tmp,/var/tmp,/tmp I didn't know this. Is it default for all vim installations or only on this Linux distribution? (Fedora) I commented it out and things went back to normal. This configuration is not interesting at all for me since I'm using a working directory permanently mounted on /mnt (a hard disk, not a flash drive or anything). It doesn't even seem to work as it should since, as I explained in my previous e-mail, it makes swap files for the first file opened on a given window be created in the same directory as the ones that correspond to those opened on subsequent splits of the same window. Or am I getting something wrong? Anyway, thanks again. Damián. 0 -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php
