_vimrc problems (backupdir)

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

_vimrc problems (backupdir)

jkilbour
I am rebuilding my _vimrc after a big hard drive crash, and am having
difficulty with a few things.

I would like to put vim backups in the directory C:/Temp/vim_backups. I
tried:
set backupdir=C:/Temp/vim_backups, but got
" _vimrc" E510: Can't make backupfile...

I added quotes to the directory name, then replaced the line with:
set backupdir = ".,c:/tmp,c:/temp"
hoping to get back to default, then took out the line altogether. I still
get the error.

Here is the whole _vimrc:

set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin


" UPDATE/RELOAD_vimrc
:nmap ,s :source $VIM/_vimrc
:nmap ,v :sp $VIM/_vimrc
"automatically restart vim after changing vimrc
autocmd! bufwritepost .vimrc source %

"searching
set ignorecase
set showmatch
set nohls
set wrapscan


set backspace=2
set splitbelow
set nu
"       whichwrap: Allow jump commands for left/right motion to wrap to
"       previous/next line when cursor is on first/last character in the
line:
set   whichwrap=<,>,h,l,[,]

set backupdir = ".,c:/tmp,c:/temp"
set statusline=%<%f%h%m%r%=%{&ff}\ %l,%c%V\ %P "shows fileformat
set laststatus=2


filetype plugin on
set syntax:if expand("%") == ""|browse confirm w|else|confirm w|endif

if has("gui_running")
        set guifont=Fixedsys:h9:cANSI
endif
colorscheme peachpuff


ino jj <ESC>

map ; :



Reply | Threaded
Open this post in threaded view
|

Re: _vimrc problems (backupdir)

Will Maier
On Mon, Aug 29, 2005 at 12:45:28PM -0400, [hidden email] wrote:
> I am rebuilding my _vimrc after a big hard drive crash, and am having
> difficulty with a few things.

> I would like to put vim backups in the directory C:/Temp/vim_backups. I
> tried:
> set backupdir=C:/Temp/vim_backups, but got
> " _vimrc" E510: Can't make backupfile...

Does that directory (C:/Temp/vim_backups) exist on your system?

--

o-------------------------------{ Will Maier }-------------------------------o
| jabber:       [hidden email] | email:               [hidden email] |
|    +           [hidden email] |    +            [hidden email] |
*--------[ Debian: The Universal Operating System (www.debian.org) ]---------*

Reply | Threaded
Open this post in threaded view
|

Re: _vimrc problems (backupdir)

A.J.Mechelynck
In reply to this post by jkilbour
----- Original Message -----
From: <[hidden email]>
To: <[hidden email]>
Sent: Monday, August 29, 2005 6:45 PM
Subject: _vimrc problems (backupdir)


>I am rebuilding my _vimrc after a big hard drive crash, and am having
> difficulty with a few things.
>
> I would like to put vim backups in the directory C:/Temp/vim_backups. I
> tried:
> set backupdir=C:/Temp/vim_backups, but got
> " _vimrc" E510: Can't make backupfile...
>
> I added quotes to the directory name, then replaced the line with:
> set backupdir = ".,c:/tmp,c:/temp"
> hoping to get back to default, then took out the line altogether. I still
> get the error.
[...]

I think that that kind of parameter (a pathname to be passed to Dos/Windows)
must appear in Dos/Windows format, i.e., with backslashes (not forward
slashes) as path separators. This raises an additional issue, i.e., IIRC
backslashes must themselves be backslash-escaped in ":set" statements.

Try
    if !isdirectory('C:\Temp')
        !mkdir C:\Temp
    endif
    if !isdirectory('C:\Temp\vim_backups')
        !mkdir C:\Temp\vim_backups
    endif
    set backupdir=C:\\Temp\\vim_backups

Note the single quotes, thans to which we can avoid doubling backslashes in
the "if" statements.


Best regards,
Tony.


Reply | Threaded
Open this post in threaded view
|

Re: _vimrc problems (backupdir) - also post save mode

jkilbour
In reply to this post by jkilbour
I got the backup problem fixed by deleting and recreating the _vimrc file,
and using your advice. Thanks

After I save a file, I am returned to it in insert mode. Is there a way to
ensure that I return in regular mode?

John

> On 8/30/05, [hidden email] <[hidden email]> wrote:
>>
>> I am rebuilding my _vimrc after a big hard drive crash, and am having
>> difficulty with a few things.
>>
>> I would like to put vim backups in the directory C:/Temp/vim_backups.
>> I tried:
>> set backupdir=C:/Temp/vim_backups, but got
>
>
> the C:/Temp/vim_backups directory should exist.
>
> " _vimrc" E510: Can't make backupfile...
>>
>> I added quotes to the directory name, then replaced the line with: set
>> backupdir = ".,c:/tmp,c:/temp"
>
>
> set backupdir = .,c:/tmp, c:/temp is enough
>
> hoping to get back to default, then took out the line altogether. I
> still
>> get the error.
>>
>> Here is the whole _vimrc:
>>
>> set nocompatible
>> source $VIMRUNTIME/vimrc_example.vim
>> source $VIMRUNTIME/mswin.vim
>> behave mswin
>>
>>
>> " UPDATE/RELOAD_vimrc
>> :nmap ,s :source $VIM/_vimrc
>> :nmap ,v :sp $VIM/_vimrc
>> "automatically restart vim after changing vimrc
>> autocmd! bufwritepost .vimrc source %
>>
>> "searching
>> set ignorecase
>> set showmatch
>> set nohls
>> set wrapscan
>>
>>
>> set backspace=2
>> set splitbelow
>> set nu
>> " whichwrap: Allow jump commands for left/right motion to wrap to "
>> previous/next line when cursor is on first/last character in the line:
>> set whichwrap=<,>,h,l,[,]
>>
>> set backupdir = ".,c:/tmp,c:/temp"
>> set statusline=%<%f%h%m%r%=%{&ff}\ %l,%c%V\ %P "shows fileformat set
>> laststatus=2
>>
>>
>> filetype plugin on
>> set syntax:if expand("%") == ""|browse confirm w|else|confirm w|endif
>>
>> if has("gui_running")
>> set guifont=Fixedsys:h9:cANSI
>> endif
>> colorscheme peachpuff
>>
>>
>> ino jj <ESC>
>>
>> map ; :
>>
>>
>>



Reply | Threaded
Open this post in threaded view
|

Re: _vimrc problems (backupdir) - also post save mode

A.J.Mechelynck
----- Original Message -----
From: <[hidden email]>
To: <[hidden email]>
Sent: Monday, August 29, 2005 7:14 PM
Subject: Re: _vimrc problems (backupdir) - also post save mode


>I got the backup problem fixed by deleting and recreating the _vimrc file,
> and using your advice. Thanks
>
> After I save a file, I am returned to it in insert mode. Is there a way to
> ensure that I return in regular mode?
>
> John
[...]

Unless you are easing the so-called "Easy Vim", any of

    :w
    :w filename
    :saveas filename

should leave you in Normal mode.

so, what is the answer to
    :set insertmode?
(with question mark)?

If it is "noinsertmode", then it's something else (maybe an autocommand).


Best regards,
Tony.


Reply | Threaded
Open this post in threaded view
|

Re: _vimrc problems (backupdir) - also post save mode

jkilbour
I was using the gui menu to save. When I use :w thereis no problem.

BTW, what is the differnce between the givm and vim executables?

> ----- Original Message -----
> From: <[hidden email]>
> To: <[hidden email]>
> Sent: Monday, August 29, 2005 7:14 PM
> Subject: Re: _vimrc problems (backupdir) - also post save mode
>
>
>>I got the backup problem fixed by deleting and recreating the _vimrc
>> file,
>> and using your advice. Thanks
>>
>> After I save a file, I am returned to it in insert mode. Is there a
>> way to ensure that I return in regular mode?
>>
>> John
> [...]
>
> Unless you are easing the so-called "Easy Vim", any of
>
>     :w
>     :w filename
>     :saveas filename
>
> should leave you in Normal mode.
>
> so, what is the answer to
>     :set insertmode?
> (with question mark)?
>
> If it is "noinsertmode", then it's something else (maybe an
> autocommand).
>
>
> Best regards,
> Tony.



Reply | Threaded
Open this post in threaded view
|

Re: _vimrc problems (backupdir) - also post save mode

A.J.Mechelynck
----- Original Message -----
From: <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, August 30, 2005 1:21 AM
Subject: Re: _vimrc problems (backupdir) - also post save mode


>I was using the gui menu to save. When I use :w thereis no problem.

Well, well, well... In my GUI, "File -> Save" triggers the ":w" command.
>
> BTW, what is the difference between the givm and vim executables?

On Windows, it's as follows:

- gvim has a "M$-Windows-like" GUI interface; vim opens in the "dos box"
- gvim can (if compiled for it, set up properly, and with a proper font)
display any Unicode character, even French, Danish, Czech, Russian, Greek,
Hebrew and Arabic at the same time; vim can only display the characters
defined in the current code page. This means that, when Windows is set up
for almost any country other than some East-Asian countries, no more than
256 characters (space included) are available to vim.

These are the most obvious differences; for more, the commands

    :helpgrep /\<GUI\>/
    :copen

will show you all lines in the help files with the word GUI. Hit <Enter> on
one of those lines and you will see the corresponding help file in a help
window. Anything which exists only in the GUI is not found in vim.exe (as
different from gvim.exe).

On Unix, the matter is slightly more complicated, since there (but not on
Windows) it is possible to compile a GUI version, name the executable vim,
and use it both in GUI mode and console mode depending on how it is invoked.
However, if an executable named "gvim" and another named "vim" are both
present, then the one named "vim" is usually not gui-capable.


Best regards,
Tony


Reply | Threaded
Open this post in threaded view
|

Re: _vimrc problems (backupdir) - also post save mode

jkilbour
nothing happened when I tried :helpgrep /\<GUI\>/
:copen didn't seem to have anything to do with gui issues.

also, sometimes I get two messages (as from you, TM) in my mailbox from
vim.org'\; is there a way I could just receive one?

john

> ----- Original Message -----
> From: <[hidden email]>
> To: <[hidden email]>
> Sent: Tuesday, August 30, 2005 1:21 AM
> Subject: Re: _vimrc problems (backupdir) - also post save mode
>
>
>>I was using the gui menu to save. When I use :w thereis no problem.
>
> Well, well, well... In my GUI, "File -> Save" triggers the ":w" command.
>>
>> BTW, what is the difference between the givm and vim executables?
>
> On Windows, it's as follows:
>
> - gvim has a "M$-Windows-like" GUI interface; vim opens in the "dos box"
> - gvim can (if compiled for it, set up properly, and with a proper font)
>  display any Unicode character, even French, Danish, Czech, Russian,
> Greek,  Hebrew and Arabic at the same time; vim can only display the
> characters  defined in the current code page. This means that, when
> Windows is set up  for almost any country other than some East-Asian
> countries, no more than  256 characters (space included) are available
> to vim.
>
> These are the most obvious differences; for more, the commands
>
>     :helpgrep /\<GUI\>/
>     :copen
>
> will show you all lines in the help files with the word GUI. Hit <Enter>
> on  one of those lines and you will see the corresponding help file in a
> help  window. Anything which exists only in the GUI is not found in
> vim.exe (as  different from gvim.exe).
>
> On Unix, the matter is slightly more complicated, since there (but not
> on  Windows) it is possible to compile a GUI version, name the
> executable vim,  and use it both in GUI mode and console mode depending
> on how it is invoked.  However, if an executable named "gvim" and
> another named "vim" are both  present, then the one named "vim" is
> usually not gui-capable.
>
>
> Best regards,
> Tony



Reply | Threaded
Open this post in threaded view
|

Re: _vimrc problems (backupdir) - also post save mode

A.J.Mechelynck
----- Original Message -----
From: <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, August 30, 2005 2:44 AM
Subject: Re: _vimrc problems (backupdir) - also post save mode


> nothing happened when I tried :helpgrep /\<GUI\>/
> :copen didn't seem to have anything to do with gui issues.
>
> also, sometimes I get two messages (as from you, TM) in my mailbox from
> vim.org'\; is there a way I could just receive one?
>
> john

Oops. The forward slashes shouldn't have been there (I confused the syntax
between :helpgrep and :vimgrep).

":helpgrep" searches your help files for the pattern, and generates a
"quickfix error file" with the results. However, you don't see those results
unless you open the quickfix window. ":copen" does that.

About the two messages: I have acquired the reflex of replying "to all", not
"to sender" on mailing list messages. This is IIUC the simplest way to make
sure that the list gets one ("Reply to sender" would send the reply to the
poster only, not to the list). Since I am sending the same message both to
you directly _and_ to the list, you would normally receive it twice, unless
you set up some mail filter to eliminate one of them. There is no simple way
to do that.


Best regards,
Tony.


Reply | Threaded
Open this post in threaded view
|

Re: _vimrc problems (backupdir) - also post save mode

jkilbour
The only permutation that gives a result at all is to remove all slashes
(forward and backward). Then I get an entry about Arabic fonts.

> ----- Original Message -----
> From: <[hidden email]>
> To: <[hidden email]>
> Sent: Tuesday, August 30, 2005 2:44 AM
> Subject: Re: _vimrc problems (backupdir) - also post save mode
>
>
>> nothing happened when I tried :helpgrep /\<GUI\>/
>> :copen didn't seem to have anything to do with gui issues.
>>
>> also, sometimes I get two messages (as from you, TM) in my mailbox
>> from vim.org'\; is there a way I could just receive one?
>>
>> john
>
> Oops. The forward slashes shouldn't have been there (I confused the
> syntax  between :helpgrep and :vimgrep).
>
> ":helpgrep" searches your help files for the pattern, and generates a
> "quickfix error file" with the results. However, you don't see those
> results  unless you open the quickfix window. ":copen" does that.
>
> About the two messages: I have acquired the reflex of replying "to all",
> not  "to sender" on mailing list messages. This is IIUC the simplest way
> to make  sure that the list gets one ("Reply to sender" would send the
> reply to the  poster only, not to the list). Since I am sending the same
> message both to  you directly _and_ to the list, you would normally
> receive it twice, unless  you set up some mail filter to eliminate one
> of them. There is no simple way  to do that.
>
>
> Best regards,
> Tony.



Reply | Threaded
Open this post in threaded view
|

Re: _vimrc problems (backupdir) - also post save mode

A.J.Mechelynck
----- Original Message -----
From: <[hidden email]>
To: <[hidden email]>
Sent: Tuesday, August 30, 2005 3:29 AM
Subject: Re: _vimrc problems (backupdir) - also post save mode

":helpgrep \<GUI\>" (without the quotes) should (after some time) find all
places where GUI appears as a word. On my gvim it finds 943 matches. Get
from one to the other using ":cnext" and ":cprev" (without the quotes in
both cases) or see them all in the quickfix window (which can be opened by
":copen" [again, without the quotes] after the cursor comes back blinking
from running the helpgrep command). On the same system, ":helpgrep GUI"
(still without the quotes) finds 972 matches. Go from one to the other like
before.

After running the :helpgrep command, you see the first match. "Something
about Arabic" is likely because arabic.txt comes near the beginning of the
alphabet.

See ":help quickfix.txt" (the whole help file) about how to navigate the
quickfix list.


Best regards,
Tony.