Sunday, June 26, 2011

Re: mkview problems

On 2011-06-26, lirenlin wrote:
> Hi everybody,
>
> I have some problems with mkview and loadview. The following is my
> setting in .vimrc file
>
> " when close the window, auto save the view
> au BufWinLeave *.* mkview
> " when open the window, auto load the view
> au BufWinEnter *.* silent loadview
>
> But when you use gvim then save the view, next time you open the file
> with vim in terminal, it outputs some error complain about unknown
> options.

It would have been more helpful if you had said exactly what those
errors were. Reporting only "some error" leaves us guessing what
the unknown options were.

Nevertheless, I think the problem is probably that your gvim was
compiled with more features than your vim was. A lot of GNU/Linux
distributions seem to do that. You can execute ":version" to see
which features each was compiled with.

If that is the problem, then I think the best solution is to use the
gvim binary for both the gvim and vim commands. One way to do that
is to execute "gvim -v" instead of "vim" when you want to run Vim in
a terminal. To make that more convenient, you can put this line in
your ~/.bashrc (assuming your shell is bash):

alias vim='gvim -v'

Another way to do that is to create your own ~/bin directory if you
don't already have one, then execute this command in your shell:

ln -s $(which gvim) ~/bin/vim

For that to work, you'll also need to make sure that ~/bin is in
your PATH. If it isn't already, then also add this to your
~/.bash_profile or ~/.profile, depending on which you use:

PATH=~/bin:$PATH

See

:help -v
:help ex

For the latter, scroll back a few lines to "The startup mode..." and
read from there to the "startup-options" tag.

Regards,
Gary

--
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

No comments: