update?

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

update?

linda.s
How can I update the settings in the code for vimrc to make it
immediately reflect the changes?
Thanks,
Linda
Reply | Threaded
Open this post in threaded view
|

Re: update?

c.lina
On Wed, 8 Feb 2006 01:25:15 -0800
"linda.s" <[hidden email]> wrote:

> How can I update the settings in the code for vimrc to make it
> immediately reflect the changes?
> Thanks,
> Linda
>

In the file, where the changes should be effective, do
:source /yourpath/_gvimrc
or
:source /yourpath/_vimrc

Substitute yourpath by the path where your _vimrc or _gvimrc
is located. (_gvimrc is for the gui version of vim).

Catherine.
Reply | Threaded
Open this post in threaded view
|

Re: update?

Yakov Lerner
In reply to this post by linda.s
"linda.s" <[hidden email]> write:

> How can I update the settings in the code for vimrc to make it
> immediately reflect the changes?

It is not clear what you mean by this.
Which of the following do you mean:

(1) that settings that you interactively change (:set ...)
    in you vim session be saved into your vimrc ?, or
(2) that changes in your vimrc file take effect in the already-running
vim ?

Yakov
--
 
  [hidden email]

--
http://www.fastmail.fm - IMAP accessible web-mail

Reply | Threaded
Open this post in threaded view
|

Re: update?

linda.s
In reply to this post by c.lina
On 2/8/06, [hidden email] <[hidden email]> wrote:

> On Wed, 8 Feb 2006 01:25:15 -0800
> "linda.s" <[hidden email]> wrote:
>
> > How can I update the settings in the code for vimrc to make it
> > immediately reflect the changes?
> > Thanks,
> > Linda
> >
>
> In the file, where the changes should be effective, do
> :source /yourpath/_gvimrc
> or
> :source /yourpath/_vimrc
>
> Substitute yourpath by the path where your _vimrc or _gvimrc
> is located. (_gvimrc is for the gui version of vim).
>
> Catherine.
after :, I typed source /C:/temp/.vimrc
it reports error;
so I typed source .vimrc,
no errors report, but no change took place.
Sorry for my naive questions.
L.
Reply | Threaded
Open this post in threaded view
|

Re: update?

c.lina
On Wed, 8 Feb 2006 02:30:08 -0800
"linda.s" <[hidden email]> wrote:

> On 2/8/06, [hidden email] <[hidden email]> wrote:
> > On Wed, 8 Feb 2006 01:25:15 -0800
> > "linda.s" <[hidden email]> wrote:
> >
> > > How can I update the settings in the code for vimrc to make it
> > > immediately reflect the changes?
> > > Thanks,
> > > Linda
> > >
> >
> > In the file, where the changes should be effective, do
> > :source /yourpath/_gvimrc
> > or
> > :source /yourpath/_vimrc
> >
> > Substitute yourpath by the path where your _vimrc or _gvimrc
> > is located. (_gvimrc is for the gui version of vim).
> >
> > Catherine.
> after :, I typed source /C:/temp/.vimrc
> it reports error;
> so I typed source .vimrc,
> no errors report, but no change took place.
> Sorry for my naive questions.
> L.
>

I am using vim on linux and not windows. I think that on
windows the vimrc file starts with a _  and not with a dot.
I think your _vimrc should be located somewhere in vimfiles
but this is only a wild guess. Maybe the colon after the C
in your path should be removed.
Maybe a windows user on the list can be of more help.

From the help for gvimrc (you can find that yourself by typing
:help gimvrc

- For Unix and MS-Windows, if the system gvimrc exists, it
  is sourced.  The name of this file is normally
  "$VIM/gvimrc".  You can check this with ":version".  Also
  see |$VIM|.

  - The following are tried, and only the first one that exists is used:
  - If the GVIMINIT environment variable exists and is not empty, it is
    executed as an Ex command.
  - If the user gvimrc file exists, it is sourced.  The name of this file is
    normally "$HOME/.gvimrc".  You can check this with ":version".
  - For Win32, when $HOME is not set, "$VIM\_gvimrc" is used.
  - When a "_gvimrc" file is not found, ".gvimrc" is tried too.  And vice
    versa.

     
If I run :version, then I get among other information the line

 user vimrc file: "$HOME/.vimrc"

What do you get?

Maybe you should check what $HOME is with
:echo $HOME
though I don't know if this exists on windows.


Regards, Cat.


--
==================================================
Cras vives? Hodie iam vivere, Postume, serum est.
Reply | Threaded
Open this post in threaded view
|

Re: update?

Mark Woodward-4
In reply to this post by linda.s
linda.s wrote:

>How can I update the settings in the code for vimrc to make it
>immediately reflect the changes?
>Thanks,
>Linda
>
>  
>
Hi linda

if the _vimrc file is still open:

:cd %:p:h      <enter>
:so %            <enter>

If you change it again then you can use : followed by the up/down arrows
then <enter>


use ':scriptnames' to find where your _vimrc file is.
If its in your home directory (:echo $HOME), ie a local one, you can
create a map along the lines of:

nmap <leader>rv  :so $HOME/_vimrc

here's mine (linux, so .vimrc rather than _vimrc)

nnoremap <leader>rsv :so $HOME/.vimrc<CR>
inoremap <leader>rsv <esc>:so $HOME/.vimrc<CR>a
nnoremap <leader>ev :split $HOME/.vimrc<CR>
inoremap <leader>ev <esc>:split $HOME/.vimrc<CR>a
nnoremap <leader>rsg :so $HOME/.gvimrc<CR>
inoremap <leader>rsg <esc>:so $HOME/.gvimrc<CR>a
nnoremap <leader>eg :split $HOME/.gvimrc<CR>
inoremap <leader>eg <esc>:split $HOME/.gvimrc<CR>a


--
Mark
Reply | Threaded
Open this post in threaded view
|

Re: update?

Yakov Lerner
In reply to this post by linda.s
"linda.s" <[hidden email]> wrote:
> On 2/8/06, [hidden email] <[hidden email]> wrote:
> > On Wed, 8 Feb 2006 01:25:15 -0800
> > "linda.s" <[hidden email]> wrote:
> after :, I typed source /C:/temp/.vimrc

On windows, you do not need initial slash (the one before C:).
Try this:

    :so C:/temp/.vimrc

Yakov
--
 
  [hidden email]

--
http://www.fastmail.fm - Access your email from home and the web

Reply | Threaded
Open this post in threaded view
|

Re: update?

linda.s
On 2/8/06, [hidden email] <[hidden email]> wrote:

> "linda.s" <[hidden email]> wrote:
> > On 2/8/06, [hidden email] <[hidden email]> wrote:
> > > On Wed, 8 Feb 2006 01:25:15 -0800
> > > "linda.s" <[hidden email]> wrote:
> > after :, I typed source /C:/temp/.vimrc
>
> On windows, you do not need initial slash (the one before C:).
> Try this:
>
>    :so C:/temp/.vimrc
>
> Yakov
> --
>
>  [hidden email]
I tried. It did not report error but nothing was changed.
Thanks,
Linda
Reply | Threaded
Open this post in threaded view
|

Re: update?

Marian Csontos

> I tried. It did not report error but nothing was changed.
> Thanks,
> Linda

Is your file in C:/temp/.vimrc? (Are you only testing it, or is it your  
HOME direcotry?)
Are you using vim or gvim?
What option have you changed?
What do you expect to happen?

-- Marian



________ Information from NOD32 ________
This message was checked by NOD32 Antivirus System for Linux Mail Server.
  part000.txt - is OK
http://www.nod32.com
Reply | Threaded
Open this post in threaded view
|

Re: update?

Yakov Lerner
In reply to this post by linda.s
"linda.s" <[hidden email]> wrote:
> > On windows, you do not need initial slash (the one before C:).
> > Try this:
> >
> >    :so C:/temp/.vimrc
> I tried. It did not report error but nothing was changed.

In order to cross-check that script was indeed sources and executed, you
can [temporarily] insert this line into the sourced file:

:call input("currently executing ".expand("<sfile>")."...press a key")

Yakov
--
 
  [hidden email]

--
http://www.fastmail.fm - IMAP accessible web-mail

Reply | Threaded
Open this post in threaded view
|

Re: update?

Benji Fisher
In reply to this post by Mark Woodward-4
On Wed, Feb 08, 2006 at 10:30:35PM +1100, Mark Woodward wrote:

> linda.s wrote:
>
> >How can I update the settings in the code for vimrc to make it
> >immediately reflect the changes?
> >Thanks,
> >Linda
> >
> Hi linda
>
> if the _vimrc file is still open:
>
> :cd %:p:h      <enter>
> :so %            <enter>
>
> If you change it again then you can use : followed by the up/down arrows
> then <enter>

     I do not think the first command is needed.  When I am tweaking my
vimrc file, I often use

:w | so %

to save and load the changes in one step.  Then I use the command
history, usually

:w<Up>

to repeat.

HTH --Benji Fisher
Reply | Threaded
Open this post in threaded view
|

Re: update?

Thomas Geulig
Am Mittwoch, 8. Februar 2006 14:42 schrieb Benji Fisher:

> On Wed, Feb 08, 2006 at 10:30:35PM +1100, Mark Woodward wrote:
> > linda.s wrote:
> > >How can I update the settings in the code for vimrc to make it
> > >immediately reflect the changes?
> > >Thanks,
> > >Linda
> >
> > Hi linda
> >
> > if the _vimrc file is still open:
> > :cd %:p:h      <enter>
> > :so %            <enter>
> >
> > If you change it again then you can use : followed by the up/down arrows
> > then <enter>
>
>      I do not think the first command is needed.  When I am tweaking my
> vimrc file, I often use
>
> :w | so %
>
> to save and load the changes in one step.

You could use an autocommand (in your vimrc):

    autocmd! BufWritePost .vimrc so <afile>

Thomas


Reply | Threaded
Open this post in threaded view
|

Re: update?

A.J.Mechelynck
In reply to this post by linda.s
linda.s wrote:

> On 2/8/06, [hidden email] <[hidden email]> wrote:
>> "linda.s" <[hidden email]> wrote:
>>> On 2/8/06, [hidden email] <[hidden email]> wrote:
>>>> On Wed, 8 Feb 2006 01:25:15 -0800
>>>> "linda.s" <[hidden email]> wrote:
>>> after :, I typed source /C:/temp/.vimrc
>> On windows, you do not need initial slash (the one before C:).
>> Try this:
>>
>>    :so C:/temp/.vimrc
>>
>> Yakov
>> --
>>
>>  [hidden email]
> I tried. It did not report error but nothing was changed.
> Thanks,
> Linda
>
>
>

- Before you re-source your vimrc, be sure to edit it with your changes.

- If some of the Ex-commands in your vimrc cannot be run again, you may
need to restart Vim (after, of course, editing your vimrc with your new
settings, and saving it) instead of sourcing your vimrc again in your
current "live" Vim.


Best regards,
Tony.