fun! Align not working...

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

fun! Align not working...

Steve Felt
Initially, I open vim and type

:scriptnames

/home/MyBox/.vim/plugin/Align.vim
/home/MyBox/.vim/plugin/AlignMaps.vim
/home/MyBox/.vim/plugin/cecutil.vim
...etc...

Align.vim is right there (version 27/31 2005-04-15)... when I run Align,
I get

E492: Not an editor command: '<,'>Align .

So, I source Align.vim:
:so  /home/MyBox/.vim/plugin/Align.vim

And now, the same command works fine!

Here are all scripts as returned by :scriptnames

/home/MyBox/.vim/plugin/Align.vim
/home/MyBox/.vim/plugin/AlignMaps.vim
/home/MyBox/.vim/plugin/ConvertBase.vim
/home/MyBox/.vim/plugin/ModifyHeader.vim
/home/MyBox/.vim/plugin/cecutil.vim
/home/MyBox/.vim/plugin/cvscommand.vim
/home/MyBox/.vim/plugin/engspchk.vim
/home/MyBox/.vim/plugin/matchit.vim
/home/MyBox/.vim/plugin/taglist.vim
/home/MyBox/.vim/plugin/templatefile.vim
/home/MyBox/.vim/plugin/vtreeexplorer.vim
/usr/local/share/vim/vim63/plugin/explorer.vim
/usr/local/share/vim/vim63/plugin/gzip.vim
/usr/local/share/vim/vim63/plugin/netrw.vim
/usr/local/share/vim/vim63/plugin/rrhelper.vim
/usr/local/share/vim/vim63/plugin/tohtml.vim
/usr/local/share/vim/vim63/menu.vim
/home/MyBox/.gvimrc
/usr/local/share/vim/vim63/syntax/syntax.vim
/usr/local/share/vim/vim63/syntax/synload.vim
/usr/local/share/vim/vim63/syntax/syncolor.vim
/home/MyBox/.vim/filetype.vim
/usr/local/share/vim/vim63/filetype.vim
/usr/local/share/vim/vim63/colors/murphy.vim
/usr/local/share/vim/vim63/ftplugin.vim
/usr/local/share/vim/vim63/scripts.vim
/home/MyBox/.vim/syntax/myScript.vim






--

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

Re: fun! Align not working...

Charles E Campbell Jr
Quoting Steve Felt <[hidden email]>:

> Initially, I open vim and type
>
> :scriptnames
>
> /home/MyBox/.vim/plugin/Align.vim
> /home/MyBox/.vim/plugin/AlignMaps.vim
> /home/MyBox/.vim/plugin/cecutil.vim
> ...etc...
>
> Align.vim is right there (version 27/31 2005-04-15)... when I run Align,
> I get
>
> E492: Not an editor command: '<,'>Align .
>
> So, I source Align.vim:
> :so  /home/MyBox/.vim/plugin/Align.vim
>
> And now, the same command works fine!...

Hello!

Do you have something akin to

"  Initialize: {{{1
set nocp
if version >= 600
  filetype plugin indent on
endif

in your <.vimrc>?

If so, then try inserting
  :set verbose=5
at the beginning of your <.vimrc> and see if Align is being loaded and
when.

Regards,
Chip Campbell

Reply | Threaded
Open this post in threaded view
|

Re: fun! Align not working...

Steve Felt
On Mon, 2005-06-20 at 10:23, [hidden email] wrote:

> Quoting Steve Felt <[hidden email]>:
>
> > Initially, I open vim and type
> >
> > :scriptnames
> >
> > /home/MyBox/.vim/plugin/Align.vim
> > /home/MyBox/.vim/plugin/AlignMaps.vim
> > /home/MyBox/.vim/plugin/cecutil.vim
> > ...etc...
> >
> > Align.vim is right there (version 27/31 2005-04-15)... when I run Align,
> > I get
> >
> > E492: Not an editor command: '<,'>Align .
> >
> > So, I source Align.vim:
> > :so  /home/MyBox/.vim/plugin/Align.vim
> >
> > And now, the same command works fine!...
>
> Hello!
>
> Do you have something akin to
>
> "  Initialize: {{{1
> set nocp
> if version >= 600
>   filetype plugin indent on
> endif
>
> in your <.vimrc>?
>
> If so, then try inserting
>   :set verbose=5
> at the beginning of your <.vimrc> and see if Align is being loaded and
> when.
>
> Regards,
> Chip Campbell

I added
    :set verbose=5
to the beginning of my .gvimrc file. A long list appears during gvim
startup which **does not** include anything in my /.vim/plugin
directory. Yet
    :scriptnames
still shows
  /.vim/plugin/Align.vim
  /.vim/plugin/AlignMaps.vim
  /.vim/plugin/ConvertBase.vim
  ...etc...

Apparently
    :scriptnames
shows more than **currently sourced files and scripts**? Anyone know
whether there is a command for that? I thought that all scripts in
/.vim/plugin are automatically sourced... Did I break something?  I'm
using vim 6.3

In my humble opinion,
    :he scriptnames
inaccurately says
  "List all sourced script names, in the order they were
   first sourced."

I added
    source plugin/Align.vim
to my gvimrc file, and everything is great. Thanks, this really is a
great script!

--

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

Re: fun! Align not working...

Yegappan Lakshmanan
Hi,

On 6/27/05, Steve Felt <[hidden email]> wrote:

>
> I added
>     :set verbose=5
> to the beginning of my .gvimrc file. A long list appears during gvim
> startup which **does not** include anything in my /.vim/plugin
> directory. Yet
>     :scriptnames
> still shows
>   /.vim/plugin/Align.vim
>   /.vim/plugin/AlignMaps.vim
>   /.vim/plugin/ConvertBase.vim
>   ...etc...
>
> Apparently
>     :scriptnames
> shows more than **currently sourced files and scripts**? Anyone know
> whether there is a command for that? I thought that all scripts in
> /.vim/plugin are automatically sourced... Did I break something?  I'm
> using vim 6.3
>
> In my humble opinion,
>     :he scriptnames
> inaccurately says
>   "List all sourced script names, in the order they were
>    first sourced."
>

Do you have a .vimrc or _vimrc file? If you don't have this file,
then Vim will start in Vi-compatible mode. In the Vi-compatible
mode, most of the plugins will skip sourcing the reminder of the
script/plugin. The output of the ":scriptnames" command
is correct. But the plugins skipped sourcing most of the script
by checking for the 'compatible' option.

If you either start Vim with the "-N" flag or create a .vimrc
file, then you will not see this problem.

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

Re: fun! Align not working...

Steve Felt
On Tue, 2005-06-28 at 16:56, Yegappan Lakshmanan wrote:

> Hi,
>
> On 6/27/05, Steve Felt <[hidden email]> wrote:
> >
> > I added
> >     :set verbose=5
> > to the beginning of my .gvimrc file. A long list appears during gvim
> > startup which **does not** include anything in my /.vim/plugin
> > directory. Yet
> >     :scriptnames
> > still shows
> >   /.vim/plugin/Align.vim
> >   /.vim/plugin/AlignMaps.vim
> >   /.vim/plugin/ConvertBase.vim
> >   ...etc...
> >
> > Apparently
> >     :scriptnames
> > shows more than **currently sourced files and scripts**? Anyone know
> > whether there is a command for that? I thought that all scripts in
> > /.vim/plugin are automatically sourced... Did I break something?  I'm
> > using vim 6.3
> >
> > In my humble opinion,
> >     :he scriptnames
> > inaccurately says
> >   "List all sourced script names, in the order they were
> >    first sourced."
> >
>
> Do you have a .vimrc or _vimrc file? If you don't have this file,
> then Vim will start in Vi-compatible mode. In the Vi-compatible
> mode, most of the plugins will skip sourcing the reminder of the
> script/plugin. The output of the ":scriptnames" command
> is correct. But the plugins skipped sourcing most of the script
> by checking for the 'compatible' option.
>
> If you either start Vim with the "-N" flag or create a .vimrc
> file, then you will not see this problem.
>
> - Yegappan

Thanks for the tip. You're absolutely right. I created an empty
.vimrc
file in my home directory and now things work as expected.

Bram, shouldn't the presence of a
.gvimrc
file (which is where I store all my settings) do the same thing?
--

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

Re: fun! Align not working...

A.J.Mechelynck
Steve Felt wrote:
[...]
> Thanks for the tip. You're absolutely right. I created an empty
> .vimrc
> file in my home directory and now things work as expected.
>
> Bram, shouldn't the presence of a
> .gvimrc
> file (which is where I store all my settings) do the same thing?

Historically, gvim was built as an addition to console Vim. The vimrc
already existed, and must still work for both. The gvimrc was thought of
as an add-on, for things that are never needed in console Vim. The idea
is that (almost) everyone should have a vimrc, or, for 'compatible'
mode, an exrc. GUI-only settings can be put in a gvimrc, or set by
ex-commands bracketed by "if has('gui_running')" -- or both. (My method
is to maintain no gvimrc but only a vimrc and to try to make it as
cross-platform as possible: unix or Windows, GUI or not, etc. When
needed, it's always possible to do one thing or another depending on
which flavour of Vim is currently running.)

To answer your question, I don't think a gvimrc by itself should trigger
'nocompatible' because it's conceivable that one would want to run a
vi-like GUI -- with an exrc and possibly a gvimrc.


Best regards,
Tony.

Reply | Threaded
Open this post in threaded view
|

Re: fun! Align not working...

Bram Moolenaar
In reply to this post by Steve Felt

Steve Felt wrote:

> Thanks for the tip. You're absolutely right. I created an empty .vimrc
> file in my home directory and now things work as expected.
>
> Bram, shouldn't the presence of a .gvimrc file (which is where I store
> all my settings) do the same thing?

That does make sense.  I sort of assumed that everybody that uses a
.gvimrc file would also have a .vimrc file.  Otherwise those settings
wouldn't work in Vim.  But I suppose people who only use gvim don't
care and put everything in their .gvimrc.

--
hundred-and-one symptoms of being an internet addict:
179. You wonder why your household garbage can doesn't have an
     "empty recycle bin" button.

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
 \\\     Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html   ///