Thursday, February 13, 2020

Re: Is "vim -C" supposed to override .vimrc?

On Thu, 13 Feb 2020 at 17:00, Gary Johnson <garyjohn@spocom.com> wrote:
>
> On 2020-02-13, 'Ottavio Caruso' via vim_use wrote:
> > Hi,
> >
> > this is a snippet or my vimrc:
> >
> > $ cat .vim/vimrc
> > source $VIMRUNTIME/defaults.vim
> > set dir=~/.vim/tmp
> > set expandtab
> > set autoindent
> > iabbrev mydate <C-R>=strftime("%a %d/%m/%Y")
> > digraph bl 8226 " Insert Bullet with <CTRL>+k bl
> > map <f5> :1m$<cr>
> >
> > which sources the default vim system file, which in turn sets
> > "nocompatible", as expected. So far. so good.
> >
> > If I start vim with:
> > $ vim -C somefile
> >
> > I expect this to turn some features off, for example visual mode with
> > mouse clicks, but it doesn't. If I manually set "compatible" from the
> > ex command line, it does turn visual mode off. I assume I could put
> > this is my vimrc, but I don't want to do this all the time. I could
> > probably make an alias to:
> >
> > vim -c "set compatible" somefile
> >
> > However I wonder if this is intended behaviour or not, that is, I
> > expected "vim -C" to override vimrc.
>
> From ":help -C":
>
> -C Compatible mode. Sets the 'compatible' option. You can use
> this to get 'compatible', even though a .vimrc file exists.
> Keep in mind that the command ":set nocompatible" in some
> plugin or startup script overrules this, so you may end up
> with 'nocompatible' anyway.

Thanks. I was looking at the wrong section of the help file.

(For posterity, setting "mouse=r" did what I meant to do).


--
Ottavio Caruso

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAEJNuHz1%2BhFhdh9UKqtL%3DPG6O7jd9Vh_zrvvvn5cLq7T-uzBHg%40mail.gmail.com.

No comments:

Post a Comment