cknadler / vim-anywhere

Use Vim everywhere you've always wanted to
MIT License
3.65k stars 147 forks source link

Sourcing special file on startup? #37

Open lesguillemets opened 10 years ago

lesguillemets commented 10 years ago

Is there any default file like .vimrc that is sourced automatically on starting vim via vim-anywhere (along with .vimrc and .gvimrc)? I'm currently quite happy with editing ./bin/run, adding -c or -s options by hand, but I'd feel more comfortable if this application had such default file to write my preferences in.

One might want to source additional file on starting vim via vim-anywhere because the context it's usually used is somewhat different from usual editing with vim. As for me, I'd prefer white background because most websites have white backgrounds. One might want to set default filetype to markdown, or enable plugins designed specifically for text editing, not coding (I'm thinking of something like vim-quotable).

cknadler commented 10 years ago

vim-anywhere just invokes regular MacVim or GVim depending on your system. These both automatically source ~/.gvimrc and you can override your defaults to have them source whatever you'd like.

lesguillemets commented 10 years ago

Sorry I was terribly unclear. My suggestion was to have yet another file, say .vimanywhererc, that is sourced in addition to ~/.gvimrc only when gvim is invoked by vim-anywhere. I use GVim for coding, but I usually write plain texts or markdowns when I invoke it by vim-anywhere, so I thought it might be convenient to have GVim ready for writing texts (not codes) when I press ctrl+alt+v.

To be clear:

This is a tiny suggestion and vim-anywhere is amazing anyway. Thank you very much.

cknadler commented 10 years ago

No worries.

You bring up a great point. I actually have the same problem, but I'm trying to think of any way other than adding a .vim-anywhererc. Another solution would be to force the file type of the GVim instance to be text or markdown. That or allowing you to put a vim-anywhere configuration section in your .vimrc or .gvimrc and only activate it when vim-anywhere is invoked.

I'll look in to all three ideas and see what I come up with over the weekend.

Thanks! ^_^

lesguillemets commented 10 years ago

Thanks. Your ideas seems nice.